CVS commit: src/sys/arch/arm/marvell

2017-01-09 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Mon Jan  9 14:15:20 UTC 2017

Modified Files:
src/sys/arch/arm/marvell: mvsoc.c

Log Message:
Remove no-need #ifdef MARVELL_ATTR_AXI_DDR.  It has defined.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/arm/marvell/mvsoc.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/arm/marvell/mvsoc.c
diff -u src/sys/arch/arm/marvell/mvsoc.c:1.26 src/sys/arch/arm/marvell/mvsoc.c:1.27
--- src/sys/arch/arm/marvell/mvsoc.c:1.26	Sat Jan  7 21:12:42 2017
+++ src/sys/arch/arm/marvell/mvsoc.c	Mon Jan  9 14:15:20 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: mvsoc.c,v 1.26 2017/01/07 21:12:42 christos Exp $	*/
+/*	$NetBSD: mvsoc.c,v 1.27 2017/01/09 14:15:20 kiyohara Exp $	*/
 /*
  * Copyright (c) 2007, 2008, 2013, 2014, 2016 KIYOHARA Takashi
  * All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mvsoc.c,v 1.26 2017/01/07 21:12:42 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mvsoc.c,v 1.27 2017/01/09 14:15:20 kiyohara Exp $");
 
 #include "opt_cputypes.h"
 #include "opt_mvsoc.h"
@@ -148,12 +148,10 @@ static struct {
 	{ MARVELL_TAG_SDRAM_CS3,
 	  MARVELL_ATTR_SDRAM_CS3,	MVSOC_UNITID_DDR },
 
-#ifdef MARVELL_ATTR_AXI_DDR /* XXX */
 	{ MARVELL_TAG_AXI_CS0,
 	  MARVELL_ATTR_AXI_DDR,		MVSOC_UNITID_DDR },
 	{ MARVELL_TAG_AXI_CS1,
 	  MARVELL_ATTR_AXI_DDR,		MVSOC_UNITID_DDR },
-#endif
 
 	{ MARVELL_TAG_DDR3_CS0,
 	  MARVELL_ATTR_SDRAM_CS0,	MVSOC_UNITID_DDR },



CVS commit: src/sys/dev/marvell

2017-01-09 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Mon Jan  9 14:06:35 UTC 2017

Modified Files:
src/sys/dev/marvell: marvellreg.h

Log Message:
Add ATTR_AXI_DDR.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/marvell/marvellreg.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/dev/marvell/marvellreg.h
diff -u src/sys/dev/marvell/marvellreg.h:1.10 src/sys/dev/marvell/marvellreg.h:1.11
--- src/sys/dev/marvell/marvellreg.h:1.10	Tue Oct  4 15:02:27 2016
+++ src/sys/dev/marvell/marvellreg.h	Mon Jan  9 14:06:35 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: marvellreg.h,v 1.10 2016/10/04 15:02:27 kiyohara Exp $	*/
+/*	$NetBSD: marvellreg.h,v 1.11 2017/01/09 14:06:35 kiyohara Exp $	*/
 /*
  * Copyright (c) 2009 KIYOHARA Takashi
  * All rights reserved.
@@ -88,5 +88,6 @@
 #define MARVELL_ATTR_SDRAM_CS2		0x0b
 #define MARVELL_ATTR_SDRAM_CS3		0x07
 #endif
+#define MARVELL_ATTR_AXI_DDR		0x00
 
 #endif	/* _DEV_MARVELL_MARVELLREG_H_ */



CVS commit: src/etc/etc.evbarm

2017-01-07 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Jan  7 16:29:04 UTC 2017

Modified Files:
src/etc/etc.evbarm: Makefile.inc

Log Message:
Add CUBOX to v7 and v7hf.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/etc/etc.evbarm/Makefile.inc

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

Modified files:

Index: src/etc/etc.evbarm/Makefile.inc
diff -u src/etc/etc.evbarm/Makefile.inc:1.80 src/etc/etc.evbarm/Makefile.inc:1.81
--- src/etc/etc.evbarm/Makefile.inc:1.80	Tue May 17 06:44:45 2016
+++ src/etc/etc.evbarm/Makefile.inc	Sat Jan  7 16:29:04 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.80 2016/05/17 06:44:45 ryo Exp $
+#	$NetBSD: Makefile.inc,v 1.81 2017/01/07 16:29:04 kiyohara Exp $
 #
 #	etc.evbarm/Makefile.inc -- evbarm-specific etc Makefile targets
 #
@@ -98,6 +98,8 @@ EVBARM_BOARDS.armv7+=		CUBIEBOARD
 EVBARM_BOARDS.armv7hf+= 	CUBIEBOARD
 EVBARM_BOARDS.armv7+=		CUBIETRUCK
 EVBARM_BOARDS.armv7hf+= 	CUBIETRUCK
+EVBARM_BOARDS.armv7+=		CUBOX
+EVBARM_BOARDS.armv7hf+= 	CUBOX
 EVBARM_BOARDS.armv7+=		CUBOX-I
 EVBARM_BOARDS.armv7hf+= 	CUBOX-I
 EVBARM_BOARDS.armv7+=		HUMMINGBIRD_A31



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

2017-01-07 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Jan  7 16:24:07 UTC 2017

Modified Files:
src/sys/arch/evbarm/conf: README.evbarm
Added Files:
src/sys/arch/evbarm/conf: CUBOX

Log Message:
Support SolidRun Cubox.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbarm/conf/CUBOX
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/evbarm/conf/README.evbarm

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/conf/README.evbarm
diff -u src/sys/arch/evbarm/conf/README.evbarm:1.13 src/sys/arch/evbarm/conf/README.evbarm:1.14
--- src/sys/arch/evbarm/conf/README.evbarm:1.13	Sat Oct 15 15:33:02 2016
+++ src/sys/arch/evbarm/conf/README.evbarm	Sat Jan  7 16:24:07 2017
@@ -1,4 +1,4 @@
-$NetBSD: README.evbarm,v 1.13 2016/10/15 15:33:02 kiyohara Exp $
+$NetBSD: README.evbarm,v 1.14 2017/01/07 16:24:07 kiyohara Exp $
 
 config		date		boards
 ---
@@ -13,6 +13,7 @@ BEAGLEBONE	2012/08/20	TI AM335x BeagleBo
 BPI		2014/09/07	Banana Pi
 CUBIEBOARD	2013/09/03	Cubietech Cubieboard 1 & 2
 CUBIETRUCK	2014/04/11	Cubietech Cubietruck
+CUBOX		2017/01/07	SolidRun Cubox
 CP3100		2006/11/08	Certance IOP321 CP-3100
 DEVKIT8000	2010/09/08	Embest OMAP3530 DevKit8000 eval Kit 
 DNS323		2010/10/02	D-Link DNS-323 Marvell SoC based NAS

Added files:

Index: src/sys/arch/evbarm/conf/CUBOX
diff -u /dev/null src/sys/arch/evbarm/conf/CUBOX:1.1
--- /dev/null	Sat Jan  7 16:24:07 2017
+++ src/sys/arch/evbarm/conf/CUBOX	Sat Jan  7 16:24:07 2017
@@ -0,0 +1,417 @@
+# $NetBSD: CUBOX,v 1.1 2017/01/07 16:24:07 kiyohara Exp $
+#
+#	CUBOX -- SolidRun Ltd. Cubox kernel
+#
+
+include	"arch/evbarm/conf/std.marvell"
+
+#options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
+
+# estimated number of users
+
+maxusers	32
+
+# Board Type
+makeoptions	BOARDTYPE="cubox"
+options 	EVBARM_BOARDTYPE=cubox
+
+# CPU options
+options 	CPU_PJ4B	# : CPU is PJ4
+options 	ARM_HAS_VBAR
+options 	FPU_VFP
+makeoptions	CPUFLAGS="-march=armv7-a -mfpu=vfpv3"
+
+# Marvell SoC options
+options 	DOVE
+
+# Standard system options
+
+options 	INSECURE	# disable kernel security levels - X needs this
+
+options 	RTC_OFFSET=0	# hardware clock is this many mins. west of GMT
+#options 	NTP		# NTP phase/frequency locked loop
+options 	KTRACE		# system call tracing via ktrace(1)
+
+# Note: SysV IPC parameters can be changed dynamically; see sysctl(8).
+options 	SYSVMSG		# System V-like message queues
+options 	SYSVSEM		# System V-like semaphores
+options 	SYSVSHM		# System V-like memory sharing
+
+#options 	USERCONF	# userconf(4) support
+#options 	PIPE_SOCKETPAIR	# smaller, but slower pipe(2)
+options 	SYSCTL_INCLUDE_DESCR	# Include sysctl descriptions in kernel
+
+# Alternate buffer queue strategies for better responsiveness under high
+# disk I/O load.
+#options 	BUFQ_READPRIO
+options 	BUFQ_PRIOCSCAN
+
+# Diagnostic/debugging support options
+#options 	VERBOSE_INIT_ARM # verbose bootstraping messages
+#options 	PERFCTRS	# performance counters
+options 	DIAGNOSTIC	# internally consistency checks
+
+#options 	DEBUG
+#options 	PMAP_DEBUG	# Enable pmap_debug_level code
+options 	LOCKDEBUG	# expensive locking checks/support
+options 	IRQSTATS	# manage IRQ statistics
+#options 	NO_POWERSAVE	# uncomment this to run under ICE
+
+#makeoptions	COPTS="-O2"
+options 	DDB			# in-kernel debugger
+#options 	DDB_KEYCODE=0x1d	# ^]
+#options 	DDB_COMMANDONENTER="bt"	# execute command when ddb is entered
+options 	DDB_ONPANIC=1		# see also sysctl(7): `ddb.onpanic'
+options 	DDB_HISTORY_SIZE=100	# Enable history editing in DDB
+options 	DDB_VERBOSE_HELP
+#options 	IPKDB			# remote kernel debugging
+#options	KGDB
+#options 	KGDB_DEVRATE=115200
+makeoptions	DEBUG="-g"		# compile full symbol table
+makeoptions	COPY_SYMTAB=1
+#options 	SYSCALL_STATS			# per syscall counts
+#options 	SYSCALL_TIMES			# per syscall times
+#options 	SYSCALL_TIMES_HASCOUNTER	# use 'broken' rdtsc (soekris)
+
+
+# Compatibility options
+options 	COMPAT_NETBSD32 # allow running arm (e.g. non-earm) binaries
+#options 	COMPAT_43	# 4.3BSD compatibility.
+#options 	COMPAT_09	# NetBSD 0.9,
+#options 	COMPAT_10	# NetBSD 1.0,
+#options 	COMPAT_11	# NetBSD 1.1,
+#options 	COMPAT_12	# NetBSD 1.2,
+#options 	COMPAT_13	# NetBSD 1.3,
+#options 	COMPAT_14	# NetBSD 1.4,
+#options 	COMPAT_15	# NetBSD 1.5,
+#options 	COMPAT_16	# NetBSD 1.6,
+#options 	COMPAT_20	# NetBSD 2.0,
+#options 	COMPAT_30	# NetBSD 3.0,
+#options 	COMPAT_40	# NetBSD 4.0,
+#options 	COMPAT_50	# NetBSD 5.0,
+options 	COMPAT_60	# NetBSD 6.0, and
+options 	COMPAT_70	# NetBSD 7.0 binary compatibility.
+#options 	TCP_COMPAT_42	# 4.2BSD TCP/IP bug compat. Not recommended.
+
+options 	COMPAT_OSSAUDIO	# OSS (Voxware) audio driver compatibility
+#options 	COMPAT_NDIS	# NDIS network driver
+options 	COMPAT_BSDPTY	# /dev/[pt]ty?? ptys.
+
+# Wedge support
+o

CVS commit: src/sys/arch

2017-01-07 Thread KIYOHARA Takashi
wood.c,v 1.10 2017/01/07 16:19:28 kiyohara Exp $	*/
 /*
  * Copyright (c) 2010 KIYOHARA Takashi
  * All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kirkwood.c,v 1.9 2014/03/11 07:52:37 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kirkwood.c,v 1.10 2017/01/07 16:19:28 kiyohara Exp $");
 
 #define _INTR_PRIVATE
 
@@ -56,6 +56,9 @@ static void kirkwood_pic_source_name(str
 
 static int kirkwood_find_pending_irqs(void);
 
+static void kirkwood_getclks(vaddr_t);
+static int kirkwood_clkgating(struct marvell_attach_args *);
+
 static const char * const sources[64] = {
 "MainHighSum(0)",  "Bridge(1)",   "Host2CPU DB(2)",  "CPU2Host DB(3)",
 "Reserved_4(4)",   "Xor0Chan0(5)","Xor0Chan1(6)","Xor1Chan0(7)",
@@ -111,15 +114,14 @@ static struct {
 
 
 /*
- * kirkwood_intr_bootstrap:
+ * kirkwood_bootstrap:
  *
- *	Initialize the rest of the interrupt subsystem, making it
+ *	Initialize the rest of the Kirkwood dependencies, making it
  *	ready to handle interrupts from devices.
  */
 void
-kirkwood_intr_bootstrap(void)
+kirkwood_bootstrap(vaddr_t iobase)
 {
-	extern void (*mvsoc_intr_init)(void);
 
 	/* disable all interrupts */
 	write_mlmbreg(KIRKWOOD_MLMB_MIRQIMLR, 0);
@@ -139,6 +141,9 @@ kirkwood_intr_bootstrap(void)
 	}
 	gpp_irqbase = 96;	/* Main Low(32) + High(32) + Bridge(32) */
 #endif
+
+	kirkwood_getclks(iobase);
+	mvsoc_clkgating = kirkwood_clkgating;
 }
 
 static void
@@ -224,8 +229,8 @@ kirkwood_find_pending_irqs(void)
  * Clock functions
  */
 
-void
-kirkwood_getclks(bus_addr_t iobase)
+static void
+kirkwood_getclks(vaddr_t iobase)
 {
 	uint32_t reg;
 	uint16_t model;
@@ -282,7 +287,7 @@ kirkwood_getclks(bus_addr_t iobase)
 
 }
 
-int
+static int
 kirkwood_clkgating(struct marvell_attach_args *mva)
 {
 	uint32_t val;

Index: src/sys/arch/arm/marvell/mv78xx0.c
diff -u src/sys/arch/arm/marvell/mv78xx0.c:1.1 src/sys/arch/arm/marvell/mv78xx0.c:1.2
--- src/sys/arch/arm/marvell/mv78xx0.c:1.1	Mon Sep 30 13:07:30 2013
+++ src/sys/arch/arm/marvell/mv78xx0.c	Sat Jan  7 16:19:28 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: mv78xx0.c,v 1.1 2013/09/30 13:07:30 kiyohara Exp $	*/
+/*	$NetBSD: mv78xx0.c,v 1.2 2017/01/07 16:19:28 kiyohara Exp $	*/
 /*
  * Copyright (c) 2010 KIYOHARA Takashi
  * All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mv78xx0.c,v 1.1 2013/09/30 13:07:30 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mv78xx0.c,v 1.2 2017/01/07 16:19:28 kiyohara Exp $");
 
 #define _INTR_PRIVATE
 
@@ -59,6 +59,8 @@ static void mv78xx0_pic_source_name(stru
 
 static int mv78xx0_find_pending_irqs(void);
 
+static void mv78xx0_getclks(vaddr_t);
+
 static const char * const sources[64] = {
 "ErrSum(0)",   "SPI(1)",  "TWSI0(2)","TWSI1(3)",
 "IDMA0(4)","IDMA1(5)","IDMA2(6)","IDMA3(7)",
@@ -93,15 +95,14 @@ static struct pic_softc mv78xx0_pic = {
 
 
 /*
- * mv78xx0_intr_bootstrap:
+ * mv78xx0_bootstrap:
  *
- *	Initialize the rest of the interrupt subsystem, making it
+ *	Initialize the rest of the Discovery Innovation dependencies, making it
  *	ready to handle interrupts from devices.
  */
 void
-mv78xx0_intr_bootstrap(void)
+mv78xx0_bootstrap(vaddr_t iobase)
 {
-	extern void (*mvsoc_intr_init)(void);
 
 	/* disable all interrupts */
 	write_mlmbreg(MV78XX0_ICI_IRQIMER, 0);
@@ -113,8 +114,12 @@ mv78xx0_intr_bootstrap(void)
 
 	mvsoc_intr_init = mv78xx0_intr_init;
 
+#if NMVSOCGPP > 0
 	gpp_npins = 32;
 	gpp_irqbase = 64;	/* Main Low(32) + High(32) */
+#endif
+
+	mv78xx0_getclks(iobase);
 }
 
 static void
@@ -197,8 +202,8 @@ mv78xx0_find_pending_irqs(void)
  * Clock functions
  */
 
-void
-mv78xx0_getclks(bus_addr_t iobase)
+static void
+mv78xx0_getclks(vaddr_t iobase)
 {
 	const static int sys2cpu_clk_ratio_m[] =	/* Mul constant */
 	{ 1, 3, 2, 5, 3, 7, 4, 9, 5, 1, 6 };

Index: src/sys/arch/arm/marvell/mvsoc.c
diff -u src/sys/arch/arm/marvell/mvsoc.c:1.24 src/sys/arch/arm/marvell/mvsoc.c:1.25
--- src/sys/arch/arm/marvell/mvsoc.c:1.24	Fri Nov  6 12:54:52 2015
+++ src/sys/arch/arm/marvell/mvsoc.c	Sat Jan  7 16:19:28 2017
@@ -1,6 +1,6 @@
-/*	$NetBSD: mvsoc.c,v 1.24 2015/11/06 12:54:52 kiyohara Exp $	*/
+/*	$NetBSD: mvsoc.c,v 1.25 2017/01/07 16:19:28 kiyohara Exp $	*/
 /*
- * Copyright (c) 2007, 2008, 2013, 2014 KIYOHARA Takashi
+ * Copyright (c) 2007, 2008, 2013, 2014, 2016 KIYOHARA Takashi
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mvsoc.c,v 1.24 2015/11/06 12:54:52 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mvsoc.c,v 1.25 2017/01/07 16:19:28 kiyohara Exp $");
 
 #include "opt_cputypes.h"
 #include "opt_mvsoc.h"
@@ -52,6 +52,7

CVS commit: src/sys/arch/arm/marvell

2017-01-07 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Jan  7 15:47:33 UTC 2017

Modified Files:
src/sys/arch/arm/marvell: armadaxpreg.h

Log Message:
Add register macros.
And reorder registers.
Also remove white-spaces.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/marvell/armadaxpreg.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/arm/marvell/armadaxpreg.h
diff -u src/sys/arch/arm/marvell/armadaxpreg.h:1.6 src/sys/arch/arm/marvell/armadaxpreg.h:1.7
--- src/sys/arch/arm/marvell/armadaxpreg.h:1.6	Fri Nov  6 12:54:52 2015
+++ src/sys/arch/arm/marvell/armadaxpreg.h	Sat Jan  7 15:47:33 2017
@@ -204,6 +204,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI
 #define ARMADAXP_IRQ_PEX11		63	/* PCIe Port1.1 INTA/B/C/D */
 #define ARMADAXP_IRQ_PEX12		64	/* PCIe Port1.2 INTA/B/C/D */
 #define ARMADAXP_IRQ_PEX13		65	/* PCIe Port1.3 INTA/B/C/D */
+#define ARMADAXP_IRQ_GBE0_SUM		66
 #define ARMADAXP_IRQ_XOR1CH2		94	/* XOR1 Ch2 */
 #define ARMADAXP_IRQ_XOR1CH3		95	/* XOR1 Ch3 */
 #define ARMADAXP_IRQ_PEX2		99	/* PCIe Port2 INTA/B/C/D */
@@ -279,18 +280,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI
 #define ARMADAXP_GPIO2_BASE	(MVSOC_DEVBUS_BASE + 0x8140)
 
 /*
- * Thermal Sensor and Thermal Managemer
- */
-#define ARMADAXP_TS_BASE	(MVSOC_DEVBUS_BASE + 0x82b0)
-#define ARMADAXP_TM_BASE	(MVSOC_DEVBUS_BASE + 0x84c0)
-#define ARMADA370_TM_BASE	(MVSOC_DEVBUS_BASE + 0x8300)
-
-/*
- * Power Management Unit Registers
- *//* NS16550 compatible */
-#define ARMADAXP_PMU_BASE	(MVSOC_DEVBUS_BASE + 0xc000)
-
-/*
  * Miscellanseous Register
  */
 #define	ARMADAXP_MISC_BASE	(MVSOC_DEVBUS_BASE + 0x8200)
@@ -303,7 +292,18 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI
 #define	ARMADAXP_MISC_SSRR		0x64	/* System Soft Reset Register */
 #define	ARMADAXP_MISC_SSRR_GLOBALSOFTRST	(1 << 0)
 
+/*
+ * Thermal Sensor and Thermal Managemer
+ */
+#define ARMADAXP_TS_BASE	(MVSOC_DEVBUS_BASE + 0x82b0)
+#define ARMADAXP_TM_BASE	(MVSOC_DEVBUS_BASE + 0x84c0)
+#define ARMADA370_TM_BASE	(MVSOC_DEVBUS_BASE + 0x8300)
+
 /* Multiprocessor Interrupt Controller Registers */
+#define ARMADAXP_MLMB_CFUCONFIG		  0x228
+#define ARMADAXP_MLMB_CFUCONFIG_POUTOSL2	(1 << 18)
+#define ARMADAXP_MLMB_CFUCONFIG_POCTOSL2	(1 << 18)
+
 #define	ARMADAXP_MLMB_MPIC_BASE			0x20a00
 #define	ARMADAXP_MLMB_MPIC_CPU_BASE		0x21800
 #define	ARMADAXP_MLMB_MPIC_CTRL			0x0
@@ -416,7 +416,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI
 #define ARMADAXP_USB1_BASE	(ARMADAXP_USB_BASE + 0x1000)
 #define ARMADAXP_USB2_BASE	(ARMADAXP_USB_BASE + 0x2000)
 
-/* 
+/*
  * XOR Engine Registers
  */
 #define ARMADAXP_XORE0_BASE	(UNITID2PHYS(XORE0))	/* 0x6 */
@@ -435,7 +435,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI
  */
 #define ARMADAXP_PTP_BASE	(UNITID2PHYS(GBE0))	/* 0x7c000 */
 
-/* 
+/*
  * Cryptographic Engine and Security Accelerator Registers
  */
 #define ARMADAXP_CESA0_BASE	(UNITID2PHYS(CRYPT) + 0xd000)	/* 0x9d000 */



CVS commit: src/sys/arch/arm/arm

2017-01-07 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Jan  7 15:22:11 UTC 2017

Modified Files:
src/sys/arch/arm/arm: cpufunc_asm_pj4b.S

Log Message:
Add a white-space into comment and `*/'.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/arm/cpufunc_asm_pj4b.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/arm/arm/cpufunc_asm_pj4b.S
diff -u src/sys/arch/arm/arm/cpufunc_asm_pj4b.S:1.11 src/sys/arch/arm/arm/cpufunc_asm_pj4b.S:1.12
--- src/sys/arch/arm/arm/cpufunc_asm_pj4b.S:1.11	Wed May 20 02:59:57 2015
+++ src/sys/arch/arm/arm/cpufunc_asm_pj4b.S	Sat Jan  7 15:22:11 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufunc_asm_pj4b.S,v 1.11 2015/05/20 02:59:57 hsuenaga Exp $ */
+/*	$NetBSD: cpufunc_asm_pj4b.S,v 1.12 2017/01/07 15:22:11 kiyohara Exp $ */
 
 /***
 Copyright (C) Marvell International Ltd. and its affiliates
@@ -43,7 +43,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI
 
 #define MV_FMC0_SMP		(1 << 1) /* SMP/nAMP enable */
 #define MV_FMC0_PARITY		(1 << 2) /* Enable L1 Cache Parity */
-#define MV_FMC0_LFDIS		(1 << 7) /* Disable DC Speculative linefill*/
+#define MV_FMC0_LFDIS		(1 << 7) /* Disable DC Speculative linefill */
 #define MV_FMC0_FW		(1 << 8) /* Cache & TLB maintenance broadcast */
 
 #define MPIDR_CPUID_MASK	(0x3 << 0) /* CPUID */



CVS commit: src/sys/arch/arm/marvell

2017-01-07 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Jan  7 15:14:20 UTC 2017

Modified Files:
src/sys/arch/arm/marvell: mvsoctmr.c

Log Message:
Change to a tab from white-spaces.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/marvell/mvsoctmr.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/arm/marvell/mvsoctmr.c
diff -u src/sys/arch/arm/marvell/mvsoctmr.c:1.13 src/sys/arch/arm/marvell/mvsoctmr.c:1.14
--- src/sys/arch/arm/marvell/mvsoctmr.c:1.13	Sat Mar 15 10:44:10 2014
+++ src/sys/arch/arm/marvell/mvsoctmr.c	Sat Jan  7 15:14:20 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: mvsoctmr.c,v 1.13 2014/03/15 10:44:10 kiyohara Exp $	*/
+/*	$NetBSD: mvsoctmr.c,v 1.14 2017/01/07 15:14:20 kiyohara Exp $	*/
 /*
  * Copyright (c) 2007, 2008, 2010 KIYOHARA Takashi
  * All rights reserved.
@@ -25,7 +25,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mvsoctmr.c,v 1.13 2014/03/15 10:44:10 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mvsoctmr.c,v 1.14 2017/01/07 15:14:20 kiyohara Exp $");
 
 #include "opt_ddb.h"
 #include "opt_mvsoc.h"
@@ -134,7 +134,7 @@ mvsoctmr_match(device_t parent, struct c
 static void
 mvsoctmr_attach(device_t parent, device_t self, void *aux)
 {
-struct mvsoctmr_softc *sc = device_private(self);
+	struct mvsoctmr_softc *sc = device_private(self);
 	struct marvell_attach_args *mva = aux;
 	uint32_t rstoutn;
 



CVS commit: src/sys/dev/sdmmc

2017-01-07 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Jan  7 15:05:08 UTC 2017

Modified Files:
src/sys/dev/sdmmc: sdhc.c sdhcvar.h

Log Message:
Add flags SDHC_FLAG_NO_AUTO_STOP and SDHC_FLAG_NO_BUSY_INTR.


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/sys/dev/sdmmc/sdhc.c
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/sdmmc/sdhcvar.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/dev/sdmmc/sdhc.c
diff -u src/sys/dev/sdmmc/sdhc.c:1.96 src/sys/dev/sdmmc/sdhc.c:1.97
--- src/sys/dev/sdmmc/sdhc.c:1.96	Sat Jan  7 15:00:38 2017
+++ src/sys/dev/sdmmc/sdhc.c	Sat Jan  7 15:05:08 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdhc.c,v 1.96 2017/01/07 15:00:38 kiyohara Exp $	*/
+/*	$NetBSD: sdhc.c,v 1.97 2017/01/07 15:05:08 kiyohara Exp $	*/
 /*	$OpenBSD: sdhc.c,v 1.25 2009/01/13 19:44:20 grange Exp $	*/
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.96 2017/01/07 15:00:38 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.97 2017/01/07 15:05:08 kiyohara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -595,7 +595,9 @@ adma_done:
 		saa.saa_clkmin = hp->clkbase / 0x3ff;
 	else
 		saa.saa_clkmin = hp->clkbase / 256;
-	saa.saa_caps = SMC_CAPS_4BIT_MODE|SMC_CAPS_AUTO_STOP;
+	if (!ISSET(sc->sc_flags, SDHC_FLAG_NO_AUTO_STOP))
+		saa.saa_caps |= SMC_CAPS_AUTO_STOP;
+	saa.saa_caps |= SMC_CAPS_4BIT_MODE;
 	if (ISSET(sc->sc_flags, SDHC_FLAG_8BIT_MODE))
 		saa.saa_caps |= SMC_CAPS_8BIT_MODE;
 	if (ISSET(caps, SDHC_HIGH_SPEED_SUPP))
@@ -1572,7 +1574,8 @@ sdhc_exec_command(sdmmc_chipset_handle_t
 	if (cmd->c_error == 0 && cmd->c_data != NULL)
 		sdhc_transfer_data(hp, cmd);
 	else if (ISSET(cmd->c_flags, SCF_RSP_BSY)) {
-		if (!sdhc_wait_intr(hp, SDHC_TRANSFER_COMPLETE, hz * 10, false)) {
+		if (!ISSET(hp->sc->sc_flags, SDHC_FLAG_NO_BUSY_INTR) &&
+		!sdhc_wait_intr(hp, SDHC_TRANSFER_COMPLETE, hz * 10, false)) {
 			DPRINTF(1,("%s: sdhc_exec_command: RSP_BSY\n",
 			HDEVNAME(hp)));
 			cmd->c_error = ETIMEDOUT;
@@ -1588,6 +1591,10 @@ out:
 	}
 	SET(cmd->c_flags, SCF_ITSDONE);
 
+	if (ISSET(hp->sc->sc_flags, SDHC_FLAG_NO_AUTO_STOP) &&
+	cmd->c_opcode == MMC_STOP_TRANSMISSION)
+		(void)sdhc_soft_reset(hp, SDHC_RESET_CMD|SDHC_RESET_DAT);
+
 	mutex_exit(&hp->intr_lock);
 
 	DPRINTF(1,("%s: cmd %d %s (flags=%08x error=%d)\n", HDEVNAME(hp),
@@ -1642,7 +1649,8 @@ sdhc_start_command(struct sdhc_host *hp,
 	if (blkcount > 1) {
 		mode |= SDHC_MULTI_BLOCK_MODE;
 		/* XXX only for memory commands? */
-		mode |= SDHC_AUTO_CMD12_ENABLE;
+		if (!ISSET(sc->sc_flags, SDHC_FLAG_NO_AUTO_STOP))
+			mode |= SDHC_AUTO_CMD12_ENABLE;
 	}
 	if (cmd->c_dmamap != NULL && cmd->c_datalen > 0 &&
 	ISSET(hp->flags,  SHF_MODE_DMAEN)) {

Index: src/sys/dev/sdmmc/sdhcvar.h
diff -u src/sys/dev/sdmmc/sdhcvar.h:1.26 src/sys/dev/sdmmc/sdhcvar.h:1.27
--- src/sys/dev/sdmmc/sdhcvar.h:1.26	Thu Dec 31 11:53:19 2015
+++ src/sys/dev/sdmmc/sdhcvar.h	Sat Jan  7 15:05:08 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdhcvar.h,v 1.26 2015/12/31 11:53:19 ryo Exp $	*/
+/*	$NetBSD: sdhcvar.h,v 1.27 2017/01/07 15:05:08 kiyohara Exp $	*/
 /*	$OpenBSD: sdhcvar.h,v 1.3 2007/09/06 08:01:01 jsg Exp $	*/
 
 /*
@@ -59,6 +59,8 @@ struct sdhc_softc {
 #define	SDHC_FLAG_POLL_CARD_DET	0x0020 /* polling card detect */
 #define	SDHC_FLAG_SLOW_SDR50  	0x0040 /* reduce SDR50 speed */
 #define	SDHC_FLAG_USDHC		0x0080 /* Freescale uSDHC */
+#define	SDHC_FLAG_NO_AUTO_STOP	0x0100 /* No auto CMD12 */
+#define	SDHC_FLAG_NO_BUSY_INTR	0x0200 /* No intr when RESP_BUSY */
 
 	uint32_t		sc_clkbase;
 	int			sc_clkmsk;	/* Mask for SDCLK */



CVS commit: src/sys/dev/sdmmc

2017-01-07 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Jan  7 15:00:38 UTC 2017

Modified Files:
src/sys/dev/sdmmc: sdhc.c

Log Message:
Don't access SDHC_HOST_CTL_VERSION, if iosize less than this.


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/sys/dev/sdmmc/sdhc.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/dev/sdmmc/sdhc.c
diff -u src/sys/dev/sdmmc/sdhc.c:1.95 src/sys/dev/sdmmc/sdhc.c:1.96
--- src/sys/dev/sdmmc/sdhc.c:1.95	Wed Aug 10 04:24:17 2016
+++ src/sys/dev/sdmmc/sdhc.c	Sat Jan  7 15:00:38 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdhc.c,v 1.95 2016/08/10 04:24:17 nonaka Exp $	*/
+/*	$NetBSD: sdhc.c,v 1.96 2017/01/07 15:00:38 kiyohara Exp $	*/
 /*	$OpenBSD: sdhc.c,v 1.25 2009/01/13 19:44:20 grange Exp $	*/
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.95 2016/08/10 04:24:17 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.96 2017/01/07 15:00:38 kiyohara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -290,38 +290,42 @@ sdhc_host_found(struct sdhc_softc *sc, b
 	callout_init(&hp->tuning_timer, CALLOUT_MPSAFE);
 	callout_setfunc(&hp->tuning_timer, sdhc_tuning_timer, hp);
 
-	if (ISSET(hp->sc->sc_flags, SDHC_FLAG_USDHC)) {
-		sdhcver = SDHC_SPEC_VERS_300 << SDHC_SPEC_VERS_SHIFT;
-	} else if (ISSET(hp->sc->sc_flags, SDHC_FLAG_ENHANCED)) {
-		sdhcver = HREAD4(hp, SDHC_ESDHC_HOST_CTL_VERSION);
+	if (iosize <= SDHC_HOST_CTL_VERSION) {
+		aprint_normal_dev(sc->sc_dev, "SDHC NO-VERS");
+		hp->specver = -1;
 	} else {
-		sdhcver = HREAD2(hp, SDHC_HOST_CTL_VERSION);
-	}
-	aprint_normal_dev(sc->sc_dev, "SDHC ");
-	hp->specver = SDHC_SPEC_VERSION(sdhcver);
-	switch (SDHC_SPEC_VERSION(sdhcver)) {
-	case SDHC_SPEC_VERS_100:
-		aprint_normal("1.0");
-		break;
+		if (ISSET(hp->sc->sc_flags, SDHC_FLAG_USDHC)) {
+			sdhcver = SDHC_SPEC_VERS_300 << SDHC_SPEC_VERS_SHIFT;
+		} else if (ISSET(hp->sc->sc_flags, SDHC_FLAG_ENHANCED)) {
+			sdhcver = HREAD4(hp, SDHC_ESDHC_HOST_CTL_VERSION);
+		} else
+			sdhcver = HREAD2(hp, SDHC_HOST_CTL_VERSION);
+		aprint_normal_dev(sc->sc_dev, "SDHC ");
+		hp->specver = SDHC_SPEC_VERSION(sdhcver);
+		switch (SDHC_SPEC_VERSION(sdhcver)) {
+		case SDHC_SPEC_VERS_100:
+			aprint_normal("1.0");
+			break;
 
-	case SDHC_SPEC_VERS_200:
-		aprint_normal("2.0");
-		break;
+		case SDHC_SPEC_VERS_200:
+			aprint_normal("2.0");
+			break;
 
-	case SDHC_SPEC_VERS_300:
-		aprint_normal("3.0");
-		break;
+		case SDHC_SPEC_VERS_300:
+			aprint_normal("3.0");
+			break;
 
-	case SDHC_SPEC_VERS_400:
-		aprint_normal("4.0");
-		break;
+		case SDHC_SPEC_VERS_400:
+			aprint_normal("4.0");
+			break;
 
-	default:
-		aprint_normal("unknown version(0x%x)",
-		SDHC_SPEC_VERSION(sdhcver));
-		break;
+		default:
+			aprint_normal("unknown version(0x%x)",
+			SDHC_SPEC_VERSION(sdhcver));
+			break;
+		}
+		aprint_normal(", rev %u", SDHC_VENDOR_VERSION(sdhcver));
 	}
-	aprint_normal(", rev %u", SDHC_VENDOR_VERSION(sdhcver));
 
 	/*
 	 * Reset the host controller and enable interrupts.



CVS commit: src/sys/dev/sdmmc

2017-01-07 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Jan  7 14:49:53 UTC 2017

Modified Files:
src/sys/dev/sdmmc: ld_sdmmc.c

Log Message:
Support retry when error.  like wd(4).


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/sdmmc/ld_sdmmc.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/dev/sdmmc/ld_sdmmc.c
diff -u src/sys/dev/sdmmc/ld_sdmmc.c:1.23 src/sys/dev/sdmmc/ld_sdmmc.c:1.24
--- src/sys/dev/sdmmc/ld_sdmmc.c:1.23	Tue Sep 27 03:33:33 2016
+++ src/sys/dev/sdmmc/ld_sdmmc.c	Sat Jan  7 14:49:53 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ld_sdmmc.c,v 1.23 2016/09/27 03:33:33 pgoyette Exp $	*/
+/*	$NetBSD: ld_sdmmc.c,v 1.24 2017/01/07 14:49:53 kiyohara Exp $	*/
 
 /*
  * Copyright (c) 2008 KIYOHARA Takashi
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ld_sdmmc.c,v 1.23 2016/09/27 03:33:33 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld_sdmmc.c,v 1.24 2017/01/07 14:49:53 kiyohara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -59,6 +59,9 @@ __KERNEL_RCSID(0, "$NetBSD: ld_sdmmc.c,v
 #define DPRINTF(s)	/**/
 #endif
 
+#define	LD_SDMMC_IORETRIES	5	/* number of retries before giving up */
+#define	RECOVERYTIME		hz/2	/* time to wait before retrying a cmd */
+
 struct ld_sdmmc_softc;
 
 struct ld_sdmmc_task {
@@ -66,6 +69,8 @@ struct ld_sdmmc_task {
 
 	struct ld_sdmmc_softc *task_sc;
 	struct buf *task_bp;
+	int task_retries; /* number of xfer retry */
+	struct callout task_restart_ch;
 };
 
 struct ld_sdmmc_softc {
@@ -75,7 +80,7 @@ struct ld_sdmmc_softc {
 	struct sdmmc_function *sc_sf;
 #define LD_SDMMC_MAXQUEUECNT 4
 	struct ld_sdmmc_task sc_task[LD_SDMMC_MAXQUEUECNT];
-	int sc_nexttask;
+	TAILQ_HEAD(, sdmmc_task) sc_freeq;
 };
 
 static int ld_sdmmc_match(device_t, cfdata_t, void *);
@@ -84,6 +89,7 @@ static int ld_sdmmc_detach(device_t, int
 
 static int ld_sdmmc_dump(struct ld_softc *, void *, int, int);
 static int ld_sdmmc_start(struct ld_softc *, struct buf *);
+static void ld_sdmmc_restart(void *);
 
 static void ld_sdmmc_doattach(void *);
 static void ld_sdmmc_dobio(void *);
@@ -110,7 +116,9 @@ ld_sdmmc_attach(device_t parent, device_
 	struct ld_sdmmc_softc *sc = device_private(self);
 	struct sdmmc_attach_args *sa = aux;
 	struct ld_softc *ld = &sc->sc_ld;
+	struct ld_sdmmc_task *task;
 	struct lwp *lwp;
+	int i;
 
 	ld->sc_dv = self;
 
@@ -119,7 +127,13 @@ ld_sdmmc_attach(device_t parent, device_
 	sa->sf->cid.rev, sa->sf->cid.psn, sa->sf->cid.mdt);
 	aprint_naive("\n");
 
-	sc->sc_nexttask = 0;
+	TAILQ_INIT(&sc->sc_freeq);
+	for (i = 0; i < __arraycount(sc->sc_task); i++) {
+		task = &sc->sc_task[i];
+		task->task_sc = sc;
+		callout_init(&task->task_restart_ch, 0);
+		TAILQ_INSERT_TAIL(&sc->sc_freeq, &task->task, next);
+	}
 
 	sc->sc_hwunit = 0;	/* always 0? */
 	sc->sc_sf = sa->sf;
@@ -168,12 +182,15 @@ ld_sdmmc_detach(device_t dev, int flags)
 {
 	struct ld_sdmmc_softc *sc = device_private(dev);
 	struct ld_softc *ld = &sc->sc_ld;
-	int rv;
+	int rv, i;
 
 	if ((rv = ldbegindetach(ld, flags)) != 0)
 		return rv;
 	ldenddetach(ld);
 
+	for (i = 0; i < __arraycount(sc->sc_task); i++)
+		callout_destroy(&sc->sc_task[i].task_restart_ch);
+
 	return 0;
 }
 
@@ -181,12 +198,12 @@ static int
 ld_sdmmc_start(struct ld_softc *ld, struct buf *bp)
 {
 	struct ld_sdmmc_softc *sc = device_private(ld->sc_dv);
-	struct ld_sdmmc_task *task = &sc->sc_task[sc->sc_nexttask];
+	struct ld_sdmmc_task *task = (void *)TAILQ_FIRST(&sc->sc_freeq);
 
-	sc->sc_nexttask = (sc->sc_nexttask + 1) % LD_SDMMC_MAXQUEUECNT;
+	TAILQ_REMOVE(&sc->sc_freeq, &task->task, next);
 
-	task->task_sc = sc;
 	task->task_bp = bp;
+	task->task_retries = 0;
 	sdmmc_init_task(&task->task, ld_sdmmc_dobio, task);
 
 	sdmmc_add_task(sc->sc_sf->sc, &task->task);
@@ -195,6 +212,18 @@ ld_sdmmc_start(struct ld_softc *ld, stru
 }
 
 static void
+ld_sdmmc_restart(void *arg)
+{
+	struct ld_sdmmc_task *task = (struct ld_sdmmc_task *)arg;
+	struct ld_sdmmc_softc *sc = task->task_sc;
+	struct buf *bp = task->task_bp;
+
+	bp->b_resid = bp->b_bcount;
+
+	sdmmc_add_task(sc->sc_sf->sc, &task->task);
+}
+
+static void
 ld_sdmmc_dobio(void *arg)
 {
 	struct ld_sdmmc_task *task = (struct ld_sdmmc_task *)arg;
@@ -228,14 +257,26 @@ ld_sdmmc_dobio(void *arg)
 		error = sdmmc_mem_write_block(sc->sc_sf, bp->b_rawblkno,
 		bp->b_data, bp->b_bcount);
 	if (error) {
-		DPRINTF(("%s: error %d\n", device_xname(sc->sc_ld.sc_dv),
-		error));
+		if (task->task_retries < LD_SDMMC_IORETRIES) {
+			struct dk_softc *dksc = &sc->sc_ld.sc_dksc;
+			struct cfdriver *cd = device_cfdriver(dksc->sc_dev);
+
+			diskerr(b

CVS commit: src/sys/dev/marvell

2017-01-07 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Jan  7 14:44:26 UTC 2017

Modified Files:
src/sys/dev/marvell: gtidmac.c

Log Message:
Support Marvell Dove.  Use irq array.  Dove's irqs not sequencial.
And remove debug printf().


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/marvell/gtidmac.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/dev/marvell/gtidmac.c
diff -u src/sys/dev/marvell/gtidmac.c:1.12 src/sys/dev/marvell/gtidmac.c:1.13
--- src/sys/dev/marvell/gtidmac.c:1.12	Sat Jan  7 14:36:51 2017
+++ src/sys/dev/marvell/gtidmac.c	Sat Jan  7 14:44:26 2017
@@ -1,6 +1,6 @@
-/*	$NetBSD: gtidmac.c,v 1.12 2017/01/07 14:36:51 kiyohara Exp $	*/
+/*	$NetBSD: gtidmac.c,v 1.13 2017/01/07 14:44:26 kiyohara Exp $	*/
 /*
- * Copyright (c) 2008, 2012 KIYOHARA Takashi
+ * Copyright (c) 2008, 2012, 2016 KIYOHARA Takashi
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gtidmac.c,v 1.12 2017/01/07 14:36:51 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gtidmac.c,v 1.13 2017/01/07 14:44:26 kiyohara Exp $");
 
 #include 
 #include 
@@ -276,24 +276,30 @@ static const struct dmover_algdesc mvxor
 	},
 };
 
+static int orion_88f5182_xore_irqs[] = { 30, 31 };
+static int kirkwood_xore_irqs[] = { 5, 6, 7, 8 };
+static int dove_xore_irqs[] = { 39, 40, 42, 43 };
+static int armadaxp_xore_irqs0[] = { 51, 52 };
+static int armadaxp_xore_irqs1[] = { 94, 95 };
+
 static struct {
 	int model;
 	int idmac_nchan;
 	int idmac_irq;
 	int xore_nchan;
-	int xore_irq;
+	int *xore_irqs;
 } channels[] = {
 	/*
 	 * Marvell System Controllers:
 	 * need irqs in attach_args.
 	 */
-	{ MARVELL_DISCOVERY,		8, -1, 0, -1 },
-	{ MARVELL_DISCOVERY_II,		8, -1, 0, -1 },
-	{ MARVELL_DISCOVERY_III,	8, -1, 0, -1 },
+	{ MARVELL_DISCOVERY,		8, -1, 0, NULL },
+	{ MARVELL_DISCOVERY_II,		8, -1, 0, NULL },
+	{ MARVELL_DISCOVERY_III,	8, -1, 0, NULL },
 #if 0
-	{ MARVELL_DISCOVERY_LT,		4, -1, 2, -1 },
-	{ MARVELL_DISCOVERY_V,		4, -1, 2, -1 },
-	{ MARVELL_DISCOVERY_VI,		4, -1, 2, -1 },		
+	{ MARVELL_DISCOVERY_LT,		4, -1, 2, NULL },
+	{ MARVELL_DISCOVERY_V,		4, -1, 2, NULL },
+	{ MARVELL_DISCOVERY_VI,		4, -1, 2, NULL },		
 #endif
 
 	/*
@@ -301,28 +307,29 @@ static struct {
 	 * No need irqs in attach_args.  We always connecting to interrupt-pin
 	 * statically.
 	 */
-	{ MARVELL_ORION_1_88F1181,	4, 24, 0, -1 },
-	{ MARVELL_ORION_2_88F1281,	4, 24, 0, -1 },
-	{ MARVELL_ORION_1_88F5082,	4, 24, 0, -1 },
-	{ MARVELL_ORION_1_88F5180N,	4, 24, 0, -1 },
-	{ MARVELL_ORION_1_88F5181,	4, 24, 0, -1 },
-	{ MARVELL_ORION_1_88F5182,	4, 24, 2, 30 },
-	{ MARVELL_ORION_2_88F5281,	4, 24, 0, -1 },
-	{ MARVELL_ORION_1_88W8660,	4, 24, 0, -1 },
-	{ MARVELL_KIRKWOOD_88F6180,	0, -1, 4, 5 },
-	{ MARVELL_KIRKWOOD_88F6192,	0, -1, 4, 5 },
-	{ MARVELL_KIRKWOOD_88F6281,	0, -1, 4, 5 },
-	{ MARVELL_KIRKWOOD_88F6282,	0, -1, 4, 5 },
-	{ MARVELL_ARMADAXP_MV78130,	4, 33, 2, 51 },
-	{ MARVELL_ARMADAXP_MV78130,	0, -1, 2, 94 },
-	{ MARVELL_ARMADAXP_MV78160,	4, 33, 2, 51 },
-	{ MARVELL_ARMADAXP_MV78160,	0, -1, 2, 94 },
-	{ MARVELL_ARMADAXP_MV78230,	4, 33, 2, 51 },
-	{ MARVELL_ARMADAXP_MV78230,	0, -1, 2, 94 },
-	{ MARVELL_ARMADAXP_MV78260,	4, 33, 2, 51 },
-	{ MARVELL_ARMADAXP_MV78260,	0, -1, 2, 94 },
-	{ MARVELL_ARMADAXP_MV78460,	4, 33, 2, 51 },
-	{ MARVELL_ARMADAXP_MV78460,	0, -1, 2, 94 },
+	{ MARVELL_ORION_1_88F1181,	4, 24, 0, NULL },
+	{ MARVELL_ORION_2_88F1281,	4, 24, 0, NULL },
+	{ MARVELL_ORION_1_88F5082,	4, 24, 0, NULL },
+	{ MARVELL_ORION_1_88F5180N,	4, 24, 0, NULL },
+	{ MARVELL_ORION_1_88F5181,	4, 24, 0, NULL },
+	{ MARVELL_ORION_1_88F5182,	4, 24, 2, orion_88f5182_xore_irqs },
+	{ MARVELL_ORION_2_88F5281,	4, 24, 0, NULL },
+	{ MARVELL_ORION_1_88W8660,	4, 24, 0, NULL },
+	{ MARVELL_KIRKWOOD_88F6180,	0, -1, 4, kirkwood_xore_irqs },
+	{ MARVELL_KIRKWOOD_88F6192,	0, -1, 4, kirkwood_xore_irqs },
+	{ MARVELL_KIRKWOOD_88F6281,	0, -1, 4, kirkwood_xore_irqs },
+	{ MARVELL_KIRKWOOD_88F6282,	0, -1, 4, kirkwood_xore_irqs },
+	{ MARVELL_DOVE_88AP510,		0, -1, 4, dove_xore_irqs },
+	{ MARVELL_ARMADAXP_MV78130,	4, 33, 2, armadaxp_xore_irqs0 },
+	{ MARVELL_ARMADAXP_MV78130,	0, -1, 2, armadaxp_xore_irqs1 },
+	{ MARVELL_ARMADAXP_MV78160,	4, 33, 2, armadaxp_xore_irqs0 },
+	{ MARVELL_ARMADAXP_MV78160,	0, -1, 2, armadaxp_xore_irqs1 },
+	{ MARVELL_ARMADAXP_MV78230,	4, 33, 2, armadaxp_xore_irqs0 },
+	{ MARVELL_ARMADAXP_MV78230,	0, -1, 2, armadaxp_xore_irqs1 },
+	{ MARVELL_ARMADAXP_MV78260,	4, 33, 2, armadaxp_xore_irqs0 },
+	{ MARVELL_ARMADAXP_MV78260,	0, -1, 2, armadaxp_xore_irqs1 },
+	{ MARVELL_ARMADAXP_MV78460,	4, 33, 2, armadaxp_xore_irqs0 },
+	{ MARVELL_ARMADAXP_MV78460,	0, -1, 2, armadaxp_xore_irqs1 },
 };
 
 struct gtidmac_winacctbl *gtidmac_winacctbl;
@@ -364,7 +371,7 @@ gtidmac_attach(device_t parent, device_t
 

CVS commit: src/sys/dev/marvell

2017-01-07 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Jan  7 14:36:51 UTC 2017

Modified Files:
src/sys/dev/marvell: gtidmac.c gtidmacvar.h

Log Message:
Remove unused function.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/marvell/gtidmac.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/marvell/gtidmacvar.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/dev/marvell/gtidmac.c
diff -u src/sys/dev/marvell/gtidmac.c:1.11 src/sys/dev/marvell/gtidmac.c:1.12
--- src/sys/dev/marvell/gtidmac.c:1.11	Sat Mar 15 13:33:48 2014
+++ src/sys/dev/marvell/gtidmac.c	Sat Jan  7 14:36:51 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: gtidmac.c,v 1.11 2014/03/15 13:33:48 kiyohara Exp $	*/
+/*	$NetBSD: gtidmac.c,v 1.12 2017/01/07 14:36:51 kiyohara Exp $	*/
 /*
  * Copyright (c) 2008, 2012 KIYOHARA Takashi
  * All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gtidmac.c,v 1.11 2014/03/15 13:33:48 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gtidmac.c,v 1.12 2017/01/07 14:36:51 kiyohara Exp $");
 
 #include 
 #include 
@@ -926,13 +926,6 @@ gtidmac_dmmap_unload(struct gtidmac_soft
 }
 
 
-void *
-gtidmac_tag_get(void)
-{
-
-	return gtidmac_softc;
-}
-
 /*
  * IDMAC functions
  */

Index: src/sys/dev/marvell/gtidmacvar.h
diff -u src/sys/dev/marvell/gtidmacvar.h:1.2 src/sys/dev/marvell/gtidmacvar.h:1.3
--- src/sys/dev/marvell/gtidmacvar.h:1.2	Sat Mar 15 13:33:48 2014
+++ src/sys/dev/marvell/gtidmacvar.h	Sat Jan  7 14:36:51 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: gtidmacvar.h,v 1.2 2014/03/15 13:33:48 kiyohara Exp $	*/
+/*	$NetBSD: gtidmacvar.h,v 1.3 2017/01/07 14:36:51 kiyohara Exp $	*/
 /*
  * Copyright (c) 2008, 2009 KIYOHARA Takashi
  * All rights reserved.
@@ -48,8 +48,6 @@ struct gtidmac_winacctbl {
 extern struct gtidmac_winacctbl *gtidmac_winacctbl;
 extern struct gtidmac_winacctbl *mvxore_winacctbl;
 
-void *gtidmac_tag_get(void);
-
 int gtidmac_chan_alloc(void *, bus_dmamap_t **, bus_dmamap_t **, void *);
 void gtidmac_chan_free(void *, int);
 int gtidmac_setup(void *, int, int, bus_dmamap_t *, bus_dmamap_t *, bus_size_t);



CVS commit: src/sys/dev/marvell

2017-01-07 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Jan  7 14:32:33 UTC 2017

Modified Files:
src/sys/dev/marvell: gtidmacreg.h

Log Message:
Fix macro MVXORE_CHAN2BASE().  The XORE has 2 channels per port.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/marvell/gtidmacreg.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/dev/marvell/gtidmacreg.h
diff -u src/sys/dev/marvell/gtidmacreg.h:1.3 src/sys/dev/marvell/gtidmacreg.h:1.4
--- src/sys/dev/marvell/gtidmacreg.h:1.3	Mon Jul 23 06:09:47 2012
+++ src/sys/dev/marvell/gtidmacreg.h	Sat Jan  7 14:32:32 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: gtidmacreg.h,v 1.3 2012/07/23 06:09:47 kiyohara Exp $	*/
+/*	$NetBSD: gtidmacreg.h,v 1.4 2017/01/07 14:32:32 kiyohara Exp $	*/
 /*
  * Copyright (c) 2008, 2009 KIYOHARA Takashi
  * All rights reserved.
@@ -51,7 +51,7 @@
 #define MVXORE_PORT2BASE(sc, p)	\
 (((sc)->sc_gtidmac_nchan == 0 && (p) == 0) ? -0x100 : 0x000)
 #define MVXORE_CHAN2BASE(sc, c)	\
-(MVXORE_PORT2BASE(sc, (c) & 0x4) + (((c) & 0x3) << 2))
+(MVXORE_PORT2BASE(sc, (c) & 0xe) + (((c) & 0x1) << 2))
 
 
 /* IDMA Descriptor Register Map */



CVS commit: src/sys/dev/marvell

2017-01-07 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Jan  7 14:26:37 UTC 2017

Modified Files:
src/sys/dev/marvell: marvellvar.h

Log Message:
Add tags for AXI_CS[01].


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/marvell/marvellvar.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/dev/marvell/marvellvar.h
diff -u src/sys/dev/marvell/marvellvar.h:1.5 src/sys/dev/marvell/marvellvar.h:1.6
--- src/sys/dev/marvell/marvellvar.h:1.5	Sat Mar 15 11:47:43 2014
+++ src/sys/dev/marvell/marvellvar.h	Sat Jan  7 14:26:37 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: marvellvar.h,v 1.5 2014/03/15 11:47:43 kiyohara Exp $	*/
+/*	$NetBSD: marvellvar.h,v 1.6 2017/01/07 14:26:37 kiyohara Exp $	*/
 /*
  * Copyright (c) 2009 KIYOHARA Takashi
  * All rights reserved.
@@ -34,6 +34,9 @@ enum marvell_tags {
 	MARVELL_TAG_SDRAM_CS2,
 	MARVELL_TAG_SDRAM_CS3,
 
+	MARVELL_TAG_AXI_CS0,	/* Advanced eXtensible Interface */
+	MARVELL_TAG_AXI_CS1,	/* Advanced eXtensible Interface */
+
 	MARVELL_TAG_DDR3_CS0,
 	MARVELL_TAG_DDR3_CS1,
 	MARVELL_TAG_DDR3_CS2,



CVS commit: src/sys/dev/marvell

2017-01-07 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Jan  7 14:24:27 UTC 2017

Modified Files:
src/sys/dev/marvell: if_mvgbe.c mvsata_mv.c

Log Message:
Support Marvell Dove.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/dev/marvell/if_mvgbe.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/marvell/mvsata_mv.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/dev/marvell/if_mvgbe.c
diff -u src/sys/dev/marvell/if_mvgbe.c:1.47 src/sys/dev/marvell/if_mvgbe.c:1.48
--- src/sys/dev/marvell/if_mvgbe.c:1.47	Thu Dec 15 09:28:05 2016
+++ src/sys/dev/marvell/if_mvgbe.c	Sat Jan  7 14:24:27 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mvgbe.c,v 1.47 2016/12/15 09:28:05 ozaki-r Exp $	*/
+/*	$NetBSD: if_mvgbe.c,v 1.48 2017/01/07 14:24:27 kiyohara Exp $	*/
 /*
  * Copyright (c) 2007, 2008, 2013 KIYOHARA Takashi
  * All rights reserved.
@@ -25,7 +25,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.47 2016/12/15 09:28:05 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.48 2017/01/07 14:24:27 kiyohara Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -367,6 +367,8 @@ struct mvgbe_port {
 	{ MARVELL_MV78XX0_MV78200,	2, 1, { 48 }, FLAGS_FIX_TQTB | FLAGS_IPG2 },
 	{ MARVELL_MV78XX0_MV78200,	3, 1, { 52 }, FLAGS_FIX_TQTB | FLAGS_IPG2 },
 
+	{ MARVELL_DOVE_88AP510,		0, 1, { 29 }, FLAGS_FIX_TQTB | FLAGS_IPG2 },
+
 	{ MARVELL_ARMADAXP_MV78130,	0, 1, { 66 }, FLAGS_HAS_PV },
 	{ MARVELL_ARMADAXP_MV78130,	1, 1, { 70 }, FLAGS_HAS_PV },
 	{ MARVELL_ARMADAXP_MV78130,	2, 1, { 74 }, FLAGS_HAS_PV },

Index: src/sys/dev/marvell/mvsata_mv.c
diff -u src/sys/dev/marvell/mvsata_mv.c:1.7 src/sys/dev/marvell/mvsata_mv.c:1.8
--- src/sys/dev/marvell/mvsata_mv.c:1.7	Sat Mar 15 13:33:48 2014
+++ src/sys/dev/marvell/mvsata_mv.c	Sat Jan  7 14:24:27 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: mvsata_mv.c,v 1.7 2014/03/15 13:33:48 kiyohara Exp $	*/
+/*	$NetBSD: mvsata_mv.c,v 1.8 2017/01/07 14:24:27 kiyohara Exp $	*/
 /*
  * Copyright (c) 2008 KIYOHARA Takashi
  * All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mvsata_mv.c,v 1.7 2014/03/15 13:33:48 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mvsata_mv.c,v 1.8 2017/01/07 14:24:27 kiyohara Exp $");
 
 #include 
 #include 
@@ -99,6 +99,9 @@ struct mvsata_product mvsata_products[] 
 	{ PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_MV78100, 1, 2, gen2e, 0 },
 	{ PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_MV78200, 1, 2, gen2e, 0 },
 
+	/* Dove */
+	{ PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_88AP510, 1, 1, gen2e, 0 },
+
 	/* Armada XP */
 	{ PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_MV78130, 1, 2, gen2e, 0 },
 	{ PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_MV78160, 1, 2, gen2e, 0 },



CVS commit: src/sys/dev/marvell

2017-01-07 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Jan  7 14:19:45 UTC 2017

Modified Files:
src/sys/dev/marvell: mvspireg.h

Log Message:
Change MVSPI_SIZE to 0x80 instead of 0x50.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/marvell/mvspireg.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/dev/marvell/mvspireg.h
diff -u src/sys/dev/marvell/mvspireg.h:1.2 src/sys/dev/marvell/mvspireg.h:1.3
--- src/sys/dev/marvell/mvspireg.h:1.2	Mon May 13 15:47:18 2013
+++ src/sys/dev/marvell/mvspireg.h	Sat Jan  7 14:19:45 2017
@@ -38,7 +38,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI
 #ifndef _MVSPIREG_H_
 #define _MVSPIREG_H_
 
-#define		MVSPI_SIZE			0x50		/* Size of MVSPI */
+#define		MVSPI_SIZE			0x80		/* Size of MVSPI */
 
 /* Definition of registers */
 #define		MVSPI_CTRL_REG			0x00		/* MVSPI Control Register */



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

2016-10-19 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Wed Oct 19 14:07:22 UTC 2016

Modified Files:
src/sys/arch/evbarm/gumstix: gumstix_machdep.c

Log Message:
Remove white spaces.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/evbarm/gumstix/gumstix_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/gumstix/gumstix_machdep.c
diff -u src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.55 src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.56
--- src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.55	Tue Oct 18 14:39:52 2016
+++ src/sys/arch/evbarm/gumstix/gumstix_machdep.c	Wed Oct 19 14:07:22 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstix_machdep.c,v 1.55 2016/10/18 14:39:52 kiyohara Exp $ */
+/*	$NetBSD: gumstix_machdep.c,v 1.56 2016/10/19 14:07:22 kiyohara Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007  WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -583,7 +583,7 @@ initarm(void *arg)
 #ifdef MULTIPROCESSOR
 	if (bus_space_map(iot, OMAP4_SCU_BASE, SCU_SIZE, 0, &ioh) != 0)
 		panic("OMAP4_SCU_BASE map failed\n");
-arm_cpu_max =
+	arm_cpu_max =
 	1 + (bus_space_read_4(iot, ioh, SCU_CFG) & SCU_CFG_CPUMAX);
 #endif
 #endif
@@ -1067,7 +1067,7 @@ gumstix_device_register(device_t dev, vo
 			 * The iot mainbus supplies is completely wrong since
 			 * it scales addresses by 2.  The simpliest remedy is
 			 * to replace with our bus space used for the armcore
-			 * regisers (which armperiph uses). 
+			 * regisers (which armperiph uses).
 			 */
 			struct mainbus_attach_args * const mb = aux;
 			mb->mb_iot = &omap_bs_tag;



CVS commit: src/sys/arch

2016-10-18 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Oct 18 15:10:35 UTC 2016

Modified Files:
src/sys/arch/arm/omap: am335x_prcm.c am335x_prcm.h
src/sys/arch/evbarm/beagle: beagle_machdep.c

Log Message:
Move set_mpu_volt() from */*_machdep.c to am335x_prcm.c.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/omap/am335x_prcm.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/omap/am335x_prcm.h
cvs rdiff -u -r1.65 -r1.66 src/sys/arch/evbarm/beagle/beagle_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/arm/omap/am335x_prcm.c
diff -u src/sys/arch/arm/omap/am335x_prcm.c:1.8 src/sys/arch/arm/omap/am335x_prcm.c:1.9
--- src/sys/arch/arm/omap/am335x_prcm.c:1.8	Tue Sep 30 11:34:07 2014
+++ src/sys/arch/arm/omap/am335x_prcm.c	Tue Oct 18 15:10:35 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: am335x_prcm.c,v 1.8 2014/09/30 11:34:07 jmcneill Exp $	*/
+/*	$NetBSD: am335x_prcm.c,v 1.9 2016/10/18 15:10:35 kiyohara Exp $	*/
 
 /*
  * TI OMAP Power, Reset, and Clock Management on the AM335x
@@ -34,10 +34,13 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: am335x_prcm.c,v 1.8 2014/09/30 11:34:07 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: am335x_prcm.c,v 1.9 2016/10/18 15:10:35 kiyohara Exp $");
+
+#include "tps65217pmic.h"
 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -46,6 +49,8 @@ __KERNEL_RCSID(0, "$NetBSD: am335x_prcm.
 #include 
 #include 
 
+#include 
+
 #define AM335X_CLKCTRL_MODULEMODE_MASK		__BITS(0, 1)
 #define   AM335X_CLKCTRL_MODULEMODE_DISABLED	0
 #define   AM335X_CLKCTRL_MODULEMODE_ENABLE	2
@@ -161,6 +166,25 @@ prcm_mpu_pll_config(u_int mpupll_m)
 	}
 }
 
+const char *mpu_supply = NULL;
+static int
+set_mpu_volt(int mvolt)
+{
+	device_t dev;
+
+	__USE(dev);	// Simpler than complex ifdef.
+
+	if (mpu_supply == NULL)
+		return ENODEV;
+
+#if NTPS65217PMIC > 0
+	dev = device_find_by_xname("tps65217pmic0");
+	if (dev != NULL)
+		return tps65217pmic_set_volt(dev, mpu_supply, mvolt);
+#endif
+	return ENODEV;
+}
+
 static int
 mpu_current_frequency_sysctl_helper(SYSCTLFN_ARGS)
 {

Index: src/sys/arch/arm/omap/am335x_prcm.h
diff -u src/sys/arch/arm/omap/am335x_prcm.h:1.9 src/sys/arch/arm/omap/am335x_prcm.h:1.10
--- src/sys/arch/arm/omap/am335x_prcm.h:1.9	Sat Jun  6 14:00:32 2015
+++ src/sys/arch/arm/omap/am335x_prcm.h	Tue Oct 18 15:10:35 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: am335x_prcm.h,v 1.9 2015/06/06 14:00:32 jmcneill Exp $	*/
+/*	$NetBSD: am335x_prcm.h,v 1.10 2016/10/18 15:10:35 kiyohara Exp $	*/
 
 /*
  * TI OMAP Power, Reset, and Clock Management on the AM335x
@@ -150,7 +150,6 @@ struct omap_module {
 #define RST_GLOBAL_COLD_SW	__BIT(1)
 
 #ifdef _KERNEL
-int  set_mpu_volt(int);
 void am335x_sys_clk(bus_space_handle_t);
 void am335x_cpu_clk(void);
 #endif

Index: src/sys/arch/evbarm/beagle/beagle_machdep.c
diff -u src/sys/arch/evbarm/beagle/beagle_machdep.c:1.65 src/sys/arch/evbarm/beagle/beagle_machdep.c:1.66
--- src/sys/arch/evbarm/beagle/beagle_machdep.c:1.65	Tue Oct 18 14:39:52 2016
+++ src/sys/arch/evbarm/beagle/beagle_machdep.c	Tue Oct 18 15:10:35 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: beagle_machdep.c,v 1.65 2016/10/18 14:39:52 kiyohara Exp $ */
+/*	$NetBSD: beagle_machdep.c,v 1.66 2016/10/18 15:10:35 kiyohara Exp $ */
 
 /*
  * Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,7 +125,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: beagle_machdep.c,v 1.65 2016/10/18 14:39:52 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: beagle_machdep.c,v 1.66 2016/10/18 15:10:35 kiyohara Exp $");
 
 #include "opt_machdep.h"
 #include "opt_ddb.h"
@@ -141,7 +141,6 @@ __KERNEL_RCSID(0, "$NetBSD: beagle_machd
 #include "sdhc.h"
 #include "ukbd.h"
 #include "arml2cc.h"
-#include "tps65217pmic.h"
 
 #include 
 #include 
@@ -191,7 +190,6 @@ __KERNEL_RCSID(0, "$NetBSD: beagle_machd
 # endif
 # include 
 # include 
-# include 
 # if NSDHC > 0
 #  include 
 #  include 
@@ -241,9 +239,6 @@ int use_fb_console = true;
 #ifdef CPU_CORTEXA15
 uint32_t omap5_cnt_frq;
 #endif
-#if defined(TI_AM335X)
-device_t pmic_dev = NULL;
-#endif
 
 /*
  * Macros to translate between physical and virtual for a subset of the
@@ -1153,24 +1148,9 @@ beagle_device_register(device_t self, vo
 	}
 #if defined(TI_AM335X)
 	if (device_is_a(self, "tps65217pmic")) {
-		pmic_dev = self;
-	}
-#endif
-}
-
-#if defined(TI_AM335X)
-int
-set_mpu_volt(int mvolt)
-{
-
-#if NTPS65217PMIC > 0
-	if (pmic_dev == NULL)
-		return ENODEV;
+		extern const char *mpu_supply;
 
-	/* MPU voltage is on vdcd2 */
-	return tps65217pmic_set_volt(pmic_dev, "DCDC2", mvolt);
-#else
-	return -1;
+		mpu_supply = "DCDC2";
+	}
 #endif
 }
-#endif



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

2016-10-18 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Oct 18 14:48:11 UTC 2016

Modified Files:
src/sys/arch/evbarm/conf: VTC100

Log Message:
Remove intrbase and intr from omapgpio.


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

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/conf/VTC100
diff -u src/sys/arch/evbarm/conf/VTC100:1.9 src/sys/arch/evbarm/conf/VTC100:1.10
--- src/sys/arch/evbarm/conf/VTC100:1.9	Tue Oct 18 14:45:05 2016
+++ src/sys/arch/evbarm/conf/VTC100	Tue Oct 18 14:48:11 2016
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: VTC100,v 1.9 2016/10/18 14:45:05 kiyohara Exp $
+#	$NetBSD: VTC100,v 1.10 2016/10/18 14:48:11 kiyohara Exp $
 #
 #	VTC100 -- NEXCOM VTC100 Kernel
 #
@@ -198,13 +198,13 @@ ld*		at sdmmc?
 #options SDHC_DEBUG
 
 # General-purpose I/O pins
-omapgpio0	at obio0 addr 0x44e07000 size 0x1000 # intrbase 128 intr 29
+omapgpio0	at obio0 addr 0x44e07000 size 0x1000
 gpio0		at omapgpio0
-omapgpio1	at obio1 addr 0x4804c000 size 0x1000 # intrbase 160 intr 30
+omapgpio1	at obio1 addr 0x4804c000 size 0x1000
 gpio1		at omapgpio1
-omapgpio2	at obio1 addr 0x481ac000 size 0x1000 # intrbase 192 intr 32
+omapgpio2	at obio1 addr 0x481ac000 size 0x1000
 gpio2		at omapgpio2
-omapgpio3	at obio1 addr 0x481ae000 size 0x1000 # intrbase 224 intr 32
+omapgpio3	at obio1 addr 0x481ae000 size 0x1000
 gpio3		at omapgpio3
 
 # I2C Controller



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

2016-10-18 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Oct 18 14:47:14 UTC 2016

Modified Files:
src/sys/arch/evbarm/conf: PEPPER

Log Message:
Enable tifb and wsdisplay.


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

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/conf/PEPPER
diff -u src/sys/arch/evbarm/conf/PEPPER:1.1 src/sys/arch/evbarm/conf/PEPPER:1.2
--- src/sys/arch/evbarm/conf/PEPPER:1.1	Sat Oct 15 15:29:51 2016
+++ src/sys/arch/evbarm/conf/PEPPER	Tue Oct 18 14:47:14 2016
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: PEPPER,v 1.1 2016/10/15 15:29:51 kiyohara Exp $
+#	$NetBSD: PEPPER,v 1.2 2016/10/18 14:47:14 kiyohara Exp $
 #
 #	PEPPER -- Gumstix. Inc. Pepper Single Board Computer platforms kernel
 #
@@ -261,24 +261,24 @@ omapwdt32k*	at obio0 addr 0x44e35000 siz
 trng*		at obio1 addr 0x4831 size 0x2000 intr 111	# TRNG
 
 # onboard video, experimental. Video mode is hardcoded in the driver
-#tifb* 	at obio1 addr 0x4830e000 size 0x1000 intr 36
+tifb* 	at obio1 addr 0x4830e000 size 0x1000 intr 36
 
 # make sure the console display is always wsdisplay0
-#wsdisplay*	at wsemuldisplaydev?
+wsdisplay*	at wsemuldisplaydev?
 
 # various options for wscons - we try to look as much like a standard
 # sun console as possible
-#options 	WSEMUL_VT100
-#options 	WSDISPLAY_COMPAT_PCVT
-#options 	WSDISPLAY_COMPAT_SYSCONS
-#options 	WSDISPLAY_COMPAT_USL
-#options 	WSDISPLAY_SCROLLSUPPORT
-#options 	WS_KERNEL_FG=WSCOL_GREEN
-#options 	WSDISPLAY_DEFAULTSCREENS=4
-#options 	FONT_GALLANT12x22
-#options 	FONT_BOLD8x16
+options 	WSEMUL_VT100
+options 	WSDISPLAY_COMPAT_PCVT
+options 	WSDISPLAY_COMPAT_SYSCONS
+options 	WSDISPLAY_COMPAT_USL
+options 	WSDISPLAY_SCROLLSUPPORT
+options 	WS_KERNEL_FG=WSCOL_GREEN
+options 	WSDISPLAY_DEFAULTSCREENS=4
+options 	FONT_GALLANT12x22
+options 	FONT_BOLD8x16
 # compatibility to other console drivers
-#options 	WSDISPLAY_COMPAT_RAWKBD 	# can get raw scancodes
+options 	WSDISPLAY_COMPAT_RAWKBD 	# can get raw scancodes
 
 # Ethernet
 cpsw*		at obio2 addr 0x4a10 size 0x8000 intrbase 40



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

2016-10-18 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Oct 18 14:45:05 UTC 2016

Modified Files:
src/sys/arch/evbarm/conf: VTC100

Log Message:
Enable tifb and wsdisplay.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbarm/conf/VTC100

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/conf/VTC100
diff -u src/sys/arch/evbarm/conf/VTC100:1.8 src/sys/arch/evbarm/conf/VTC100:1.9
--- src/sys/arch/evbarm/conf/VTC100:1.8	Sat Oct 15 15:24:00 2016
+++ src/sys/arch/evbarm/conf/VTC100	Tue Oct 18 14:45:05 2016
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: VTC100,v 1.8 2016/10/15 15:24:00 kiyohara Exp $
+#	$NetBSD: VTC100,v 1.9 2016/10/18 14:45:05 kiyohara Exp $
 #
 #	VTC100 -- NEXCOM VTC100 Kernel
 #
@@ -241,24 +241,24 @@ omapdmtimer2	at obio1 addr 0x48044000 si
 omapwdt32k*	at obio0 addr 0x44e35000 size 0x1000	# WDT1
 
 # onboard video, experimental. Video mode is hardcoded in the driver
-#tifb* 		at obio1 addr 0x4830E000 size 0x1000 intr 36
+tifb* 		at obio1 addr 0x4830E000 size 0x1000 intr 36
 
 # make sure the console display is always wsdisplay0
-#wsdisplay*	at wsemuldisplaydev?
+wsdisplay*	at wsemuldisplaydev?
 
 # various options for wscons - we try to look as much like a standard
 # sun console as possible
-#options 	WSEMUL_VT100
-#options 	WSDISPLAY_COMPAT_PCVT
-#options 	WSDISPLAY_COMPAT_SYSCONS
-#options 	WSDISPLAY_COMPAT_USL
-#options 	WSDISPLAY_SCROLLSUPPORT
-#options 	WS_KERNEL_FG=WSCOL_GREEN
-#options 	WSDISPLAY_DEFAULTSCREENS=4
-#options 	FONT_GALLANT12x22
-#options 	FONT_BOLD8x16
+options 	WSEMUL_VT100
+options 	WSDISPLAY_COMPAT_PCVT
+options 	WSDISPLAY_COMPAT_SYSCONS
+options 	WSDISPLAY_COMPAT_USL
+options 	WSDISPLAY_SCROLLSUPPORT
+options 	WS_KERNEL_FG=WSCOL_GREEN
+options 	WSDISPLAY_DEFAULTSCREENS=4
+options 	FONT_GALLANT12x22
+options 	FONT_BOLD8x16
 # compatibility to other console drivers
-#options 	WSDISPLAY_COMPAT_RAWKBD 	# can get raw scancodes
+options 	WSDISPLAY_COMPAT_RAWKBD 	# can get raw scancodes
 
 pseudo-device	wsmux			# mouse & keyboard multiplexor
 pseudo-device	wsfont



CVS commit: src/sys/arch/evbarm

2016-10-18 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Oct 18 14:39:52 UTC 2016

Modified Files:
src/sys/arch/evbarm/beagle: beagle_machdep.c
src/sys/arch/evbarm/gumstix: gumstix_machdep.c gxio.c

Log Message:
Support tifb.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/evbarm/beagle/beagle_machdep.c
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/evbarm/gumstix/gumstix_machdep.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/evbarm/gumstix/gxio.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/beagle/beagle_machdep.c
diff -u src/sys/arch/evbarm/beagle/beagle_machdep.c:1.64 src/sys/arch/evbarm/beagle/beagle_machdep.c:1.65
--- src/sys/arch/evbarm/beagle/beagle_machdep.c:1.64	Sun Jul  3 11:40:58 2016
+++ src/sys/arch/evbarm/beagle/beagle_machdep.c	Tue Oct 18 14:39:52 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: beagle_machdep.c,v 1.64 2016/07/03 11:40:58 kiyohara Exp $ */
+/*	$NetBSD: beagle_machdep.c,v 1.65 2016/10/18 14:39:52 kiyohara Exp $ */
 
 /*
  * Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,7 +125,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: beagle_machdep.c,v 1.64 2016/07/03 11:40:58 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: beagle_machdep.c,v 1.65 2016/10/18 14:39:52 kiyohara Exp $");
 
 #include "opt_machdep.h"
 #include "opt_ddb.h"
@@ -190,6 +190,7 @@ __KERNEL_RCSID(0, "$NetBSD: beagle_machd
 #  error no prcm device configured.
 # endif
 # include 
+# include 
 # include 
 # if NSDHC > 0
 #  include 
@@ -497,7 +498,13 @@ initarm(void *arg)
 
 	/* The console is going to try to map things.  Give pmap a devmap. */
 	pmap_devmap_register(devmap);
+
+	if (get_bootconf_option(bootargs, "console",
+		BOOTOPT_TYPE_STRING, &ptr) && strncmp(ptr, "fb", 2) == 0) {
+		use_fb_console = true;
+	}
 	consinit();
+
 #ifdef CPU_CORTEXA15
 #ifdef MULTIPROCESSOR
 	arm_cpu_max = 1 + __SHIFTOUT(armreg_l2ctrl_read(), L2CTRL_NUMCPU);
@@ -618,11 +625,6 @@ initarm(void *arg)
 
 	db_trap_callback = beagle_db_trap;
 
-	if (get_bootconf_option(boot_args, "console",
-		BOOTOPT_TYPE_STRING, &ptr) && strncmp(ptr, "fb", 2) == 0) {
-		use_fb_console = true;
-	}
-	
 	return initarm_common(KERNEL_VM_BASE, KERNEL_VM_SIZE, NULL, 0);
 
 }
@@ -688,7 +690,8 @@ consinit(void)
 #endif
 
 #if NUKBD > 0
-	ukbd_cnattach();	/* allow USB keyboard to become console */
+	if (use_fb_console)
+		ukbd_cnattach(); /* allow USB keyboard to become console */
 #endif
 
 	beagle_putchar('f');
@@ -1107,6 +1110,39 @@ beagle_device_register(device_t self, vo
 		return;
 	}
 	if (device_is_a(self, "tifb")) {
+		static const struct tifb_panel_info default_panel_info = {
+			.panel_tft = 1,
+			.panel_mono = false,
+			.panel_bpp = 24,
+
+			.panel_pxl_clk = 3000,
+			.panel_width = 800,
+			.panel_height = 600,
+			.panel_hfp = 0,
+			.panel_hbp = 47,
+			.panel_hsw = 47,
+			.panel_vfp = 0,
+			.panel_vbp = 10,
+			.panel_vsw = 2,
+			.panel_invert_hsync = 1,
+			.panel_invert_vsync = 1,
+
+			.panel_ac_bias = 255,
+			.panel_ac_bias_intrpt = 0,
+			.panel_dma_burst_sz = 16,
+			.panel_fdd = 0x80,
+			.panel_sync_edge = 0,
+			.panel_sync_ctrl = 1,
+			.panel_invert_pxl_clk = 0,
+		};
+		prop_data_t panel_info;
+
+		panel_info = prop_data_create_data_nocopy(&default_panel_info,
+		sizeof(struct tifb_panel_info));
+		KASSERT(panel_info != NULL);
+		prop_dictionary_set(dict, "panel-info", panel_info);
+		prop_object_release(panel_info);
+
 		if (use_fb_console)
 			prop_dictionary_set_bool(dict, "is_console", true);
 		return;

Index: src/sys/arch/evbarm/gumstix/gumstix_machdep.c
diff -u src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.54 src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.55
--- src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.54	Sun Oct 16 23:07:31 2016
+++ src/sys/arch/evbarm/gumstix/gumstix_machdep.c	Tue Oct 18 14:39:52 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstix_machdep.c,v 1.54 2016/10/16 23:07:31 kiyohara Exp $ */
+/*	$NetBSD: gumstix_machdep.c,v 1.55 2016/10/18 14:39:52 kiyohara Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007  WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -192,6 +192,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -262,6 +263,7 @@ int comcnmode = CONMODE;
 static char console[16];
 #endif
 
+const struct tifb_panel_info *tifb_panel_info = NULL;
 /* Use TPS65217 White LED Driver */
 bool use_tps65217_wled = false;
 
@@ -1164,6 +1166,14 @@ gumstix_device_register(device_t dev, vo
 		prop_dictionary_set_bool(dict, "dual-volt", dualvolt);
 	}
 	if (device_is_a(dev, "tifb")) {
+		prop_data_t panel_info;
+
+		panel_info = prop_data_create_data_nocopy(tifb_panel_info,
+		sizeof(struct tifb_panel_info));
+		KASSERT(panel_info != NULL);
+		prop_dictionary_set(dict, "panel-info", panel_info);
+		prop_object_release(panel_info);
+
 #if defined(OMAP2)
 		/* enable LCD */
 		omap2_gpio_c

CVS commit: src/sys/arch/arm/omap

2016-10-18 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Oct 18 14:08:53 UTC 2016

Modified Files:
src/sys/arch/arm/omap: omap2_gpio.c

Log Message:
The variable gpio_module[] into #ifdef TI_AM335X - #endif.
Thanks for joerg@.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arm/omap/omap2_gpio.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/arm/omap/omap2_gpio.c
diff -u src/sys/arch/arm/omap/omap2_gpio.c:1.20 src/sys/arch/arm/omap/omap2_gpio.c:1.21
--- src/sys/arch/arm/omap/omap2_gpio.c:1.20	Tue Oct 18 14:02:48 2016
+++ src/sys/arch/arm/omap/omap2_gpio.c	Tue Oct 18 14:08:53 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: omap2_gpio.c,v 1.20 2016/10/18 14:02:48 kiyohara Exp $	*/
+/*	$NetBSD: omap2_gpio.c,v 1.21 2016/10/18 14:08:53 kiyohara Exp $	*/
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -28,7 +28,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: omap2_gpio.c,v 1.20 2016/10/18 14:02:48 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap2_gpio.c,v 1.21 2016/10/18 14:08:53 kiyohara Exp $");
 
 #define _INTR_PRIVATE
 
@@ -64,12 +64,14 @@ __KERNEL_RCSID(0, "$NetBSD: omap2_gpio.c
 #include 
 #endif
 
+#ifdef TI_AM335X
 static const struct omap_module gpio_module[] = {
 	{ 0, 0 },
 	{ AM335X_PRCM_CM_PER, CM_PER_GPIO1_CLKCTRL },
 	{ AM335X_PRCM_CM_PER, CM_PER_GPIO2_CLKCTRL },
 	{ AM335X_PRCM_CM_PER, CM_PER_GPIO3_CLKCTRL },
 };
+#endif
 
 static void gpio_pic_block_irqs(struct pic_softc *, size_t, uint32_t);
 static void gpio_pic_block_irqs2(struct pic_softc *, size_t, uint32_t);



CVS commit: src/sys/arch/arm/omap

2016-10-18 Thread KIYOHARA Takashi
re running in bypass */
 	if (DPLL_BYP_CLKSEL(reg))
 		return ENXIO;
-		
+
 	*freq = DPLL_MULT(reg) * (omap_sys_clk / DPLL_DIV(reg));
-	return(0);
+	return 0;
 }
 #endif

Index: src/sys/arch/arm/omap/tifbreg.h
diff -u src/sys/arch/arm/omap/tifbreg.h:1.1 src/sys/arch/arm/omap/tifbreg.h:1.2
--- src/sys/arch/arm/omap/tifbreg.h:1.1	Wed Jul 16 18:30:43 2014
+++ src/sys/arch/arm/omap/tifbreg.h	Tue Oct 18 14:14:51 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: tifbreg.h,v 1.1 2014/07/16 18:30:43 bouyer Exp $ */
+/* $NetBSD: tifbreg.h,v 1.2 2016/10/18 14:14:51 kiyohara Exp $ */
 /*-
  * Copyright 2013 Oleksandr Tymoshenko 
  * All rights reserved.
@@ -43,32 +43,31 @@
 #define		RASTER_CTRL_TFT24_UNPACKED	(1 << 26)
 #define		RASTER_CTRL_TFT24		(1 << 25)
 #define		RASTER_CTRL_STN565		(1 << 24)
-#define		RASTER_CTRL_TFTPMAP		(1 << 23)
+#define		RASTER_CTRL_TFTMAP		(1 << 23)
 #define		RASTER_CTRL_NIBMODE		(1 << 22)
-#define		RASTER_CTRL_PALMODE_SHIFT	20
-#define		PALETTE_PALETTE_AND_DATA	0x00
-#define		PALETTE_PALETTE_ONLY		0x01
-#define		PALETTE_DATA_ONLY		0x02
-#define		RASTER_CTRL_REQDLY_SHIFT	12
+#define		RASTER_CTRL_PALMODE_PALETTE_AND_DATA (0 << 20)
+#define		RASTER_CTRL_PALMODE_PALETTE_ONLY (1 << 20)
+#define		RASTER_CTRL_PALMODE_DATA_ONLY	(2 << 20)
+#define		RASTER_CTRL_REQDLY(v)		((v) << 12)
 #define		RASTER_CTRL_MONO8B		(1 << 9)
-#define		RASTER_CTRL_RBORDER		(1 << 8)
+#define		RASTER_CTRL_RDORDER		(1 << 8)
 #define		RASTER_CTRL_LCDTFT		(1 << 7)
 #define		RASTER_CTRL_LCDBW		(1 << 1)
 #define		RASTER_CTRL_LCDEN		(1 << 0)
 #define	LCD_RASTER_TIMING_0	0x2C
-#define		RASTER_TIMING_0_HBP_SHIFT	24
-#define		RASTER_TIMING_0_HFP_SHIFT	16
-#define		RASTER_TIMING_0_HSW_SHIFT	10
-#define		RASTER_TIMING_0_PPLLSB_SHIFT	4
-#define		RASTER_TIMING_0_PPLMSB_SHIFT	3
+#define		RASTER_TIMING_0_HBP(v)		v) - 1) & 0xff) << 24)
+#define		RASTER_TIMING_0_HFP(v)		v) - 1) & 0xff) << 16)
+#define		RASTER_TIMING_0_HSW(v)		v) - 1) & 0x3f) << 10)
+#define		RASTER_TIMING_0_PPL(w) \
+		(w) - 1) >> 7) & 0x8) | w) - 1) >> 0) & 0x3f0))
 #define	LCD_RASTER_TIMING_1	0x30
-#define		RASTER_TIMING_1_VBP_SHIFT	24
-#define		RASTER_TIMING_1_VFP_SHIFT	16
-#define		RASTER_TIMING_1_VSW_SHIFT	10
-#define		RASTER_TIMING_1_LPP_SHIFT	0
+#define		RASTER_TIMING_1_VBP(v)		(((v) & 0xff) << 24)
+#define		RASTER_TIMING_1_VFP(v)		(((v) & 0xff) << 16)
+#define		RASTER_TIMING_1_VSW(v)		v) - 1) & 0x3f) << 10)
+#define		RASTER_TIMING_1_LPP(h)		h) - 1) & 0x3ff) << 0)
 #define	LCD_RASTER_TIMING_2	0x34
-#define		RASTER_TIMING_2_HSWHI_SHIFT	27
-#define		RASTER_TIMING_2_LPP_B10_SHIFT	26
+#define		RASTER_TIMING_2_HSW(v)		(v) - 1) >> 6) & 0xf) << 27)
+#define		RASTER_TIMING_2_LPP(h)		(((h) & 0x400) ? (1 << 26) : 0)
 #define		RASTER_TIMING_2_PHSVS		(1 << 25)
 #define		RASTER_TIMING_2_PHSVS_RISE	(1 << 24)
 #define		RASTER_TIMING_2_PHSVS_FALL	(0 << 24)
@@ -76,10 +75,10 @@
 #define		RASTER_TIMING_2_IPC		(1 << 22)
 #define		RASTER_TIMING_2_IHS		(1 << 21)
 #define		RASTER_TIMING_2_IVS		(1 << 20)
-#define		RASTER_TIMING_2_ACBI_SHIFT	16
-#define		RASTER_TIMING_2_ACB_SHIFT	8
-#define		RASTER_TIMING_2_HBPHI_SHIFT	4
-#define		RASTER_TIMING_2_HFPHI_SHIFT	0
+#define		RASTER_TIMING_2_ACBI(x)		((x) << 16)
+#define		RASTER_TIMING_2_ACB(x)		((x) << 8)
+#define		RASTER_TIMING_2_HBP(v)		v) - 1) >> 4) & 0x30)
+#define		RASTER_TIMING_2_HFP(v)		v) - 1) >> 8) & 0x3)
 #define	LCD_RASTER_SUBPANEL	0x38
 #define	LCD_RASTER_SUBPANEL2	0x3C
 #define	LCD_LCDDMA_CTRL		0x40
@@ -88,8 +87,8 @@
 #define		LCDDMA_CTRL_BURST_SIZE_SHIFT	4
 #define		LCDDMA_CTRL_BYTES_SWAP		(1 << 3)
 #define		LCDDMA_CTRL_BE			(1 << 1)
-#define		LCDDMA_CTRL_FB0_ONLY		0
 #define		LCDDMA_CTRL_FB0_FB1		(1 << 0)
+#define		LCDDMA_CTRL_FB0_ONLY		(0 << 0)
 #define	LCD_LCDDMA_FB0_BASE	0x44
 #define	LCD_LCDDMA_FB0_CEILING	0x48
 #define	LCD_LCDDMA_FB1_BASE	0x4C
@@ -115,10 +114,23 @@
 #define		IRQ_FRAME_DONE		(1 << 0)
 #define	LCD_CLKC_ENABLE		0x6C
 #define		CLKC_ENABLE_DMA		(1 << 2)
-#define		CLKC_ENABLE_LDID	(1 << 1)
+#define		CLKC_ENABLE_LIDD	(1 << 1)
 #define		CLKC_ENABLE_CORE	(1 << 0)
 #define	LCD_CLKC_RESET		0x70
 #define		CLKC_RESET_MAIN		(1 << 3)
 #define		CLKC_RESET_DMA		(1 << 2)
-#define		CLKC_RESET_LDID		(1 << 1)
+#define		CLKC_RESET_LIDD		(1 << 1)
 #define		CLKC_RESET_CORE		(1 << 0)
+
+/* 16-Entry Palette/Buffer Format */
+#define PALETTE_BPP_1			(0 << 12)
+#define PALETTE_BPP_2			(1 << 12)
+#define PALETTE_BPP_4			(2 << 12)
+#define PALETTE_BPP_8			(3 << 12)
+#define PALETTE_BPP_XX			(4 << 12)
+#define PALETTE_MONO(v)			((v) & 0xf)
+#define PALETTE_RED(r)			(((r) & 0xf) << 8)
+#define PALETTE_GREEN(g)		(((g) &

CVS commit: src/sys/arch/arm/omap

2016-10-18 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Oct 18 14:02:48 UTC 2016

Modified Files:
src/sys/arch/arm/omap: omap2_gpio.c

Log Message:
Allow obio_intr == OBIOCF_INTR_DEFAULT.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/omap/omap2_gpio.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/arm/omap/omap2_gpio.c
diff -u src/sys/arch/arm/omap/omap2_gpio.c:1.19 src/sys/arch/arm/omap/omap2_gpio.c:1.20
--- src/sys/arch/arm/omap/omap2_gpio.c:1.19	Sat Oct 15 15:11:56 2016
+++ src/sys/arch/arm/omap/omap2_gpio.c	Tue Oct 18 14:02:48 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: omap2_gpio.c,v 1.19 2016/10/15 15:11:56 kiyohara Exp $	*/
+/*	$NetBSD: omap2_gpio.c,v 1.20 2016/10/18 14:02:48 kiyohara Exp $	*/
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -28,7 +28,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: omap2_gpio.c,v 1.19 2016/10/15 15:11:56 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap2_gpio.c,v 1.20 2016/10/18 14:02:48 kiyohara Exp $");
 
 #define _INTR_PRIVATE
 
@@ -489,9 +489,6 @@ gpio_attach(device_t parent, device_t se
 
 	gpio->gpio_dev = self;
 
-	if (oa->obio_intr == OBIOCF_INTR_DEFAULT)
-		panic("\n%s: no intr assigned", device_xname(self));
-
 	if (oa->obio_size == OBIOCF_SIZE_DEFAULT)
 		panic("\n%s: no size assigned", device_xname(self));
 



CVS commit: src/sys/arch/arm/arm

2016-10-18 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Oct 18 13:58:53 UTC 2016

Modified Files:
src/sys/arch/arm/arm: cpufunc.c

Log Message:
Indent.


To generate a diff of this commit:
cvs rdiff -u -r1.161 -r1.162 src/sys/arch/arm/arm/cpufunc.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/arm/arm/cpufunc.c
diff -u src/sys/arch/arm/arm/cpufunc.c:1.161 src/sys/arch/arm/arm/cpufunc.c:1.162
--- src/sys/arch/arm/arm/cpufunc.c:1.161	Mon May 30 17:18:38 2016
+++ src/sys/arch/arm/arm/cpufunc.c	Tue Oct 18 13:58:52 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufunc.c,v 1.161 2016/05/30 17:18:38 dholland Exp $	*/
+/*	$NetBSD: cpufunc.c,v 1.162 2016/10/18 13:58:52 kiyohara Exp $	*/
 
 /*
  * arm7tdmi support code Copyright (c) 2001 John Fremlin
@@ -49,7 +49,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.161 2016/05/30 17:18:38 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.162 2016/10/18 13:58:52 kiyohara Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_cpuoptions.h"
@@ -2158,13 +2158,13 @@ set_cpufuncs(void)
 	cputype == CPU_ID_ARM_88SV581X_V6 ||
 	cputype == CPU_ID_ARM_88SV581X_V7) &&
 	(armreg_pfr0_read() & ARM_PFR0_THUMBEE_MASK)) {
-			cpufuncs = pj4bv7_cpufuncs;
+		cpufuncs = pj4bv7_cpufuncs;
 #if defined(CPU_ARMV6) || defined(CPU_PRE_ARMV6)
-			cpu_armv7_p = true;
+		cpu_armv7_p = true;
 #endif
-			get_cachetype_cp15();
-			pmap_pte_init_armv7();
-			return 0;
+		get_cachetype_cp15();
+		pmap_pte_init_armv7();
+		return 0;
 	}
 #endif /* CPU_PJ4B */
 



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

2016-10-16 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sun Oct 16 23:07:31 UTC 2016

Modified Files:
src/sys/arch/evbarm/gumstix: gumstix_machdep.c

Log Message:
omap2_gpio_*() into #if - #endif.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/evbarm/gumstix/gumstix_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/gumstix/gumstix_machdep.c
diff -u src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.53 src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.54
--- src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.53	Sun Oct 16 13:54:28 2016
+++ src/sys/arch/evbarm/gumstix/gumstix_machdep.c	Sun Oct 16 23:07:31 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstix_machdep.c,v 1.53 2016/10/16 13:54:28 kiyohara Exp $ */
+/*	$NetBSD: gumstix_machdep.c,v 1.54 2016/10/16 23:07:31 kiyohara Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007  WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -1164,11 +1164,13 @@ gumstix_device_register(device_t dev, vo
 		prop_dictionary_set_bool(dict, "dual-volt", dualvolt);
 	}
 	if (device_is_a(dev, "tifb")) {
+#if defined(OMAP2)
 		/* enable LCD */
 		omap2_gpio_ctl(59, GPIO_PIN_OUTPUT);
 		omap2_gpio_write(59, 0);	/* reset */
 		delay(100);
 		omap2_gpio_write(59, 1);
+#endif
 	}
 	if (device_is_a(dev, "tps65217pmic")) {
 #if defined(TI_AM335X)



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

2016-10-16 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sun Oct 16 13:54:28 UTC 2016

Modified Files:
src/sys/arch/evbarm/gumstix: gumstix_machdep.c gxio.c

Log Message:
Remove not commited header-file and variable.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/evbarm/gumstix/gumstix_machdep.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/evbarm/gumstix/gxio.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/gumstix/gumstix_machdep.c
diff -u src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.52 src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.53
--- src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.52	Sat Oct 15 15:27:18 2016
+++ src/sys/arch/evbarm/gumstix/gumstix_machdep.c	Sun Oct 16 13:54:28 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstix_machdep.c,v 1.52 2016/10/15 15:27:18 kiyohara Exp $ */
+/*	$NetBSD: gumstix_machdep.c,v 1.53 2016/10/16 13:54:28 kiyohara Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007  WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -192,7 +192,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -263,7 +262,6 @@ int comcnmode = CONMODE;
 static char console[16];
 #endif
 
-const struct tifb_panel_info *tifb_panel_info = NULL;
 /* Use TPS65217 White LED Driver */
 bool use_tps65217_wled = false;
 
@@ -1166,14 +1164,6 @@ gumstix_device_register(device_t dev, vo
 		prop_dictionary_set_bool(dict, "dual-volt", dualvolt);
 	}
 	if (device_is_a(dev, "tifb")) {
-		prop_data_t panel_info;
-
-		panel_info = prop_data_create_data_nocopy(tifb_panel_info,
-		sizeof(struct tifb_panel_info));
-		KASSERT(panel_info != NULL);
-		prop_dictionary_set(dict, "panel-info", panel_info);
-		prop_object_release(panel_info);
-
 		/* enable LCD */
 		omap2_gpio_ctl(59, GPIO_PIN_OUTPUT);
 		omap2_gpio_write(59, 0);	/* reset */

Index: src/sys/arch/evbarm/gumstix/gxio.c
diff -u src/sys/arch/evbarm/gumstix/gxio.c:1.21 src/sys/arch/evbarm/gumstix/gxio.c:1.22
--- src/sys/arch/evbarm/gumstix/gxio.c:1.21	Sat Oct 15 15:27:18 2016
+++ src/sys/arch/evbarm/gumstix/gxio.c	Sun Oct 16 13:54:28 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: gxio.c,v 1.21 2016/10/15 15:27:18 kiyohara Exp $ */
+/*	$NetBSD: gxio.c,v 1.22 2016/10/16 13:54:28 kiyohara Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007 WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -31,7 +31,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gxio.c,v 1.21 2016/10/15 15:27:18 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gxio.c,v 1.22 2016/10/16 13:54:28 kiyohara Exp $");
 
 #include "opt_cputypes.h"
 #include "opt_gumstix.h"
@@ -57,7 +57,6 @@ __KERNEL_RCSID(0, "$NetBSD: gxio.c,v 1.2
 #endif
 #endif
 #include 
-#include 
 #include 
 #if defined(CPU_XSCALE)
 #include 



CVS commit: src/sys/arch/arm/omap

2016-10-16 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sun Oct 16 13:09:57 UTC 2016

Modified Files:
src/sys/arch/arm/omap: ti_iic.c

Log Message:
Fix miss commit.
  Add macro OMAP2_I2C_FIFOBYTES.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/omap/ti_iic.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/arm/omap/ti_iic.c
diff -u src/sys/arch/arm/omap/ti_iic.c:1.9 src/sys/arch/arm/omap/ti_iic.c:1.10
--- src/sys/arch/arm/omap/ti_iic.c:1.9	Sat Oct 15 15:08:59 2016
+++ src/sys/arch/arm/omap/ti_iic.c	Sun Oct 16 13:09:57 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: ti_iic.c,v 1.9 2016/10/15 15:08:59 kiyohara Exp $ */
+/* $NetBSD: ti_iic.c,v 1.10 2016/10/16 13:09:57 kiyohara Exp $ */
 
 /*
  * Copyright (c) 2013 Manuel Bouyer.  All rights reserved.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ti_iic.c,v 1.9 2016/10/15 15:08:59 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ti_iic.c,v 1.10 2016/10/16 13:09:57 kiyohara Exp $");
 
 #include "opt_omap.h"
 #include "locators.h"
@@ -83,6 +83,8 @@ __KERNEL_RCSID(0, "$NetBSD: ti_iic.c,v 1
 #define OMAP2_I2C_SLAVE_ADDR	0x01
 #endif
 
+#define OMAP2_I2C_FIFOBYTES(fd)	(8 << (fd))
+
 #ifdef I2CDEBUG
 #define DPRINTF(args)	printf args
 #else



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

2016-10-15 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Oct 15 16:30:46 UTC 2016

Modified Files:
src/sys/arch/evbarm/gumstix: gumstixreg.h

Log Message:
Add map for DuoVero and Pepper.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbarm/gumstix/gumstixreg.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/gumstix/gumstixreg.h
diff -u src/sys/arch/evbarm/gumstix/gumstixreg.h:1.8 src/sys/arch/evbarm/gumstix/gumstixreg.h:1.9
--- src/sys/arch/evbarm/gumstix/gumstixreg.h:1.8	Thu Mar 31 14:33:17 2016
+++ src/sys/arch/evbarm/gumstix/gumstixreg.h	Sat Oct 15 16:30:46 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstixreg.h,v 1.8 2016/03/31 14:33:17 kiyohara Exp $  */
+/*	$NetBSD: gumstixreg.h,v 1.9 2016/10/15 16:30:46 kiyohara Exp $  */
 /*
  * Copyright (C) 2005, 2006 WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -49,8 +49,16 @@
 
 #define OVERO_L4_CORE_VBASE		0xc000
 #define OVERO_L4_PERIPHERAL_VBASE	0xc010
-#define OVERO_GPMC_VBASE		0xc020
+#define OVERO_L4_WAKEUP_VBASE		0xc020
+#define OVERO_GPMC_VBASE		0xc030
 
+#define DUOVERO_L4_CM_VBASE		0xc000
+#define DUOVERO_L4_PERIPHERAL_VBASE	0xc010
+#define DUOVERO_L4_WAKEUP_VBASE		0xc040
+#define DUOVERO_GPMC_VBASE		0xc050
+
+#define PEPPER_PRCM_VBASE		0xc000
+#define PEPPER_L4_PERIPHERAL_VBASE	0xc010
 
 #define ioreg_read(a)		(*(volatile unsigned *)(a))
 #define ioreg_write(a,v)	(*(volatile unsigned *)(a)=(v))



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

2016-10-15 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Oct 15 15:33:02 UTC 2016

Modified Files:
src/sys/arch/evbarm/conf: README.evbarm

Log Message:
Add Pepper and DuoVero.


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

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/conf/README.evbarm
diff -u src/sys/arch/evbarm/conf/README.evbarm:1.12 src/sys/arch/evbarm/conf/README.evbarm:1.13
--- src/sys/arch/evbarm/conf/README.evbarm:1.12	Tue Jul 12 13:32:14 2016
+++ src/sys/arch/evbarm/conf/README.evbarm	Sat Oct 15 15:33:02 2016
@@ -1,4 +1,4 @@
-$NetBSD: README.evbarm,v 1.12 2016/07/12 13:32:14 kiyohara Exp $
+$NetBSD: README.evbarm,v 1.13 2016/10/15 15:33:02 kiyohara Exp $
 
 config		date		boards
 ---
@@ -16,6 +16,7 @@ CUBIETRUCK	2014/04/11	Cubietech Cubietru
 CP3100		2006/11/08	Certance IOP321 CP-3100
 DEVKIT8000	2010/09/08	Embest OMAP3530 DevKit8000 eval Kit 
 DNS323		2010/10/02	D-Link DNS-323 Marvell SoC based NAS
+DUOVERO		2016/10/15	Gumstix Inc. DuoVero COMS boards
 GEMINI		2008/10/24	Cortina Systems SL3516 eval board
 GUMSTIX		2006/10/16	Gumstix Inc. PXA255/270 based boards
 HDL_G		2006/04/16	I-O DATA HDL-G Giga LANDISK
@@ -51,6 +52,7 @@ OSK5912		2007/01/06	TI OMAP 5912 OSK boa
 OVERO		2010/07/10	Gumstix Inc. Overo COMS boards
 PANDABOARD	2012/08/20	TI OMAP4430 PandaBoard
 PARALLELLA	2015/01/23	Xilinx Zynq and Epiphany multi-core chips
+PEPPER		2016/10/15	Gumstix Inc. Pepper SBC(Single Board Computer)
 ROCKCHIP	2014/12/26	Radxa Rock/Lite/Pro, MINIX NEO X7, Rayeager PX2
 SHEEVAPLUG	2010/10/02	Marvell SheevaPlug
 SMDK2410	2003/07/31	Samsung SMDK2410 S3C2410 eval board



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

2016-10-15 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Oct 15 15:29:51 UTC 2016

Added Files:
src/sys/arch/evbarm/conf: DUOVERO PEPPER

Log Message:
Add Gumstix Inc's Pepper and DuoVero.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbarm/conf/DUOVERO \
src/sys/arch/evbarm/conf/PEPPER

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/conf/DUOVERO
diff -u /dev/null src/sys/arch/evbarm/conf/DUOVERO:1.1
--- /dev/null	Sat Oct 15 15:29:51 2016
+++ src/sys/arch/evbarm/conf/DUOVERO	Sat Oct 15 15:29:51 2016
@@ -0,0 +1,336 @@
+#
+#	$NetBSD: DUOVERO,v 1.1 2016/10/15 15:29:51 kiyohara Exp $
+#
+#	DUOOVERO -- Gumstix. Inc. DuoVero COMS platforms kernel
+#
+
+include	"arch/evbarm/conf/std.overo"
+
+#options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
+
+# estimated number of users
+
+maxusers	32
+
+# CPU options
+
+options 	CPU_CORTEXA9
+options 	OMAP_4430
+options 	MULTIPROCESSOR
+options 	FPU_VFP
+options 	PMAPCOUNTERS
+options 	ARM_HAS_VBAR
+options 	__HAVE_MM_MD_DIRECT_MAPPED_PHYS
+makeoptions	CPUFLAGS="-mcpu=cortex-a9 -mfpu=neon"
+
+# Architecture options
+
+makeoptions	BOARDTYPE="duovero"
+options 	EVBARM_BOARDTYPE=duovero
+
+# Gumstix options
+options 	DUOVERO
+# Can specify 'expansion=' in args from u-boot.
+options 	GUMSTIX_NETBSD_ARGS_EXPANSION
+options 	GXIO_DEFAULT_EXPANSION="\"Parlor\""
+
+# Standard system options
+
+options 	RTC_OFFSET=0	# hardware clock is this many mins. west of GMT
+#options 	NTP		# NTP phase/frequency locked loop
+
+# File systems
+
+file-system	FFS		# UFS
+file-system 	EXT2FS		# second extended file system (linux)
+#file-system	LFS		# log-structured file system
+file-system	MFS		# memory file system
+file-system	NFS		# Network file system
+#file-system	NTFS		# Windows/NT file system (experimental)
+#file-system	CD9660		# ISO 9660 + Rock Ridge file system
+file-system	MSDOSFS		# MS-DOS file system
+file-system	FDESC		# /dev/fd
+file-system	KERNFS		# /kern
+#file-system	NULLFS		# loopback file system
+#file-system	OVERLAY		# overlay file system
+#file-system	PROCFS		# /proc
+#file-system	PUFFS		# Userspace file systems (e.g. ntfs-3g & sshfs)
+#file-system	UMAPFS		# NULLFS + uid and gid remapping
+file-system	UNION		# union file system
+#file-system	CODA		# Coda File System; also needs vcoda (below)
+#file-system	SMBFS		# experimental - CIFS; also needs nsmb (below)
+file-system	TMPFS		# memory file system
+file-system	PTYFS		# /dev/pts/N support
+#file-system	UDF		# experimental - OSTA UDF CD/DVD file-system
+#file-system	HFS		# experimental - Apple HFS+ (read-only)
+
+# File system options
+#options 	QUOTA		# legacy UFS quotas
+#options 	QUOTA2		# new, in-filesystem UFS quotas
+#options 	FFS_EI		# FFS Endian Independent support
+options 	WAPBL		# File system journaling support
+#options 	UFS_DIRHASH	# UFS Large Directory Hashing - Experimental
+#options 	NFSSERVER
+#options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
+#options 	EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
+# immutable) behave as system flags.
+
+# Networking options
+
+#options 	GATEWAY		# packet forwarding
+options 	INET		# IP + ICMP + TCP + UDP
+options 	INET6		# IPV6
+#options 	IPSEC		# IP security
+#options 	IPSEC_DEBUG	# debug for IP security
+#options 	MROUTING	# IP multicast routing
+#options 	PIM		# Protocol Independent Multicast
+#options 	NETATALK	# AppleTalk networking
+#options 	PPP_BSDCOMP	# BSD-Compress compression support for PPP
+#options 	PPP_DEFLATE	# Deflate compression support for PPP
+#options 	PPP_FILTER	# Active filter support for PPP (requires bpf)
+#options 	TCP_DEBUG	# Record last TCP_NDEBUG packets with SO_DEBUG
+
+options 	NFS_BOOT_BOOTP
+options 	NFS_BOOT_DHCP
+#options 	NFS_BOOT_BOOTPARAM
+
+# Compatibility options
+
+options		COMPAT_NETBSD32	# allow running arm (e.g. non-earm) binaries
+#options 	COMPAT_09	# NetBSD 0.9,
+#options 	COMPAT_10	# NetBSD 1.0,
+#options 	COMPAT_11	# NetBSD 1.1,
+#options 	COMPAT_12	# NetBSD 1.2,
+#options 	COMPAT_13	# NetBSD 1.3,
+#options 	COMPAT_14	# NetBSD 1.4,
+#options 	COMPAT_15	# NetBSD 1.5,
+#options 	COMPAT_16	# NetBSD 1.6,
+#options 	COMPAT_20	# NetBSD 2.0,
+options 	COMPAT_30	# NetBSD 3.0,
+options 	COMPAT_40	# NetBSD 4.0,
+options 	COMPAT_50	# NetBSD 5.0,
+options 	COMPAT_60	# NetBSD 6.0, and
+options 	COMPAT_70	# NetBSD 7.0 binary compatibility.
+#options 	COMPAT_43	# 4.3BSD compatibility.
+#options 	TCP_COMPAT_42	# 4.2BSD TCP/IP bug compat. Not recommended.
+
+options 	COMPAT_OSSAUDIO	# OSS (Voxware) audio driver compatibility
+options 	COMPAT_LINUX	# binary compatibility with Linux
+options 	COMPAT_BSDPTY	# /dev/[pt]ty?? ptys.
+
+# Shared memory options
+
+#options 	SYSVMSG		# System V-like message queues
+#options 	SYSVSEM		# System V-like semaphores
+#options 	SYSVSHM		# System V-like memory sharing
+
+# Device options
+
+#options 	MEMORY_DISK_HOOKS	# boottime s

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

2016-10-15 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Oct 15 15:27:18 UTC 2016

Modified Files:
src/sys/arch/evbarm/gumstix: gumstix_machdep.c gumstix_start.S gxio.c

Log Message:
Support Duovero and Pepper.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/evbarm/gumstix/gumstix_machdep.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/evbarm/gumstix/gumstix_start.S
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/evbarm/gumstix/gxio.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/gumstix/gumstix_machdep.c
diff -u src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.51 src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.52
--- src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.51	Thu Mar 31 14:33:17 2016
+++ src/sys/arch/evbarm/gumstix/gumstix_machdep.c	Sat Oct 15 15:27:18 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstix_machdep.c,v 1.51 2016/03/31 14:33:17 kiyohara Exp $ */
+/*	$NetBSD: gumstix_machdep.c,v 1.52 2016/10/15 15:27:18 kiyohara Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007  WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -137,16 +137,21 @@
  * boards using RedBoot firmware.
  */
 
-#include "opt_evbarm_boardtype.h"
+#include "opt_com.h"
 #include "opt_cputypes.h"
+#include "opt_evbarm_boardtype.h"
 #include "opt_gumstix.h"
-#ifdef OVERO
+#include "opt_kgdb.h"
+#include "opt_multiprocessor.h"
+#include "opt_pmap_debug.h"
+#if defined(OVERO) || defined(DUOVERO) || defined(PEPPER)
 #include "opt_omap.h"
+
+#if defined(DUOVERO)
+#include "arml2cc.h"
+#endif
 #include "prcm.h"
 #endif
-#include "opt_kgdb.h"
-#include "opt_pmap_debug.h"
-#include "opt_com.h"
 
 #include 
 #include 
@@ -159,22 +164,35 @@
 #include 
 #include 
 #include 
+#include 
+
+#include 
 
 #include 
 
-#include 
+#include 	/* don't reorder */
+
+#include 		/* don't reorder */
 #include 
 #include 
 
 #include 
-#ifdef OVERO
-#include 
+#if NARML2CC > 0
+#include 
+#endif
+#include 
 #include 
+#include 
+#include 
+#include 
 #include 
-#include 
+#if defined(OVERO) || defined(DUOVERO) || defined(PEPPER)
+#include 		/* Must required "opt_omap.h" */
+#endif
+#include 
 #include 
 #include 
-#endif
+#include 
 #include 
 #include 
 #include 
@@ -207,8 +225,9 @@ uint32_t system_serial_low;
 /* Prototypes */
 #if defined(GUMSTIX)
 static void	read_system_serial(void);
-#elif defined(OVERO)
-static void	overo_reset(void);
+#endif
+#if defined(OMAP2)
+static void	omap_reset(void);
 static void	find_cpu_clock(void);
 #endif
 static void	process_kernel_args(int, char *[]);
@@ -226,7 +245,7 @@ bs_protos(bs_notimpl);
 #include 
 #endif
 
-#if defined(CPU_XSCALE_PXA250) || defined(CPU_XSCALE_PXA270)
+#if defined(CPU_XSCALE)
 #include "lcd.h"
 #endif
 
@@ -244,7 +263,11 @@ int comcnmode = CONMODE;
 static char console[16];
 #endif
 
-extern void gxio_config_pin(void);
+const struct tifb_panel_info *tifb_panel_info = NULL;
+/* Use TPS65217 White LED Driver */
+bool use_tps65217_wled = false;
+
+extern void gxio_config(void);
 extern void gxio_config_expansion(char *);
 
 
@@ -335,20 +358,27 @@ static const struct pmap_devmap gumstix_
 		PTE_NOCACHE,
 	},
 #elif defined(OVERO)
-	{
+	{	/* SCM, PRCM */
 		OVERO_L4_CORE_VBASE,
 		_A(OMAP3530_L4_CORE_BASE),
 		_S(L1_S_SIZE),		/* No need 16MB.  Use only first 1MB */
 		VM_PROT_READ | VM_PROT_WRITE,
 		PTE_NOCACHE
 	},
-	{
+	{	/* Console, GPIO[2-6] */
 		OVERO_L4_PERIPHERAL_VBASE,
 		_A(OMAP3530_L4_PERIPHERAL_BASE),
 		_S(OMAP3530_L4_PERIPHERAL_SIZE),
 		VM_PROT_READ | VM_PROT_WRITE,
 		PTE_NOCACHE
 	},
+	{	/* GPIO1 */
+		OVERO_L4_WAKEUP_VBASE,
+		_A(OMAP3530_L4_WAKEUP_BASE),
+		_S(OMAP3530_L4_WAKEUP_SIZE),
+		VM_PROT_READ | VM_PROT_WRITE,
+		PTE_NOCACHE
+	},
 	{
 		OVERO_GPMC_VBASE,
 		_A(GPMC_BASE),
@@ -356,6 +386,52 @@ static const struct pmap_devmap gumstix_
 		VM_PROT_READ | VM_PROT_WRITE,
 		PTE_NOCACHE
 	},
+#elif defined(DUOVERO)
+	{
+		DUOVERO_L4_CM_VBASE,
+		_A(OMAP4430_L4_CORE_BASE + 0x10),
+		_S(L1_S_SIZE),
+		VM_PROT_READ | VM_PROT_WRITE,
+		PTE_NOCACHE
+	},
+	{	/* Console, SCU, L2CC, GPIO[2-6] */
+		DUOVERO_L4_PERIPHERAL_VBASE,
+		_A(OMAP4430_L4_PERIPHERAL_BASE),
+		_S(L1_S_SIZE * 3),
+		VM_PROT_READ | VM_PROT_WRITE,
+		PTE_NOCACHE
+	},
+	{	/* PRCM, GPIO1 */
+		DUOVERO_L4_WAKEUP_VBASE,
+		_A(OMAP4430_L4_WAKEUP_BASE),
+		_S(OMAP4430_L4_WAKEUP_SIZE),
+		VM_PROT_READ | VM_PROT_WRITE,
+		PTE_NOCACHE
+	},
+	{
+		DUOVERO_GPMC_VBASE,
+		_A(GPMC_BASE),
+		_S(GPMC_SIZE),
+		VM_PROT_READ | VM_PROT_WRITE,
+		PTE_NOCACHE
+	},
+#elif defined(PEPPER)
+	{
+		/* CM, Control Module, GPIO0, Console */
+		PEPPER_PRCM_VBASE,
+		_A(OMAP2_CM_BASE),
+		_S(L1_S_SIZE),
+		VM_PROT_READ | VM_PROT_WRITE,
+		PTE_NOCACHE
+	},
+	{
+		/* GPIO[1-3] */
+		PEPPER_L4_PERIPHERAL_VBASE,
+		_A(TI_AM335X_L4_PERIPHERAL_BASE),
+		_S(L1_S_SIZE),
+		VM_PROT_READ | VM_PROT_WRITE,
+		PTE_NOCACHE
+	},
 #endif
 	{ 0, 0, 0, 0, 0 }
 };
@@ -400,16 +476,22 @@ initarm(void *arg)
 	 * Overo:
 	 

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

2016-10-15 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Oct 15 15:24:00 UTC 2016

Modified Files:
src/sys/arch/evbarm/conf: VTC100

Log Message:
s/at mainbus0/at mainbus?/.  And indent.


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

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/conf/VTC100
diff -u src/sys/arch/evbarm/conf/VTC100:1.7 src/sys/arch/evbarm/conf/VTC100:1.8
--- src/sys/arch/evbarm/conf/VTC100:1.7	Thu Aug  4 06:54:47 2016
+++ src/sys/arch/evbarm/conf/VTC100	Sat Oct 15 15:24:00 2016
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: VTC100,v 1.7 2016/08/04 06:54:47 kiyohara Exp $
+#	$NetBSD: VTC100,v 1.8 2016/10/15 15:24:00 kiyohara Exp $
 #
 #	VTC100 -- NEXCOM VTC100 Kernel
 #
@@ -268,8 +268,8 @@ cpsw*		at obio2 addr 0x4a10 size 0x8
 atphy*		at mii? phy ?		# Attansic/Atheros PHYs
 
 # On-board USB. Experimental
-tiotg* 	at mainbus0 base 0x4740 size 0x5000 intrbase 17
-motg*	at tiotg? port ?
+tiotg*		at mainbus? base 0x4740 size 0x5000 intrbase 17
+motg*		at tiotg? port ?
 usb*		at motg?
 uhub*		at usb?
 uhub*		at uhub? port ?
@@ -277,12 +277,12 @@ uhub*		at uhub? port ?
 uhidev* 	at uhub?
 
 # USB Keyboards
-ukbd*	at uhidev? reportid ?
-wskbd*	at ukbd? console ? mux 1
+ukbd*		at uhidev? reportid ?
+wskbd*		at ukbd? console ? mux 1
 
 # USB Mice
-ums*	at uhidev? reportid ?
-wsmouse* at ums? mux 0
+ums*		at uhidev? reportid ?
+wsmouse*	at ums? mux 0
 
 umass*		at uhub? port ? configuration ? interface ?
 wd*		at umass?



CVS commit: src/sys/arch/arm/omap

2016-10-15 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Oct 15 15:14:20 UTC 2016

Modified Files:
src/sys/arch/arm/omap: omap2_obio.c

Log Message:
Attach icu before attaching gpio.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/arm/omap/omap2_obio.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/arm/omap/omap2_obio.c
diff -u src/sys/arch/arm/omap/omap2_obio.c:1.23 src/sys/arch/arm/omap/omap2_obio.c:1.24
--- src/sys/arch/arm/omap/omap2_obio.c:1.23	Mon Apr 25 13:17:16 2016
+++ src/sys/arch/arm/omap/omap2_obio.c	Sat Oct 15 15:14:20 2016
@@ -1,7 +1,7 @@
-/*	$Id: omap2_obio.c,v 1.23 2016/04/25 13:17:16 kiyohara Exp $	*/
+/*	$Id: omap2_obio.c,v 1.24 2016/10/15 15:14:20 kiyohara Exp $	*/
 
 /* adapted from: */
-/*	$NetBSD: omap2_obio.c,v 1.23 2016/04/25 13:17:16 kiyohara Exp $ */
+/*	$NetBSD: omap2_obio.c,v 1.24 2016/10/15 15:14:20 kiyohara Exp $ */
 
 
 /*
@@ -103,7 +103,7 @@
 
 #include "opt_omap.h"
 #include 
-__KERNEL_RCSID(0, "$NetBSD: omap2_obio.c,v 1.23 2016/04/25 13:17:16 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap2_obio.c,v 1.24 2016/10/15 15:14:20 kiyohara Exp $");
 
 #include "locators.h"
 #include "obio.h"
@@ -378,6 +378,9 @@ static const struct {
 #if defined(OMAP_3530)
 	{ .name = "avic",.addr = INTC_BASE_3530, .required = true },
 #endif
+#if defined(TI_AM335X)
+	{ .name = "omapicu", .addr = 0x4820, .required = true },
+#endif
 	{ .name = "gpio1", .addr = GPIO1_BASE, .required = false },
 	{ .name = "gpio2", .addr = GPIO2_BASE, .required = false },
 	{ .name = "gpio3", .addr = GPIO3_BASE, .required = false },
@@ -400,7 +403,6 @@ static const struct {
 	{ .name = "dmac", .addr = DMAC_BASE, .required = true },
 #endif
 #if defined(TI_AM335X)
-	{ .name = "omapicu", .addr = 0x4820, .required = true },
 	{ .name = "prcm", .addr = 0x44e0, .required = true },
 	{ .name = "sitaracm", .addr = 0x44e1, .required = true },
 	{ .name = "edma", .addr = 0x4900, .required = false },



CVS commit: src/sys/arch/arm/omap

2016-10-15 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Oct 15 15:11:56 UTC 2016

Modified Files:
src/sys/arch/arm/omap: files.omap2 omap2_gpio.c

Log Message:
Support TI_AM335X gpio to omap2_gpio.c.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/arm/omap/files.omap2
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/omap/omap2_gpio.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/arm/omap/files.omap2
diff -u src/sys/arch/arm/omap/files.omap2:1.35 src/sys/arch/arm/omap/files.omap2:1.36
--- src/sys/arch/arm/omap/files.omap2:1.35	Tue Oct  4 16:10:34 2016
+++ src/sys/arch/arm/omap/files.omap2	Sat Oct 15 15:11:56 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: files.omap2,v 1.35 2016/10/04 16:10:34 kiyohara Exp $
+#	$NetBSD: files.omap2,v 1.36 2016/10/15 15:11:56 kiyohara Exp $
 #
 # Configuration info for Texas Instruments OMAP2/OMAP3 CPU support
 # Based on xscale/files.pxa2x0
@@ -59,8 +59,7 @@ file	arch/arm/omap/omap2430_intr.c		omap
 # OMAP2 GPIO controllers
 device	omapgpio: gpiobus
 attach	omapgpio at obio with omap2gpio
-file	arch/arm/omap/omap2_gpio.c		(omap2 | omap3) & !ti_am335x & omapgpio
-file	arch/arm/omap/am335x_gpio.c		ti_am335x & omapgpio
+file	arch/arm/omap/omap2_gpio.c		(omap2 | omap3) & omapgpio
 
 # TI_AM335X (and maybe TI OMAP4) I2C controllers
 device	tiiic: i2cbus, i2cexec

Index: src/sys/arch/arm/omap/omap2_gpio.c
diff -u src/sys/arch/arm/omap/omap2_gpio.c:1.18 src/sys/arch/arm/omap/omap2_gpio.c:1.19
--- src/sys/arch/arm/omap/omap2_gpio.c:1.18	Mon Jul 11 14:53:05 2016
+++ src/sys/arch/arm/omap/omap2_gpio.c	Sat Oct 15 15:11:56 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: omap2_gpio.c,v 1.18 2016/07/11 14:53:05 kiyohara Exp $	*/
+/*	$NetBSD: omap2_gpio.c,v 1.19 2016/10/15 15:11:56 kiyohara Exp $	*/
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -28,7 +28,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: omap2_gpio.c,v 1.18 2016/07/11 14:53:05 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap2_gpio.c,v 1.19 2016/10/15 15:11:56 kiyohara Exp $");
 
 #define _INTR_PRIVATE
 
@@ -50,9 +50,13 @@ __KERNEL_RCSID(0, "$NetBSD: omap2_gpio.c
 
 #include 
 
+#include 
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 #include 
 
 #if NGPIO > 0
@@ -60,6 +64,13 @@ __KERNEL_RCSID(0, "$NetBSD: omap2_gpio.c
 #include 
 #endif
 
+static const struct omap_module gpio_module[] = {
+	{ 0, 0 },
+	{ AM335X_PRCM_CM_PER, CM_PER_GPIO1_CLKCTRL },
+	{ AM335X_PRCM_CM_PER, CM_PER_GPIO2_CLKCTRL },
+	{ AM335X_PRCM_CM_PER, CM_PER_GPIO3_CLKCTRL },
+};
+
 static void gpio_pic_block_irqs(struct pic_softc *, size_t, uint32_t);
 static void gpio_pic_block_irqs2(struct pic_softc *, size_t, uint32_t);
 static void gpio_pic_unblock_irqs(struct pic_softc *, size_t, uint32_t);
@@ -318,16 +329,11 @@ omap2gpio_pin_write(void *arg, int pin, 
 {
 	struct gpio_softc * const gpio = arg;
 	uint32_t mask = 1 << pin;
-	uint32_t old, new;
 
-	old = GPIO_READ(gpio, GPIO_DATAOUT);
 	if (value)
-		new = old | mask;
+		GPIO_WRITE(gpio, GPIO_SETDATAOUT, mask);
 	else
-		new = old & ~mask;
-
-	if (old != new)
-		GPIO_WRITE(gpio, GPIO_DATAOUT, new);
+		GPIO_WRITE(gpio, GPIO_CLEARDATAOUT, mask);
 }
 
 static void
@@ -524,6 +530,23 @@ gpio_attach(device_t parent, device_t se
 		aprint_normal(", intr %d", oa->obio_intr);
 	}
 	aprint_normal("\n");
+
+#ifdef TI_AM335X
+	switch (oa->obio_addr) {
+	case GPIO0_BASE_TI_AM335X:
+		break;
+	case GPIO1_BASE_TI_AM335X:
+		prcm_module_enable(&gpio_module[1]);
+		break;
+	case GPIO2_BASE_TI_AM335X:
+		prcm_module_enable(&gpio_module[2]);
+		break;
+	case GPIO3_BASE_TI_AM335X:
+		prcm_module_enable(&gpio_module[3]);
+		break;
+	}
+#endif
+
 #if NGPIO > 0
 #if 0
 	config_interrupts(self, gpio_attach1);



CVS commit: src/sys/arch/arm/omap

2016-10-15 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Oct 15 15:08:59 UTC 2016

Modified Files:
src/sys/arch/arm/omap: ti_iic.c ti_iicreg.h

Log Message:
Fix broken settings for AM335X's I2C[12].


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/omap/ti_iic.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/omap/ti_iicreg.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/arm/omap/ti_iic.c
diff -u src/sys/arch/arm/omap/ti_iic.c:1.8 src/sys/arch/arm/omap/ti_iic.c:1.9
--- src/sys/arch/arm/omap/ti_iic.c:1.8	Sat Oct 15 15:00:12 2016
+++ src/sys/arch/arm/omap/ti_iic.c	Sat Oct 15 15:08:59 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: ti_iic.c,v 1.8 2016/10/15 15:00:12 kiyohara Exp $ */
+/* $NetBSD: ti_iic.c,v 1.9 2016/10/15 15:08:59 kiyohara Exp $ */
 
 /*
  * Copyright (c) 2013 Manuel Bouyer.  All rights reserved.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ti_iic.c,v 1.8 2016/10/15 15:00:12 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ti_iic.c,v 1.9 2016/10/15 15:08:59 kiyohara Exp $");
 
 #include "opt_omap.h"
 #include "locators.h"
@@ -163,7 +163,7 @@ struct am335x_iic {
 static const struct am335x_iic am335x_iic[] = {
 	{ "I2C0", OMAP2_I2C0_BASE, 70, { AM335X_PRCM_CM_WKUP, 0xb8 } },
 	{ "I2C1", OMAP2_I2C1_BASE, 71, { AM335X_PRCM_CM_PER, 0x48 } },
-	{ "I2C2", OMAP2_I2C1_BASE, 30, { AM335X_PRCM_CM_PER, 0x44 } },
+	{ "I2C2", OMAP2_I2C2_BASE, 30, { AM335X_PRCM_CM_PER, 0x44 } },
 };
 #endif
 
@@ -199,6 +199,7 @@ ti_iic_attach(device_t parent, device_t 
 {
 	struct ti_iic_softc *sc = device_private(self);
 	struct obio_attach_args *obio = opaque;
+	int scheme, major, minor, fifodepth, fifo;
 	uint16_t rev;
 #ifdef TI_AM335X
 	int i;
@@ -219,8 +220,6 @@ ti_iic_attach(device_t parent, device_t 
 	sc->sc_ic.ic_release_bus = ti_iic_release_bus;
 	sc->sc_ic.ic_exec = ti_iic_exec;
 
-	sc->sc_rxthres = sc->sc_txthres = 4;
-
 	if (bus_space_map(obio->obio_iot, obio->obio_addr, obio->obio_size,
 	0, &sc->sc_ioh) != 0) {
 		aprint_error(": couldn't map address space\n");
@@ -248,27 +247,40 @@ ti_iic_attach(device_t parent, device_t 
 	snprintf(buf, sizeof(buf), "%s_SDA", am335x_iic[i].as_name);
 	if (sitara_cm_padconf_get(buf, &mode, &state) == 0) {
 		aprint_debug(": SDA mode %s state %d ", mode, state);
-	}
-	if (sitara_cm_padconf_set(buf, buf,
-	(0x01 << 4) | (0x01 << 5) | (0x01 << 6)) != 0) {
-		aprint_error(": can't switch %s pad\n", buf);
-		return;
+
+		if (sitara_cm_padconf_set(buf, buf,
+		(0x01 << 4) | (0x01 << 5) | (0x01 << 6)) != 0) {
+			aprint_error(": can't switch %s pad\n", buf);
+			return;
+		}
 	}
 	snprintf(buf, sizeof(buf), "%s_SCL", am335x_iic[i].as_name);
 	if (sitara_cm_padconf_get(buf, &mode, &state) == 0) {
 		aprint_debug(": SCL mode %s state %d ", mode, state);
-	}
-	if (sitara_cm_padconf_set(buf, buf,
-	(0x01 << 4) | (0x01 << 5) | (0x01 << 6)) != 0) {
-		aprint_error(": can't switch %s pad\n", buf);
-		return;
+
+		if (sitara_cm_padconf_set(buf, buf,
+		(0x01 << 4) | (0x01 << 5) | (0x01 << 6)) != 0) {
+			aprint_error(": can't switch %s pad\n", buf);
+			return;
+		}
 	}
 #endif
 
+	scheme = I2C_REVNB_HI_SCHEME(I2C_READ_REG(sc, OMAP2_I2C_REVNB_HI));
 	rev = I2C_READ_REG(sc, OMAP2_I2C_REVNB_LO);
-	aprint_normal(": rev %d.%d\n",
-	(int)I2C_REVNB_LO_MAJOR(rev),
-	(int)I2C_REVNB_LO_MINOR(rev));
+	if (scheme == 0) {
+		major = I2C_REV_SCHEME_0_MAJOR(rev);
+		minor = I2C_REV_SCHEME_0_MINOR(rev);
+	} else {
+		major = I2C_REVNB_LO_MAJOR(rev);
+		minor = I2C_REVNB_LO_MINOR(rev);
+	}
+	aprint_normal(": rev %d.%d, scheme %d\n", major, minor, scheme);
+
+	fifodepth = I2C_BUFSTAT_FIFODEPTH(I2C_READ_REG(sc, OMAP2_I2C_BUFSTAT));
+	fifo = OMAP2_I2C_FIFOBYTES(fifodepth);
+	aprint_normal_dev(self, "%d-bytes FIFO\n", fifo);
+	sc->sc_rxthres = sc->sc_txthres = fifo >> 1;
 
 	ti_iic_reset(sc);
 	ti_iic_flush(sc);
@@ -310,9 +322,9 @@ ti_iic_intr(void *arg)
 	mutex_enter(&sc->sc_mtx);
 	DPRINTF(("ti_iic_intr\n"));
 	stat = I2C_READ_REG(sc, OMAP2_I2C_IRQSTATUS);
-	I2C_WRITE_REG(sc, OMAP2_I2C_IRQSTATUS, stat);
 	DPRINTF(("ti_iic_intr pre handle sc->sc_op eq %#x\n", sc->sc_op));
 	ti_iic_handle_intr(sc, stat);
+	I2C_WRITE_REG(sc, OMAP2_I2C_IRQSTATUS, stat);
 	if (sc->sc_op == TI_I2CERROR || sc->sc_op == TI_I2CDONE) {
 		DPRINTF(("ti_iic_intr post handle sc->sc_op %#x\n", sc->sc_op));
 		cv_signal(&sc->sc_cv);
@@ -418,7 +430,7 @@ ti_iic_reset(struct ti_iic_softc *sc)
 		aprint_error_dev(sc->sc_dev, ": couldn't reset module\n");
 		return 1;
 	}
-			
+
 
 	/* XXX standard speed only */
 	psc = 3;
@@ -451,7 +463,7 @@ ti_iic_op(struct ti_iic_softc *sc, i2c_a
 	int err, retry;
 
 	KASSERT(op == TI_I2CREAD || op == TI_I2CWRITE);
-	DPRINTF(("ti_iic_op: addr %#x op %#x buf %p buflen %#x flags %#x\n", 
+	DPRINTF(("ti_iic_op: addr %#x op %#x buf %p buflen %#x flags %#x\n",
 	addr, op, buf, (unsigned int) buflen, flags));
 
 	mask = I2C_IRQSTATUS_A

CVS commit: src/sys/arch/arm/omap

2016-10-15 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Oct 15 15:00:13 UTC 2016

Modified Files:
src/sys/arch/arm/omap: ti_iic.c

Log Message:
Add support OMAP_4430.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/omap/ti_iic.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/arm/omap/ti_iic.c
diff -u src/sys/arch/arm/omap/ti_iic.c:1.7 src/sys/arch/arm/omap/ti_iic.c:1.8
--- src/sys/arch/arm/omap/ti_iic.c:1.7	Wed Mar 26 11:59:05 2014
+++ src/sys/arch/arm/omap/ti_iic.c	Sat Oct 15 15:00:12 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: ti_iic.c,v 1.7 2014/03/26 11:59:05 ozaki-r Exp $ */
+/* $NetBSD: ti_iic.c,v 1.8 2016/10/15 15:00:12 kiyohara Exp $ */
 
 /*
  * Copyright (c) 2013 Manuel Bouyer.  All rights reserved.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ti_iic.c,v 1.7 2014/03/26 11:59:05 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ti_iic.c,v 1.8 2016/10/15 15:00:12 kiyohara Exp $");
 
 #include "opt_omap.h"
 #include "locators.h"
@@ -183,6 +183,13 @@ ti_iic_match(device_t parent, cfdata_t m
 	obio->obio_addr == OMAP2_I2C2_BASE)
 		return 1;
 #endif
+#if defined(OMAP_4430)
+	if (obio->obio_addr == 0x4807 ||	/* I2C1 */
+	obio->obio_addr == 0x48072000 ||	/* I2C2 */
+	obio->obio_addr == 0x4806 ||	/* I2C3 */
+	obio->obio_addr == 0x4835)	/* I2C4 */
+		return 1;
+#endif
 
 	return 0;
 }



CVS commit: src/sys/dev/i2c

2016-10-15 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Oct 15 14:40:41 UTC 2016

Modified Files:
src/sys/dev/i2c: tps65217pmic.c

Log Message:
Add White LED initialize function.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/i2c/tps65217pmic.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/dev/i2c/tps65217pmic.c
diff -u src/sys/dev/i2c/tps65217pmic.c:1.10 src/sys/dev/i2c/tps65217pmic.c:1.11
--- src/sys/dev/i2c/tps65217pmic.c:1.10	Sun Jul 20 23:01:22 2014
+++ src/sys/dev/i2c/tps65217pmic.c	Sat Oct 15 14:40:41 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: tps65217pmic.c,v 1.10 2014/07/20 23:01:22 bouyer Exp $ */
+/*	$NetBSD: tps65217pmic.c,v 1.11 2016/10/15 14:40:41 kiyohara Exp $ */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tps65217pmic.c,v 1.10 2014/07/20 23:01:22 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tps65217pmic.c,v 1.11 2016/10/15 14:40:41 kiyohara Exp $");
 
 #include 
 #include 
@@ -154,6 +154,8 @@ static void tps65217pmic_envsys_refresh(
 static void tps65217pmic_power_monitor_init(struct tps65217pmic_softc *);
 static void tps65217pmic_power_monitor(void *);
 
+static void tps65217pmic_wled_init(struct tps65217pmic_softc *, int, int, int);
+
 CFATTACH_DECL_NEW(tps65217pmic, sizeof (struct tps65217pmic_softc),
 tps65217pmic_match, tps65217pmic_attach, NULL, NULL);
 
@@ -291,11 +293,20 @@ tps65217pmic_attach(device_t parent, dev
 {
 	struct tps65217pmic_softc *sc = device_private(self);
 	struct i2c_attach_args *ia = aux;
+	prop_dictionary_t dict;
+	int isel, fdim, brightness;
 
 	sc->sc_dev = self;
 	sc->sc_addr = ia->ia_addr;
 	sc->sc_tag = ia->ia_tag;
 
+	dict = device_properties(self);
+	if (prop_dictionary_get_int32(dict, "isel", &isel)) {
+		prop_dictionary_get_int32(dict, "fdim", &fdim);
+		prop_dictionary_get_int32(dict, "brightness", &brightness);
+	} else
+		isel = -1;
+
 	tps65217pmic_version(sc);
 
 	aprint_normal(": TPS65217");
@@ -333,6 +344,9 @@ tps65217pmic_attach(device_t parent, dev
 
 	tps65217pmic_power_monitor_init(sc);
 
+	if (isel != -1)
+		tps65217pmic_wled_init(sc, isel, fdim, brightness);
+
 	tps65217pmic_envsys_register(sc);
 }
 
@@ -409,6 +423,55 @@ tps65217pmic_power_monitor(void *aux)
 }
 
 static void
+tps65217pmic_wled_init(struct tps65217pmic_softc *sc, int isel, int fdim,
+		   int brightness)
+{
+	uint8_t val = 0;
+
+	switch (isel) {
+	case 1:
+	case 2:
+		val |= ((isel - 1) << TPS65217PMIC_WLEDCTRL1_ISEL);
+		break;
+	default:
+		aprint_error_dev(sc->sc_dev,
+		"WLED ISET selection is 1 or 2: isel %d\n", isel);
+		return;
+	}
+	switch (fdim) {
+	case 100:
+		val |= TPS65217PMIC_WLEDCTRL1_FDIM_100Hz;
+		break;
+	case 200:
+		val |= TPS65217PMIC_WLEDCTRL1_FDIM_200Hz;
+		break;
+	case 500:
+		val |= TPS65217PMIC_WLEDCTRL1_FDIM_500Hz;
+		break;
+	case 1000:
+		val |= TPS65217PMIC_WLEDCTRL1_FDIM_1000Hz;
+		break;
+	default:
+		aprint_error_dev(sc->sc_dev,
+		"WLED PWM dimming frequency is 100, 200, 500 or 1000:"
+		" fdim %d\n", fdim);
+		return;
+	}
+	if (brightness > 100 ||
+	brightness < 0) {
+		aprint_error_dev(sc->sc_dev,
+		"invalid brightness: between 0 and 100: %d\n", brightness);
+		return;
+	}
+
+	tps65217pmic_reg_write(sc, TPS65217PMIC_WLEDCTRL1, val);
+	tps65217pmic_reg_write(sc, TPS65217PMIC_WLEDCTRL2,
+	(brightness - 1) & TPS65217PMIC_WLEDCTRL2_DUTY);
+	val |= TPS65217PMIC_WLEDCTRL1_ISINK_EN;
+	tps65217pmic_reg_write(sc, TPS65217PMIC_WLEDCTRL1, val);
+}
+
+static void
 tps65217pmic_reg_refresh(struct tps65217pmic_softc *sc)
 {
 	int i;



CVS commit: src/sys/dev/marvell

2016-10-10 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Mon Oct 10 14:23:35 UTC 2016

Modified Files:
src/sys/dev/marvell: if_mvxpe.c

Log Message:
The bus_dmamap_sync(PREREAD) is unnecessary for sent mbuf.
Moreover bus_dmamap_sync(POSTWRITE), before unload.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/marvell/if_mvxpe.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/dev/marvell/if_mvxpe.c
diff -u src/sys/dev/marvell/if_mvxpe.c:1.13 src/sys/dev/marvell/if_mvxpe.c:1.14
--- src/sys/dev/marvell/if_mvxpe.c:1.13	Fri Jun 10 13:27:14 2016
+++ src/sys/dev/marvell/if_mvxpe.c	Mon Oct 10 14:23:35 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mvxpe.c,v 1.13 2016/06/10 13:27:14 ozaki-r Exp $	*/
+/*	$NetBSD: if_mvxpe.c,v 1.14 2016/10/10 14:23:35 kiyohara Exp $	*/
 /*
  * Copyright (c) 2015 Internet Initiative Japan Inc.
  * All rights reserved.
@@ -25,7 +25,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_mvxpe.c,v 1.13 2016/06/10 13:27:14 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mvxpe.c,v 1.14 2016/10/10 14:23:35 kiyohara Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -1141,6 +1141,7 @@ mvxpe_ring_flush_queue(struct mvxpe_soft
 {
 	struct mvxpe_rx_ring *rx = MVXPE_RX_RING(sc, q);
 	struct mvxpe_tx_ring *tx = MVXPE_TX_RING(sc, q);
+	struct mbuf *m;
 	int i;
 
 	KASSERT_RX_MTX(sc, q);
@@ -1157,11 +1158,15 @@ mvxpe_ring_flush_queue(struct mvxpe_soft
 
 	/* Tx handle */
 	for (i = 0; i < MVXPE_TX_RING_CNT; i++) {
-		if (MVXPE_TX_MBUF(sc, q, i) == NULL)
+		m = MVXPE_TX_MBUF(sc, q, i);
+		if (m == NULL)
 			continue;
-		bus_dmamap_unload(sc->sc_dmat, MVXPE_TX_MAP(sc, q, i));
-		m_freem(MVXPE_TX_MBUF(sc, q, i));
 		MVXPE_TX_MBUF(sc, q, i) = NULL;
+		bus_dmamap_sync(sc->sc_dmat,
+		MVXPE_TX_MAP(sc, q, i), 0, m->m_pkthdr.len,
+		BUS_DMASYNC_POSTWRITE);
+		bus_dmamap_unload(sc->sc_dmat, MVXPE_TX_MAP(sc, q, i));
+		m_freem(m);
 	}
 	tx->tx_dma = tx->tx_cpu = 0;
	tx->tx_used = 0;
@@ -2141,7 +2146,7 @@ mvxpe_tx_queue(struct mvxpe_softc *sc, s
 	MVXPE_TX_MBUF(sc, q, tx->tx_cpu) = m;
 	bus_dmamap_sync(sc->sc_dmat,
 	MVXPE_TX_MAP(sc, q, tx->tx_cpu), 0, m->m_pkthdr.len,
-	BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
+	BUS_DMASYNC_PREWRITE);
 
 	/* load to tx descriptors */
 	start = tx->tx_cpu;
@@ -2302,6 +2307,7 @@ mvxpe_tx_queue_complete(struct mvxpe_sof
 {
 	struct mvxpe_tx_ring *tx = MVXPE_TX_RING(sc, q);
 	struct mvxpe_tx_desc *t;
+	struct mbuf *m;
 	uint32_t ptxs, ptxsu, ndesc;
 	int i;
 
@@ -2342,12 +2348,16 @@ mvxpe_tx_queue_complete(struct mvxpe_sof
 			}
 			error = 1;
 		}
-		if (MVXPE_TX_MBUF(sc, q, tx->tx_dma) != NULL) {
+		m = MVXPE_TX_MBUF(sc, q, tx->tx_dma);
+		if (m != NULL) {
 			KASSERT((t->command & MVXPE_TX_CMD_F) != 0);
+			MVXPE_TX_MBUF(sc, q, tx->tx_dma) = NULL;
+			bus_dmamap_sync(sc->sc_dmat,
+			MVXPE_TX_MAP(sc, q, tx->tx_dma), 0, m->m_pkthdr.len,
+			BUS_DMASYNC_POSTWRITE);
 			bus_dmamap_unload(sc->sc_dmat,
 			MVXPE_TX_MAP(sc, q, tx->tx_dma));
-			m_freem(MVXPE_TX_MBUF(sc, q, tx->tx_dma));
-			MVXPE_TX_MBUF(sc, q, tx->tx_dma) = NULL;
+			m_freem(m);
 			sc->sc_tx_pending--;
 		}
 		else



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

2016-10-05 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Wed Oct  5 13:25:25 UTC 2016

Modified Files:
src/sys/arch/evbarm/conf: BEAGLEBOARDXM

Log Message:
Comment-out don't matched sdhc.  omap's sdhc not support TI_DM37XX now. However 
Overo FireSTORM(DM3730) work fine with OVERO(OMAP_3530 only).


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/evbarm/conf/BEAGLEBOARDXM

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/conf/BEAGLEBOARDXM
diff -u src/sys/arch/evbarm/conf/BEAGLEBOARDXM:1.21 src/sys/arch/evbarm/conf/BEAGLEBOARDXM:1.22
--- src/sys/arch/evbarm/conf/BEAGLEBOARDXM:1.21	Fri Jun 24 12:22:09 2016
+++ src/sys/arch/evbarm/conf/BEAGLEBOARDXM	Wed Oct  5 13:25:25 2016
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: BEAGLEBOARDXM,v 1.21 2016/06/24 12:22:09 skrll Exp $
+#	$NetBSD: BEAGLEBOARDXM,v 1.22 2016/10/05 13:25:25 kiyohara Exp $
 #
 #	BEAGLEBOARD -- TI OMAP 3530 Eval Board Kernel
 #
@@ -176,11 +176,11 @@ obio2		at mainbus? base 0x4900 size 
 gpmc0		at mainbus? base 0x6e00
 
 # SDHC controllers
-sdhc0		at obio0 addr 0x4809C000 size 0x0400 intr 83
+#sdhc0		at obio0 addr 0x4809C000 size 0x0400 intr 83
 #sdhc1		at obio0 addr 0x480B4000 size 0x0400 intr 86
 #sdhc2		at obio0 addr 0x480AD000 size 0x0400 intr 94
-sdmmc*		at sdhc?		# SD/MMC bus
-ld*		at sdmmc?
+#sdmmc*		at sdhc?		# SD/MMC bus
+#ld*		at sdmmc?
 
 # Interrupt Controller
 omapicu0	at obio0 addr 0x4820 size 0x1000 intrbase 0



CVS commit: src/sys/arch/arm/omap

2016-10-05 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Wed Oct  5 13:12:08 UTC 2016

Modified Files:
src/sys/arch/arm/omap: omap3_sdhc.c

Log Message:
Fix rejected patch.
  Support am335x's MMCHS2(sdhc@mainbus).
Tested on Gumstix Pepper 43C.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/arm/omap/omap3_sdhc.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/arm/omap/omap3_sdhc.c
diff -u src/sys/arch/arm/omap/omap3_sdhc.c:1.26 src/sys/arch/arm/omap/omap3_sdhc.c:1.27
--- src/sys/arch/arm/omap/omap3_sdhc.c:1.26	Tue Oct  4 16:06:42 2016
+++ src/sys/arch/arm/omap/omap3_sdhc.c	Wed Oct  5 13:12:08 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: omap3_sdhc.c,v 1.26 2016/10/04 16:06:42 kiyohara Exp $	*/
+/*	$NetBSD: omap3_sdhc.c,v 1.27 2016/10/05 13:12:08 kiyohara Exp $	*/
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: omap3_sdhc.c,v 1.26 2016/10/04 16:06:42 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap3_sdhc.c,v 1.27 2016/10/05 13:12:08 kiyohara Exp $");
 
 #include "opt_omap.h"
 #include "edma.h"
@@ -483,32 +483,36 @@ no_dma:
 		delay(1);
 	}
 	if (timo == 0)
-		aprint_error_dev(self, "Soft reset timeout\n");
+		aprint_error_dev(dev, "Soft reset timeout\n");
 	bus_space_write_4(sc->sc_bst, sc->sc_bsh, MMCHS_SYSCONFIG,
-	SYSCONFIG_ENAWAKEUP | SYSCONFIG_AUTOIDLE | SYSCONFIG_SIDLEMODE_AUTO |
-	SYSCONFIG_CLOCKACTIVITY_FCLK | SYSCONFIG_CLOCKACTIVITY_ICLK);
+	SYSCONFIG_ENAWAKEUP |
+	SYSCONFIG_AUTOIDLE |
+	SYSCONFIG_SIDLEMODE_AUTO |
+	SYSCONFIG_CLOCKACTIVITY_FCLK |
+	SYSCONFIG_CLOCKACTIVITY_ICLK);
 
-	sc->sc_ih = intr_establish(oa->obio_intr, IPL_VM, IST_LEVEL,
+	sc->sc_ih = intr_establish(sc->sc_irq, IPL_VM, IST_LEVEL,
 	sdhc_intr, &sc->sc);
 	if (sc->sc_ih == NULL) {
-		aprint_error_dev(self, "failed to establish interrupt %d\n",
-		 oa->obio_intr);
-		goto fail;
+		aprint_error_dev(dev, "failed to establish interrupt %d\n",
+		 sc->sc_irq);
+		return;
 	}
 
 	error = sdhc_host_found(&sc->sc, sc->sc_bst, sc->sc_sdhc_bsh,
-	oa->obio_size - OMAP3_SDMMC_SDHC_OFFSET);
+	OMAP3_SDMMC_SDHC_SIZE);
 	if (error != 0) {
-		aprint_error_dev(self, "couldn't initialize host, error=%d\n",
+		aprint_error_dev(dev, "couldn't initialize host, error=%d\n",
 		error);
-		goto fail;
+		intr_disestablish(sc->sc_ih);
+		return;
 	}
 
+	clksft = ffs(sc->sc.sc_clkmsk) - 1;
+
 	/* Set SDVS 1.8v and DTW 1bit mode */
 	SDHC_WRITE(sc, SDHC_HOST_CTL,
 	SDHC_VOLTAGE_1_8V << (SDHC_VOLTAGE_SHIFT + 8));
-	bus_space_write_4(sc->sc_bst, sc->sc_bsh, MMCHS_CON,
-	bus_space_read_4(sc->sc_bst, sc->sc_bsh, MMCHS_CON) | CON_OD);
 	SDHC_WRITE(sc, SDHC_CLOCK_CTL,
 	SDHC_READ(sc, SDHC_CLOCK_CTL) | SDHC_INTCLK_ENABLE |
 			SDHC_SDCLK_ENABLE);



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

2016-10-04 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Oct  4 16:22:43 UTC 2016

Modified Files:
src/sys/arch/evbarm/conf: OVERO

Log Message:
Enable com2, sdhc1.
And add flash@nand@omapnand.
And smsh's locator use "cs" instead of "addr".


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/evbarm/conf/OVERO

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/conf/OVERO
diff -u src/sys/arch/evbarm/conf/OVERO:1.44 src/sys/arch/evbarm/conf/OVERO:1.45
--- src/sys/arch/evbarm/conf/OVERO:1.44	Thu Aug  4 07:02:39 2016
+++ src/sys/arch/evbarm/conf/OVERO	Tue Oct  4 16:22:43 2016
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: OVERO,v 1.44 2016/08/04 07:02:39 kiyohara Exp $
+#	$NetBSD: OVERO,v 1.45 2016/10/04 16:22:43 kiyohara Exp $
 #
 #	OVERO -- Gumstix. Inc. Overo COMS platforms kernel
 #
@@ -205,6 +205,7 @@ tps65950pm3	at iic0 addr 0x4b
 com0		at obio2 addr 0x4902 intr 74 mult 4	# UART3 (console)
 options CONSADDR=0x4902, CONSPEED=115200
 #com1		at obio0 addr 0x4806c000 intr 73 mult 4	# UART2 (bluetooth)
+com2		at obio0 addr 0x4806a000 intr 72 mult 4	# UART1 (Gallop's GPS)
 
 # Operating System Timer
 omapmputmr0	at obio2 addr 0x49032000 intr 38		# GP Timer 2
@@ -226,11 +227,27 @@ prcm*		at obio1 addr 0x48306000 size 0x2
 
 # SDHC controllers
 sdhc0		at obio0 addr 0x4809c000 size 0x1000 intr 83
-#sdhc1		at obio0 addr 0x480b4000 size 0x1000 intr 86 # Wifi
+sdhc1		at obio0 addr 0x480b4000 size 0x1000 intr 86 # Wifi
 
 sdmmc*		at sdhc?	# SD/MMC bus
 ld*		at sdmmc?
 
+# NAND controller
+omapnand0	at gpmc? cs 0
+
+# NAND layer
+nand0		at nandbus?
+
+# use the bad block table
+options NAND_BBT
+
+# Define flash partitions for board
+flash0		at nand0 offset 0x00 size 0x08 readonly 1 # SPL
+flash1		at nand0 offset 0x08 size 0x1c readonly 1 # U-Boot
+flash2		at nand0 offset 0x24 size 0x04 readonly 1 # Environment
+flash3		at nand0 offset 0x28 size 0x80		# Kernel
+flash4		at nand0 offset 0xa8 size 0			# Filesystem
+
 # Hardware clocking and power management
 
 options		HWCLOCK
@@ -240,8 +257,8 @@ options		OMAP_CK_REF_SPEED=1200
 # overo expansion boards
 
 # SMSC LAN9221
-smsh0		at gpmc? addr 0x0100 intr 272	# Tobi, Chestnut43
-smsh1		at gpmc? addr 0x0200 intr 161	# Tobi-Duo
+smsh0		at gpmc? cs 5 intr 272			# Tobi, Chestnut43
+smsh1		at gpmc? cs 4 intr 161			# Tobi-Duo
 
 # MII/PHY support
 ukphy*		at mii? phy ?# smsh(4) internal PHY
@@ -336,7 +353,7 @@ options 	RND_COM
 pseudo-device	clockctl		# user control of clock subsystem
 pseudo-device	ksyms			# /dev/ksyms
 #pseudo-device	btuart			# Bluetooth HCI UART (H4)
-	# connect CSR module
+	# CSR or WiLink 8 module
 
 # a pseudo device needed for Coda	# also needs CODA (above)
 #pseudo-device	vcoda			# coda minicache <-> venus comm.



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

2016-10-04 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Oct  4 16:18:38 UTC 2016

Modified Files:
src/sys/arch/evbarm/conf: mk.gumstix

Log Message:
Add KERNEL_BASE_PHYS for duovero and pepper.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbarm/conf/mk.gumstix

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/conf/mk.gumstix
diff -u src/sys/arch/evbarm/conf/mk.gumstix:1.5 src/sys/arch/evbarm/conf/mk.gumstix:1.6
--- src/sys/arch/evbarm/conf/mk.gumstix:1.5	Tue Apr 19 12:02:55 2016
+++ src/sys/arch/evbarm/conf/mk.gumstix	Tue Oct  4 16:18:38 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: mk.gumstix,v 1.5 2016/04/19 12:02:55 kiyohara Exp $
+#	$NetBSD: mk.gumstix,v 1.6 2016/10/04 16:18:38 kiyohara Exp $
 
 SYSTEM_FIRST_OBJ=	gumstix_start.o
 SYSTEM_FIRST_SFILE=	${THISARM}/gumstix/gumstix_start.S
@@ -9,6 +9,10 @@ _OSRELEASE!=${HOST_SH} $S/co
 KERNEL_BASE_PHYS=0xa020
 .elif ${BOARDTYPE} == "overo"
 KERNEL_BASE_PHYS=$(LOADADDRESS)
+.elif ${BOARDTYPE} == "duovero"
+KERNEL_BASE_PHYS=$(LOADADDRESS)
+.elif ${BOARDTYPE} == "pepper"
+KERNEL_BASE_PHYS=$(LOADADDRESS)
 .endif
 KERNEL_BASE_VIRT=$(LOADADDRESS)
 



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

2016-10-04 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Oct  4 16:17:37 UTC 2016

Modified Files:
src/sys/arch/evbarm/conf: std.overo

Log Message:
Enable TPIDRPRW_IS_CURCPU.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbarm/conf/std.overo

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/conf/std.overo
diff -u src/sys/arch/evbarm/conf/std.overo:1.7 src/sys/arch/evbarm/conf/std.overo:1.8
--- src/sys/arch/evbarm/conf/std.overo:1.7	Thu Aug  4 07:02:39 2016
+++ src/sys/arch/evbarm/conf/std.overo	Tue Oct  4 16:17:37 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: std.overo,v 1.7 2016/08/04 07:02:39 kiyohara Exp $
+#	$NetBSD: std.overo,v 1.8 2016/10/04 16:17:37 kiyohara Exp $
 #
 # standard NetBSD/evbarm for OVERO options
 
@@ -9,7 +9,7 @@ include		"arch/evbarm/conf/files.overo"
 
 options 	CORTEX_PMC
 options 	__HAVE_FAST_SOFTINTS		# should be in types.h
-#options 	TPIDRPRW_IS_CURLWP
+options 	TPIDRPRW_IS_CURCPU
 
 options 	KERNEL_BASE_EXT=0x8000
 makeoptions	LOADADDRESS="0x8020"



CVS commit: src/sys/arch/arm/omap

2016-10-04 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Oct  4 16:10:34 UTC 2016

Modified Files:
src/sys/arch/arm/omap: files.omap2

Log Message:
Support am335x's MMCHS2(sdhc@mainbus).
  Tested on Gumstix Pepper 43C.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/arm/omap/files.omap2

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/arm/omap/files.omap2
diff -u src/sys/arch/arm/omap/files.omap2:1.34 src/sys/arch/arm/omap/files.omap2:1.35
--- src/sys/arch/arm/omap/files.omap2:1.34	Tue Oct  4 15:23:40 2016
+++ src/sys/arch/arm/omap/files.omap2	Tue Oct  4 16:10:34 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: files.omap2,v 1.34 2016/10/04 15:23:40 kiyohara Exp $
+#	$NetBSD: files.omap2,v 1.35 2016/10/04 16:10:34 kiyohara Exp $
 #
 # Configuration info for Texas Instruments OMAP2/OMAP3 CPU support
 # Based on xscale/files.pxa2x0
@@ -134,8 +134,9 @@ file	arch/arm/omap/tiotg.c			tiotg
 attach  motg at tiotg_port
 
 # SDMMC controller
+attach	sdhc at mainbus with mainbussdhc
 attach	sdhc at obio with obiosdhc
-file	arch/arm/omap/omap3_sdhc.c		obiosdhc
+file	arch/arm/omap/omap3_sdhc.c		mainbussdhc | obiosdhc
 
 # NAND flash controller
 device	omapnand: nandbus



CVS commit: src/sys/arch/arm/omap

2016-10-04 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Oct  4 16:06:42 UTC 2016

Modified Files:
src/sys/arch/arm/omap: omap3_sdhc.c

Log Message:
Support am335x's MMCHS2(sdhc@mainbus).
  Tested on Gumstix Pepper 43C.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/arm/omap/omap3_sdhc.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/arm/omap/omap3_sdhc.c
diff -u src/sys/arch/arm/omap/omap3_sdhc.c:1.25 src/sys/arch/arm/omap/omap3_sdhc.c:1.26
--- src/sys/arch/arm/omap/omap3_sdhc.c:1.25	Tue Oct  4 15:51:34 2016
+++ src/sys/arch/arm/omap/omap3_sdhc.c	Tue Oct  4 16:06:42 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: omap3_sdhc.c,v 1.25 2016/10/04 15:51:34 kiyohara Exp $	*/
+/*	$NetBSD: omap3_sdhc.c,v 1.26 2016/10/04 16:06:42 kiyohara Exp $	*/
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: omap3_sdhc.c,v 1.25 2016/10/04 15:51:34 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap3_sdhc.c,v 1.26 2016/10/04 16:06:42 kiyohara Exp $");
 
 #include "opt_omap.h"
 #include "edma.h"
@@ -37,6 +37,7 @@ __KERNEL_RCSID(0, "$NetBSD: omap3_sdhc.c
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -49,8 +50,10 @@ __KERNEL_RCSID(0, "$NetBSD: omap3_sdhc.c
 #include 
 
 #ifdef TI_AM335X
+#  include 
 #  include 
 #  include 
+#  include 
 #  include 
 #  include 
 #endif
@@ -82,25 +85,19 @@ int om3sdhcdebug = 1;
 #define SDHC_WRITE(sc, reg, val) \
 	bus_space_write_4((sc)->sc_bst, (sc)->sc_sdhc_bsh, (reg), (val))
 
-static int obiosdhc_match(device_t, cfdata_t, void *);
-static void obiosdhc_attach(device_t, device_t, void *);
-static int obiosdhc_detach(device_t, int);
-
-static int obiosdhc_bus_width(struct sdhc_softc *, int);
-static int obiosdhc_rod(struct sdhc_softc *, int);
-static int obiosdhc_write_protect(struct sdhc_softc *);
-static int obiosdhc_card_detect(struct sdhc_softc *);
-
-struct obiosdhc_softc {
+struct mmchs_softc {
 	struct sdhc_softc	sc;
+	bus_addr_t		sc_addr;
 	bus_space_tag_t		sc_bst;
 	bus_space_handle_t	sc_bsh;
 	bus_space_handle_t	sc_hl_bsh;
 	bus_space_handle_t	sc_sdhc_bsh;
 	struct sdhc_host	*sc_hosts[1];
+	int			sc_irq;
 	void 			*sc_ih;		/* interrupt vectoring */
 
 #if NEDMA > 0
+	int			sc_edmabase;
 	struct edma_channel	*sc_edma_tx;
 	struct edma_channel	*sc_edma_rx;
 	uint16_t		sc_edma_param_tx[EDMA_MAX_PARAMS];
@@ -114,26 +111,45 @@ struct obiosdhc_softc {
 #endif
 };
 
+static int obiosdhc_match(device_t, cfdata_t, void *);
+static void obiosdhc_attach(device_t, device_t, void *);
+#ifdef TI_AM335X
+static int mainbussdhc_match(device_t, cfdata_t, void *);
+static void mainbussdhc_attach(device_t, device_t, void *);
+#endif
+static int mmchs_detach(device_t, int);
+
+static int mmchs_attach(struct mmchs_softc *);
+static void mmchs_init(device_t);
+
+static int mmchs_bus_width(struct sdhc_softc *, int);
+static int mmchs_rod(struct sdhc_softc *, int);
+static int mmchs_write_protect(struct sdhc_softc *);
+static int mmchs_card_detect(struct sdhc_softc *);
+
 #if NEDMA > 0
-static int obiosdhc_edma_init(struct obiosdhc_softc *, unsigned int);
-static int obiosdhc_edma_xfer_data(struct sdhc_softc *, struct sdmmc_command *);
-static void obiosdhc_edma_done(void *);
-static int obiosdhc_edma_transfer(struct sdhc_softc *, struct sdmmc_command *);
+static int mmchs_edma_init(struct mmchs_softc *, unsigned int);
+static int mmchs_edma_xfer_data(struct sdhc_softc *, struct sdmmc_command *);
+static void mmchs_edma_done(void *);
+static int mmchs_edma_transfer(struct sdhc_softc *, struct sdmmc_command *);
 #endif
 
 #ifdef TI_AM335X
-struct am335x_sdhc {
+struct am335x_mmchs {
 	const char *as_name;
+	const char *as_parent_name;
 	bus_addr_t as_base_addr;
 	int as_intr;
 	struct omap_module as_module;
 };
 
-static const struct am335x_sdhc am335x_sdhc[] = {
-	/* XXX All offset by 0x100 because of the am335x's mmc registers.  */
-	{ "MMCHS0", SDMMC1_BASE_TIAM335X, 64, { AM335X_PRCM_CM_PER, 0x3c } },
-	{ "MMC1",   SDMMC2_BASE_TIAM335X, 28, { AM335X_PRCM_CM_PER, 0xf4 } },
-	{ "MMCHS2", SDMMC3_BASE_TIAM335X, 29, { AM335X_PRCM_CM_WKUP, 0xf8 } },
+static const struct am335x_mmchs am335x_mmchs[] = {
+	{ "MMCHS0", "obio",
+	SDMMC1_BASE_TIAM335X, 64, { AM335X_PRCM_CM_PER, 0x3c } },
+	{ "MMC1",   "obio",
+	SDMMC2_BASE_TIAM335X, 28, { AM335X_PRCM_CM_PER, 0xf4 } },
+	{ "MMCHS2", "mainbus",
+	SDMMC3_BASE_TIAM335X, 29, { AM335X_PRCM_CM_PER, 0xf8 } },
 };
 
 struct am335x_padconf {
@@ -155,17 +171,14 @@ const struct am335x_padconf am335x_padco
 };
 #endif
 
-CFATTACH_DECL_NEW(obiosdhc, sizeof(struct obiosdhc_softc),
-obiosdhc_match, obiosdhc_attach, obiosdhc_detach, NULL);
+CFATTACH_DECL_NEW(obiosdhc, sizeof(struct mmchs_softc),
+obiosdhc_match, obiosdhc_attach, mmchs_detach, NULL);
 
 static int
 obiosdhc_match(device_t parent, cfdata

CVS commit: src/sys/arch/arm/omap

2016-10-04 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Oct  4 16:03:39 UTC 2016

Modified Files:
src/sys/arch/arm/omap: omap2_reg.h sitara_cm.c sitara_cmreg.h

Log Message:
Print am335x ID and fetures.  Also add omap_{chip,dev}id().


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/arm/omap/omap2_reg.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/omap/sitara_cm.c \
src/sys/arch/arm/omap/sitara_cmreg.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/arm/omap/omap2_reg.h
diff -u src/sys/arch/arm/omap/omap2_reg.h:1.33 src/sys/arch/arm/omap/omap2_reg.h:1.34
--- src/sys/arch/arm/omap/omap2_reg.h:1.33	Mon Jul 11 14:51:11 2016
+++ src/sys/arch/arm/omap/omap2_reg.h	Tue Oct  4 16:03:39 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: omap2_reg.h,v 1.33 2016/07/11 14:51:11 kiyohara Exp $ */
+/* $NetBSD: omap2_reg.h,v 1.34 2016/10/04 16:03:39 kiyohara Exp $ */
 
 /*
  * Copyright (c) 2007 Microsoft
@@ -163,6 +163,18 @@
 #define DEVID_AMDM37X_ES11	0x1b89102f
 #define DEVID_AMDM37X_ES12	0x2b89102f
 
+#define CHIPID_AM3351		0x00fc0302
+#define CHIPID_AM3352		0x00fc0382
+#define CHIPID_AM3354		0x20fc0382
+#define CHIPID_AM3356		0x00fd0383
+#define CHIPID_AM3357		0x00ff0383
+#define CHIPID_AM3358		0x20fd0383
+#define CHIPID_AM3359		0x20ff0383
+
+#define DEVID_AM335X_SR_10	0x0b94402e
+#define DEVID_AM335X_SR_20	0x1b94402e
+#define DEVID_AM335X_SR_21	0x2b94402e
+
 /*
  * Clock Management registers base, offsets, and size
  */

Index: src/sys/arch/arm/omap/sitara_cm.c
diff -u src/sys/arch/arm/omap/sitara_cm.c:1.2 src/sys/arch/arm/omap/sitara_cm.c:1.3
--- src/sys/arch/arm/omap/sitara_cm.c:1.2	Sat Oct 18 08:33:24 2014
+++ src/sys/arch/arm/omap/sitara_cm.c	Tue Oct  4 16:03:39 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: sitara_cm.c,v 1.2 2014/10/18 08:33:24 snj Exp $ */
+/* $NetBSD: sitara_cm.c,v 1.3 2016/10/04 16:03:39 kiyohara Exp $ */
 /*
  * Copyright (c) 2010
  *	Ben Gray .
@@ -47,7 +47,7 @@
  *
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sitara_cm.c,v 1.2 2014/10/18 08:33:24 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sitara_cm.c,v 1.3 2016/10/04 16:03:39 kiyohara Exp $");
 
 #include "opt_omap.h"
 
@@ -60,13 +60,17 @@ __KERNEL_RCSID(0, "$NetBSD: sitara_cm.c,
 #include 
 
 #include 
+#include 
 #include 
 #include 
 
 struct sitara_cm_softc {
-device_tsc_dev;
-	bus_space_tag_t sc_iot;
-	bus_space_handle_t  sc_ioh;
+	device_t		sc_dev;
+	bus_space_tag_t		sc_iot;
+	bus_space_handle_t	sc_ioh;
+
+	uint32_t		sc_cid;	/* Chip Identification */
+	uint32_t		sc_did;	/* Device IDCODE */
 };
 
 
@@ -391,6 +395,15 @@ sitara_cm_attach(device_t parent, device
 	struct sitara_cm_softc *sc = device_private(self);
 	struct obio_attach_args *obio = opaque;
 	uint32_t rev;
+	char cid, buf[256];
+	const char *did;
+	const char *fmt = "\177\020"
+	"b\0ICSS\0"
+	"b\1CPSW\0"
+	"b\7DCAN\0"
+	"f\16\1ICSS_FEA EtherCAT functionality\0=\0disabled\0=\1enabled\0"
+	"f\17\1ICSS_FEA TX_AUTO_SEQUENCE\0=\0disabled\0=\1enabled\0"
+	"b\29SGX\0";
 
 	aprint_naive("\n");
 
@@ -412,4 +425,60 @@ sitara_cm_attach(device_t parent, device
 		panic("sitara_cm_attach: read revision");
 	aprint_normal(": control module, rev %d.%d\n",
 	SCM_REVISION_MAJOR(rev), SCM_REVISION_MINOR(rev));
+
+	sitara_cm_reg_read_4(OMAP2SCM_DEVID, &sc->sc_did);
+	sitara_cm_reg_read_4(OMAP2SCM_DEV_FEATURE, &sc->sc_cid);
+	switch (sc->sc_cid) {
+	case CHIPID_AM3351:	cid = '1'; break;
+	case CHIPID_AM3352:	cid = '2'; break;
+	case CHIPID_AM3354:	cid = '4'; break;
+	case CHIPID_AM3356:	cid = '6'; break;
+	case CHIPID_AM3357:	cid = '7'; break;
+	case CHIPID_AM3358:	cid = '8'; break;
+	case CHIPID_AM3359:	cid = '9'; break;
+	default:
+		aprint_normal_dev(self, "unknwon ChipID found 0x%08x\n",
+		sc->sc_cid);
+		cid = 'x';
+		break;
+	}
+	aprint_normal_dev(self, "AM335%c", cid);
+	switch (sc->sc_did) {
+	case DEVID_AM335X_SR_10:	did = "1.0"; break;
+	case DEVID_AM335X_SR_20:	did = "2.0"; break;
+	case DEVID_AM335X_SR_21:	did = "2.1"; break;
+	default:
+		aprint_normal_dev(self, "unknwon DeviceID found 0x%08x\n",
+		sc->sc_did);
+		did = NULL;
+		break;
+	}
+	if (did != NULL)
+		aprint_normal(" Silicon Revision %s", did);
+	snprintb(buf, sizeof(buf), fmt, sc->sc_cid);
+	aprint_normal(": %s\n", buf);
+}
+
+uint32_t
+omap_chipid(void)
+{
+	struct sitara_cm_softc *sc;
+	device_t dev;
+
+	dev = device_find_by_xname("sitaracm0");
+	KASSERT(dev != NULL);
+	sc = device_private(dev);
+	return sc->sc_cid;
+}
+
+uint32_t
+omap_devid(void)
+{
+	struct sitara_cm_softc *sc;
+	device_t dev;
+
+	dev = device_find_by_xname("sitaracm0");
+	KASSERT(dev != NULL);
+	sc = device_private(dev);
+	return sc->sc_did;
 }
Index: src/sys/arch/arm/omap/sitara_cmreg.h
diff -u src/sys/arch/arm/omap/sitara_cmreg.h:1.2 src/sys/arch/arm/omap/sitara_cmreg.h:1.3
--- src/sys/arch/arm/omap/sitara_cmreg.h:1.2	Wed Jul 16 18:25:24 2014
+++ src/sys/a

CVS commit: src/sys/arch/arm/omap

2016-10-04 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Oct  4 15:59:36 UTC 2016

Modified Files:
src/sys/arch/arm/omap: omap3_ehci.c

Log Message:
Support extclk.  This value get from prop-dictionary "port?-extclk".


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/omap/omap3_ehci.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/arm/omap/omap3_ehci.c
diff -u src/sys/arch/arm/omap/omap3_ehci.c:1.11 src/sys/arch/arm/omap/omap3_ehci.c:1.12
--- src/sys/arch/arm/omap/omap3_ehci.c:1.11	Sat Apr 23 10:15:28 2016
+++ src/sys/arch/arm/omap/omap3_ehci.c	Tue Oct  4 15:59:36 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: omap3_ehci.c,v 1.11 2016/04/23 10:15:28 skrll Exp $ */
+/* $NetBSD: omap3_ehci.c,v 1.12 2016/10/04 15:59:36 kiyohara Exp $ */
 
 /*-
  * Copyright (c) 2010-2012 Jared D. McNeill 
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: omap3_ehci.c,v 1.11 2016/04/23 10:15:28 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap3_ehci.c,v 1.12 2016/10/04 15:59:36 kiyohara Exp $");
 
 #include "locators.h"
 
@@ -196,6 +196,7 @@ struct omap3_ehci_softc {
 		enum omap3_ehci_port_mode mode;
 		int gpio;
 		bool value;
+		bool extclk;
 	} sc_portconfig[3];
 	struct {
 		uint16_t m, n, m2;
@@ -405,15 +406,24 @@ omap3_ehci_parse_properties(struct omap3
 	sc->sc_portconfig[0].mode = omap3_ehci_get_port_mode(prop, "port0-mode");
 	sc->sc_portconfig[0].gpio = omap3_ehci_get_port_gpio(prop, "port0-gpio");
 	prop_dictionary_get_bool(prop, "port0-gpioval", &sc->sc_portconfig[0].value);
+#if defined(OMAP4) || defined(OMAP5)
+	prop_dictionary_get_bool(prop, "port0-extclk", &sc->sc_portconfig[0].extclk);
+#endif
 	if (sc->sc_nports > 1) {
 		sc->sc_portconfig[1].mode = omap3_ehci_get_port_mode(prop, "port1-mode");
 		sc->sc_portconfig[1].gpio = omap3_ehci_get_port_gpio(prop, "port1-gpio");
 		prop_dictionary_get_bool(prop, "port1-gpioval", &sc->sc_portconfig[1].value);
+#if defined(OMAP4) || defined(OMAP5)
+		prop_dictionary_get_bool(prop, "port1-extclk", &sc->sc_portconfig[1].extclk);
+#endif
 	}
 	if (sc->sc_nports > 2) {
 		sc->sc_portconfig[2].mode = omap3_ehci_get_port_mode(prop, "port2-mode");
 		sc->sc_portconfig[2].gpio = omap3_ehci_get_port_gpio(prop, "port2-gpio");
 		prop_dictionary_get_bool(prop, "port2-gpioval", &sc->sc_portconfig[2].value);
+#if defined(OMAP4) || defined(OMAP5)
+		prop_dictionary_get_bool(prop, "port2-extclk", &sc->sc_portconfig[2].extclk);
+#endif
 	}
 
 #ifdef OMAP_3XXX
@@ -670,17 +680,43 @@ omap4_usbhost_init(struct omap3_ehci_sof
 	KASSERT(err == 0);
 
 	val = bus_space_read_4(iot, ioh, OMAP4_CM_L3INIT_USB_HOST_HS_CLKCTRL);
-	val |= OMAP4_CM_L3INIT_USB_HOST_HS_CLKCTRL_OPTFCLKEN_HSIC60M_P3_CLK
-	|  OMAP4_CM_L3INIT_USB_HOST_HS_CLKCTRL_OPTFCLKEN_HSIC60M_P2_CLK
-	|  OMAP4_CM_L3INIT_USB_HOST_HS_CLKCTRL_OPTFCLKEN_HSIC480M_P3_CLK
-	|  OMAP4_CM_L3INIT_USB_HOST_HS_CLKCTRL_OPTFCLKEN_HSIC480M_P2_CLK
-	|  OMAP4_CM_L3INIT_USB_HOST_HS_CLKCTRL_OPTFCLKEN_UTMI_P3_CLK
-	|  OMAP4_CM_L3INIT_USB_HOST_HS_CLKCTRL_OPTFCLKEN_UTMI_P2_CLK;
+	if (sc->sc_portconfig[0].mode != OMAP3_EHCI_PORT_MODE_NONE) {
+		if (sc->sc_portconfig[0].extclk)
+			val |= OMAP4_CM_L3INIT_USB_HOST_HS_CLKCTRL_CLKSEL_UTMI_P1;
+		else
+			val |= OMAP4_CM_L3INIT_USB_HOST_HS_CLKCTRL_OPTFCLKEN_UTMI_P1_CLK;
+		if (sc->sc_portconfig[0].mode == OMAP3_EHCI_PORT_MODE_HSIC)
+			val |= OMAP4_CM_L3INIT_USB_HOST_HS_CLKCTRL_OPTFCLKEN_HSIC60M_P1_CLK
+			|  OMAP4_CM_L3INIT_USB_HOST_HS_CLKCTRL_OPTFCLKEN_HSIC480M_P1_CLK;
+	}
+	if (sc->sc_nports > 1
+	&& sc->sc_portconfig[1].mode != OMAP3_EHCI_PORT_MODE_NONE) {
+		if (sc->sc_portconfig[1].extclk)
+			val |= OMAP4_CM_L3INIT_USB_HOST_HS_CLKCTRL_CLKSEL_UTMI_P2;
+		else
+			val |= OMAP4_CM_L3INIT_USB_HOST_HS_CLKCTRL_OPTFCLKEN_UTMI_P2_CLK;
+		if (sc->sc_portconfig[1].mode == OMAP3_EHCI_PORT_MODE_HSIC)
+			val |= OMAP4_CM_L3INIT_USB_HOST_HS_CLKCTRL_OPTFCLKEN_HSIC60M_P2_CLK
+			|  OMAP4_CM_L3INIT_USB_HOST_HS_CLKCTRL_OPTFCLKEN_HSIC480M_P2_CLK;
+	}
+	if (sc->sc_nports > 2
+	&& sc->sc_portconfig[2].mode != OMAP3_EHCI_PORT_MODE_NONE) {
+		val |= OMAP4_CM_L3INIT_USB_HOST_HS_CLKCTRL_OPTFCLKEN_UTMI_P3_CLK;
+		if (sc->sc_portconfig[2].mode == OMAP3_EHCI_PORT_MODE_HSIC)
+			val |= OMAP4_CM_L3INIT_USB_HOST_HS_CLKCTRL_OPTFCLKEN_HSIC60M_P3_CLK
+			|  OMAP4_CM_L3INIT_USB_HOST_HS_CLKCTRL_OPTFCLKEN_HSIC480M_P3_CLK;
+	}
 	bus_space_write_4(iot, ioh, OMAP4_CM_L3INIT_USB_HOST_HS_CLKCTRL, val);
 
 	val = bus_space_read_4(iot, ioh, OMAP4_CM_L3INIT_USB_TLL_HS_CLKCTRL);
-	val |= OMAP4_CM_L3INIT_USB_TLL_HS_CLKCTRL_USB_CH2_CLK
-	|  OMAP4_CM_L3INIT_USB_TLL_HS_CLKCTRL_USB_CH1_CLK;
+	if (sc->sc_portconfig[0].mode != OMAP3_EHCI_PORT_MODE_NONE)
+		val |= OMAP4_CM_L3INIT_USB_TLL_HS_CLKCTRL_USB_CH0_CLK;
+	if (sc->sc_nports > 1
+	&& sc->sc_portconfig[1].mode != OMAP3_EHCI_PORT_MODE_NONE)
+		val |= OMAP4_CM_L3INIT_USB_TLL_HS_CLKCTRL_USB_CH1_CLK;
+	if (sc->sc_

CVS commit: src/sys/arch/arm/omap

2016-10-04 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Oct  4 15:54:10 UTC 2016

Modified Files:
src/sys/arch/arm/omap: omap2430_intr.h

Log Message:
am335x's main interrupt source is 128.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/omap/omap2430_intr.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/arm/omap/omap2430_intr.h
diff -u src/sys/arch/arm/omap/omap2430_intr.h:1.4 src/sys/arch/arm/omap/omap2430_intr.h:1.5
--- src/sys/arch/arm/omap/omap2430_intr.h:1.4	Sat Jul 14 07:42:57 2012
+++ src/sys/arch/arm/omap/omap2430_intr.h	Tue Oct  4 15:54:09 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: omap2430_intr.h,v 1.4 2012/07/14 07:42:57 matt Exp $ */
+/*	$NetBSD: omap2430_intr.h,v 1.5 2016/10/04 15:54:09 kiyohara Exp $ */
 
 /*
  * Define the SDP2430 specific information and then include the generic OMAP
@@ -161,7 +161,11 @@ uint32_t omap_microtimer_interval(uint32
 #define	IRQ_MMC3		94	/* (3530) MMC/SD module 3 */
 #define	IRQ_GPT12_3530		95	/* (3530) GPT12 */
 
+#if defined(TI_AM335X)
+#define	PIC_MAXSOURCES		128
+#else
 #define	PIC_MAXSOURCES		96
+#endif
 #define	PIC_MAXMAXSOURCES	(PIC_MAXSOURCES+192)
 
 void omap_irq_handler(void *);



CVS commit: src/sys/arch/arm/omap

2016-10-04 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Oct  4 15:46:07 UTC 2016

Modified Files:
src/sys/arch/arm/omap: omap3_uhhreg.h

Log Message:
Fix revision value.  VERS2 is 0.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/omap/omap3_uhhreg.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/arm/omap/omap3_uhhreg.h
diff -u src/sys/arch/arm/omap/omap3_uhhreg.h:1.3 src/sys/arch/arm/omap/omap3_uhhreg.h:1.4
--- src/sys/arch/arm/omap/omap3_uhhreg.h:1.3	Sat Mar 29 23:32:41 2014
+++ src/sys/arch/arm/omap/omap3_uhhreg.h	Tue Oct  4 15:46:07 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: omap3_uhhreg.h,v 1.3 2014/03/29 23:32:41 matt Exp $ */
+/* $NetBSD: omap3_uhhreg.h,v 1.4 2016/10/04 15:46:07 kiyohara Exp $ */
 
 /*-
  * Copyright (c) 2010 Jared D. McNeill 
@@ -32,7 +32,7 @@
 #define	UHH_REVISION0x00
 #define	 UHH_REVISION_MAJOR(x)			(((x) >> 4) & 0xf)
 #define	 UHH_REVISION_MINOR(x)			((x) & 0xf)
-#define  UHH_REVISION_VERS2			2
+#define  UHH_REVISION_VERS2			0
 
 #define UHH_HWINFO0x04
 #define  UHH_HWINFO_SAR_CNTX_SIZE		 __BITS(9,0)



CVS commit: src/sys/arch/arm/omap

2016-10-04 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Oct  4 15:51:34 UTC 2016

Modified Files:
src/sys/arch/arm/omap: omap3_sdhc.c

Log Message:
Support ADMA2 on OMAP4430.
 Tested on Gumstix DuoVero.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/arm/omap/omap3_sdhc.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/arm/omap/omap3_sdhc.c
diff -u src/sys/arch/arm/omap/omap3_sdhc.c:1.24 src/sys/arch/arm/omap/omap3_sdhc.c:1.25
--- src/sys/arch/arm/omap/omap3_sdhc.c:1.24	Mon Aug 15 13:02:07 2016
+++ src/sys/arch/arm/omap/omap3_sdhc.c	Tue Oct  4 15:51:34 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: omap3_sdhc.c,v 1.24 2016/08/15 13:02:07 mlelstv Exp $	*/
+/*	$NetBSD: omap3_sdhc.c,v 1.25 2016/10/04 15:51:34 kiyohara Exp $	*/
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: omap3_sdhc.c,v 1.24 2016/08/15 13:02:07 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap3_sdhc.c,v 1.25 2016/10/04 15:51:34 kiyohara Exp $");
 
 #include "opt_omap.h"
 #include "edma.h"
@@ -259,8 +259,8 @@ obiosdhc_attach(device_t parent, device_
 	 */
 	sc->sc.sc_flags |= SDHC_FLAG_NO_HS_BIT;
 
-//	sc->sc.sc_flags |= SDHC_FLAG_USE_DMA;
-//	sc->sc.sc_flags |= SDHC_FLAG_USE_ADMA2;
+	sc->sc.sc_flags |= SDHC_FLAG_USE_DMA;
+	sc->sc.sc_flags |= SDHC_FLAG_USE_ADMA2;
 #endif
 	sc->sc.sc_host = sc->sc_hosts;
 	sc->sc.sc_clkbase = 96000;	/* 96MHZ */
@@ -480,6 +480,11 @@ no_dma:
 	SDHC_WRITE(sc, SDHC_CLOCK_CTL,
 	SDHC_READ(sc, SDHC_CLOCK_CTL) | SDHC_SDCLK_ENABLE);
 
+	if (sc->sc.sc_flags & SDHC_FLAG_USE_ADMA2)
+		bus_space_write_4(sc->sc_bst, sc->sc_bsh, MMCHS_CON,
+		bus_space_read_4(sc->sc_bst, sc->sc_bsh, MMCHS_CON) |
+		CON_MNS);
+
 	return;
 
 fail:



CVS commit: src/sys/arch/arm/omap

2016-10-04 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Oct  4 15:47:53 UTC 2016

Modified Files:
src/sys/arch/arm/omap: omap3_sdmmcreg.h

Log Message:
Add OMAP4430 MMCHS_CON macros.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/omap/omap3_sdmmcreg.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/arm/omap/omap3_sdmmcreg.h
diff -u src/sys/arch/arm/omap/omap3_sdmmcreg.h:1.9 src/sys/arch/arm/omap/omap3_sdmmcreg.h:1.10
--- src/sys/arch/arm/omap/omap3_sdmmcreg.h:1.9	Thu Aug  4 07:14:50 2016
+++ src/sys/arch/arm/omap/omap3_sdmmcreg.h	Tue Oct  4 15:47:53 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: omap3_sdmmcreg.h,v 1.9 2016/08/04 07:14:50 kiyohara Exp $	*/
+/*	$NetBSD: omap3_sdmmcreg.h,v 1.10 2016/10/04 15:47:53 kiyohara Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -92,6 +92,11 @@
 #define MMCHS_CSRE		0x024	/* Card status response error */
 #define MMCHS_SYSTEST		0x028	/* System Test */
 #define MMCHS_CON		0x02c	/* Configuration */
+#  define CON_SDMA_LNE			(1 << 21)	/*Slave DMA Lvl/Edg Rq*/
+#  define CON_MNS			(1 << 20)	/* DMA Mstr/Slv sel */
+#  define CON_DDR			(1 << 19)	/* Dual Data Rate */
+#  define CON_CF0			(1 << 18)	/*Boot status support*/
+#  define CON_BOOTACK			(1 << 17)	/*Boot acknowledge rcv*/
 #  define CON_CLKEXTFREE		(1 << 16)
 #  define CON_PADEN			(1 << 15)	/* Ctrl Pow for MMC */
 #  define CON_OBIE			(1 << 14)	/* Out-of-Band Intr */



CVS commit: src/sys/arch/arm/omap

2016-10-04 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Oct  4 15:38:31 UTC 2016

Modified Files:
src/sys/arch/arm/omap: omap2_icu.c

Log Message:
am335x's main interrupt source is 128.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/omap/omap2_icu.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/arm/omap/omap2_icu.c
diff -u src/sys/arch/arm/omap/omap2_icu.c:1.9 src/sys/arch/arm/omap/omap2_icu.c:1.10
--- src/sys/arch/arm/omap/omap2_icu.c:1.9	Mon Aug 20 12:38:28 2012
+++ src/sys/arch/arm/omap/omap2_icu.c	Tue Oct  4 15:38:31 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: omap2_icu.c,v 1.9 2012/08/20 12:38:28 matt Exp $	*/
+/*	$NetBSD: omap2_icu.c,v 1.10 2016/10/04 15:38:31 kiyohara Exp $	*/
 /*
  * Define the SDP2430 specific information and then include the generic OMAP
  * interrupt header.
@@ -30,7 +30,7 @@
 #define _INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: omap2_icu.c,v 1.9 2012/08/20 12:38:28 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap2_icu.c,v 1.10 2016/10/04 15:38:31 kiyohara Exp $");
 
 #include 
 #include 
@@ -82,11 +82,19 @@ static struct omap2icu_softc {
 	bus_space_tag_t sc_memt;
 	bus_space_handle_t sc_memh;
 	struct pic_softc sc_pic;
+#if defined(TI_AM335X)
+	uint32_t sc_enabled_irqs[4];
+#else
 	uint32_t sc_enabled_irqs[3];
+#endif
 } omap2icu_softc = {
 	.sc_pic = {
 		.pic_ops = &omap2icu_picops,
+#if defined(TI_AM335X)
+		.pic_maxsources = 128,
+#else
 		.pic_maxsources = 96,
+#endif
 		.pic_name = "omap2icu",
 	},
 };
@@ -161,7 +169,7 @@ omap_irq_handler(void *frame)
 void
 omap2icu_establish_irq(struct pic_softc *pic, struct intrsource *is)
 {
-	KASSERT(is->is_irq < 96);
+	KASSERT(is->is_irq < omap2icu_softc.sc_pic.pic_maxsources);
 	KASSERT(is->is_type == IST_LEVEL);
 }
 



CVS commit: src/sys/arch/arm/omap

2016-10-04 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Oct  4 15:32:03 UTC 2016

Modified Files:
src/sys/arch/arm/omap: omap2_nand.c

Log Message:
Remove a comment-out-ed and no-need line.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/omap/omap2_nand.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/arm/omap/omap2_nand.c
diff -u src/sys/arch/arm/omap/omap2_nand.c:1.5 src/sys/arch/arm/omap/omap2_nand.c:1.6
--- src/sys/arch/arm/omap/omap2_nand.c:1.5	Sat Oct 27 17:17:40 2012
+++ src/sys/arch/arm/omap/omap2_nand.c	Tue Oct  4 15:32:02 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: omap2_nand.c,v 1.5 2012/10/27 17:17:40 chs Exp $	*/
+/*	$NetBSD: omap2_nand.c,v 1.6 2016/10/04 15:32:02 kiyohara Exp $	*/
 
 /*-
  * Copyright (c) 2010 Department of Software Engineering,
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: omap2_nand.c,v 1.5 2012/10/27 17:17:40 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap2_nand.c,v 1.6 2016/10/04 15:32:02 kiyohara Exp $");
 
 #include "opt_omap.h"
 #include "opt_flash.h"
@@ -209,7 +209,6 @@ omap2_nand_attach(device_t parent, devic
 	sc->sc_dev = self;
 	sc->sc_cs = gpmc->gpmc_cs;
 
-//	cs_offset = GPMC_BASE + GPMC_CONFIG1_0 + sc->sc_cs * GPMC_CS_SIZE;
 	cs_offset = GPMC_CS_CONFIG_BASE(sc->sc_cs);
 
 	/* map i/o space */



CVS commit: src/sys/arch/arm/omap

2016-10-04 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Oct  4 15:23:40 UTC 2016

Modified Files:
src/sys/arch/arm/omap: files.omap2 omap2_gpmc.c

Log Message:
Support locator "cs".


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/arm/omap/files.omap2
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/omap/omap2_gpmc.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/arm/omap/files.omap2
diff -u src/sys/arch/arm/omap/files.omap2:1.33 src/sys/arch/arm/omap/files.omap2:1.34
--- src/sys/arch/arm/omap/files.omap2:1.33	Mon Jul  4 15:35:55 2016
+++ src/sys/arch/arm/omap/files.omap2	Tue Oct  4 15:23:40 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: files.omap2,v 1.33 2016/07/04 15:35:55 kiyohara Exp $
+#	$NetBSD: files.omap2,v 1.34 2016/10/04 15:23:40 kiyohara Exp $
 #
 # Configuration info for Texas Instruments OMAP2/OMAP3 CPU support
 # Based on xscale/files.pxa2x0
@@ -117,7 +117,7 @@ file	arch/arm/omap/omap2_l3i.c		omap2 | 
 # General Purpose Memory Controller
 # XXX some addl. chip select config parms may be desired here (e.g. timing)
 # XXX so far we just use the setup established by boot firmware
-device	gpmc { [addr=-1], [size=0], [intr=-1], [mult=1], [nobyteacc=0]
+device	gpmc { [cs=-1], [addr=-1], [size=0], [intr=-1], [mult=1], [nobyteacc=0]
 	  } : bus_space_generic
 attach	gpmc at mainbus
 file	arch/arm/omap/omap2_gpmc.c		gpmc

Index: src/sys/arch/arm/omap/omap2_gpmc.c
diff -u src/sys/arch/arm/omap/omap2_gpmc.c:1.9 src/sys/arch/arm/omap/omap2_gpmc.c:1.10
--- src/sys/arch/arm/omap/omap2_gpmc.c:1.9	Fri Jul  1 20:30:21 2011
+++ src/sys/arch/arm/omap/omap2_gpmc.c	Tue Oct  4 15:23:40 2016
@@ -1,7 +1,7 @@
-/*	$Id: omap2_gpmc.c,v 1.9 2011/07/01 20:30:21 dyoung Exp $	*/
+/*	$Id: omap2_gpmc.c,v 1.10 2016/10/04 15:23:40 kiyohara Exp $	*/
 
 /* adapted from: */
-/*	$NetBSD: omap2_gpmc.c,v 1.9 2011/07/01 20:30:21 dyoung Exp $ */
+/*	$NetBSD: omap2_gpmc.c,v 1.10 2016/10/04 15:23:40 kiyohara Exp $ */
 
 
 /*
@@ -102,7 +102,7 @@
 
 #include "opt_omap.h"
 #include 
-__KERNEL_RCSID(0, "$NetBSD: omap2_gpmc.c,v 1.9 2011/07/01 20:30:21 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap2_gpmc.c,v 1.10 2016/10/04 15:23:40 kiyohara Exp $");
 
 #include "locators.h"
 
@@ -278,7 +278,22 @@ gpmc_search(device_t parent, cfdata_t cf
 	aa.gpmc_intr = cf->cf_loc[GPMCCF_INTR];
 
 	cs = &sc->sc_csconfig[0];
-	for (i=0; i < GPMC_NCS; i++) {
+	for (i = 0; i < GPMC_NCS; i++) {
+		if (cf->cf_loc[GPMCCF_CS] != GPMCCF_CS_DEFAULT) {
+			if (i != cf->cf_loc[GPMCCF_CS]) {
+cs++;
+continue;
+			}
+
+			if (aa.gpmc_addr != GPMCCF_ADDR_DEFAULT
+			&&  aa.gpmc_addr != cs->cs_addr)
+panic("cs:addr missmatch:"
+" cs %d(0x%08lx), addr 0x%08lx\n",
+cf->cf_loc[GPMCCF_CS], cs->cs_addr,
+aa.gpmc_addr);
+			aa.gpmc_addr = cs->cs_addr;
+		}
+
 		if ((aa.gpmc_addr >= cs->cs_addr)
 		&&  (aa.gpmc_addr < (cs->cs_addr + cs->cs_size))) {
 			/* XXX



CVS commit: src/sys/arch/arm/cortex

2016-10-04 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Oct  4 15:18:23 UTC 2016

Modified Files:
src/sys/arch/arm/cortex: a9_mpsubr.S

Log Message:
Don't touch ACTLR on CORTEX A9, if ACTLR.SMP=1.  like Linux.
  Tested on Gumstix DuoVero(OMAP 4430).


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/arm/cortex/a9_mpsubr.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/arm/cortex/a9_mpsubr.S
diff -u src/sys/arch/arm/cortex/a9_mpsubr.S:1.46 src/sys/arch/arm/cortex/a9_mpsubr.S:1.47
--- src/sys/arch/arm/cortex/a9_mpsubr.S:1.46	Sat Dec 19 13:27:29 2015
+++ src/sys/arch/arm/cortex/a9_mpsubr.S	Tue Oct  4 15:18:23 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: a9_mpsubr.S,v 1.46 2015/12/19 13:27:29 skrll Exp $	*/
+/*	$NetBSD: a9_mpsubr.S,v 1.47 2016/10/04 15:18:23 kiyohara Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -507,10 +507,12 @@ cortex_init:
 #if defined(MULTIPROCESSOR) || defined(CPU_CORTEXA5) || defined(CPU_CORTEXA7) || defined(CPU_CORTEXA9) || defined(CPU_CORTEXA15) || defined(CPU_CORTEXA17)
 #if defined(CPU_CORTEXA5) || defined(CPU_CORTEXA7) || defined(CPU_CORTEXA9) || defined(CPU_CORTEXA15) || defined(CPU_CORTEXA17)
 	//
-	// Step 4a, set ACTLR.SMP=1
+	// Step 4a, set ACTLR.SMP=1, if ACTLR.SMP=0
+	// i.e. OMAP4430 was enabled yet.
 	//
 	mrc	p15, 0, r0, c1, c0, 1		// ACTLR read
-	orr	r0, r0, #CORTEXA9_AUXCTL_SMP	// enable SMP
+	tst	r0, #CORTEXA9_AUXCTL_SMP
+	orreq	r0, r0, #CORTEXA9_AUXCTL_SMP	// enable SMP
 
 #if defined(CPU_CORTEXA15)
 	// The A15 requires snoop-delayed exclusive handling to be set
@@ -524,16 +526,16 @@ cortex_init:
 	//
 	// Step 4a (continued on A5/A9), ACTLR.FW=1)
 	//
-	orr	r0, r0, #CORTEXA9_AUXCTL_FW	// enable cache/tlb/coherency
+	orreq	r0, r0, #CORTEXA9_AUXCTL_FW	// enable cache/tlb/coherency
 #endif	/* A5 || A9 */
 #if defined(CPU_CORTEXA9)
 	//
 	// Step 4b (continued on A9), ACTLR.L2PE=1)
 	//
-	orr	r0, r0, #CORTEXA9_AUXCTL_L2PE	// enable L2 cache prefetch
+	orreq	r0, r0, #CORTEXA9_AUXCTL_L2PE	// enable L2 cache prefetch
 #endif
 
-	mcr	p15, 0, r0, c1, c0, 1		// ACTLR write
+	mcreq	p15, 0, r0, c1, c0, 1		// ACTLR write
 	isb
 	dsb
 #endif	/* A5 || A7 || A9 || A15 || A17 */



CVS commit: src/sys/arch/arm/cortex

2016-10-04 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Oct  4 15:15:27 UTC 2016

Modified Files:
src/sys/arch/arm/cortex: scu_reg.h

Log Message:
Add SCU_SIZE.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/cortex/scu_reg.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/arm/cortex/scu_reg.h
diff -u src/sys/arch/arm/cortex/scu_reg.h:1.1 src/sys/arch/arm/cortex/scu_reg.h:1.2
--- src/sys/arch/arm/cortex/scu_reg.h:1.1	Sat Sep  1 00:03:14 2012
+++ src/sys/arch/arm/cortex/scu_reg.h	Tue Oct  4 15:15:27 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: scu_reg.h,v 1.1 2012/09/01 00:03:14 matt Exp $ */
+/* $NetBSD: scu_reg.h,v 1.2 2016/10/04 15:15:27 kiyohara Exp $ */
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -36,6 +36,8 @@
  * Used by Cortex-A5 and Cortex-A9
  */
 
+#define	SCU_SIZE		0x100
+
 #define	SCU_CTL			0x00	// SCU Control Register
 #define	SCU_CFG			0x04	// SCU Configuration Register
 #define	SCU_CPU_PWR_STS		0x08	// SCU CPU Power Status



CVS commit: src/sys/arch/arm/cortex

2016-10-04 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Oct  4 15:12:29 UTC 2016

Modified Files:
src/sys/arch/arm/cortex: a9wdt.c

Log Message:
Register sysmon_wdog.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/cortex/a9wdt.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/arm/cortex/a9wdt.c
diff -u src/sys/arch/arm/cortex/a9wdt.c:1.4 src/sys/arch/arm/cortex/a9wdt.c:1.5
--- src/sys/arch/arm/cortex/a9wdt.c:1.4	Wed Mar  4 23:18:21 2015
+++ src/sys/arch/arm/cortex/a9wdt.c	Tue Oct  4 15:12:29 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: a9wdt.c,v 1.4 2015/03/04 23:18:21 jmcneill Exp $	*/
+/*	$NetBSD: a9wdt.c,v 1.5 2016/10/04 15:12:29 kiyohara Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: a9wdt.c,v 1.4 2015/03/04 23:18:21 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: a9wdt.c,v 1.5 2016/10/04 15:12:29 kiyohara Exp $");
 
 #include 
 #include 
@@ -253,4 +253,8 @@ a9wdt_attach(device_t parent, device_t s
 			aprint_error_dev(self,
 			"failed to start kernel tickler: %d\n", error);
  	}
+
+	if (sysmon_wdog_register(&sc->sc_smw) != 0)
+		aprint_error("%s: unable to register with sysmon\n",
+		device_xname(sc->sc_dev));
 }



CVS commit: src/sys/dev/i2c

2016-10-04 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Oct  4 15:06:59 UTC 2016

Modified Files:
src/sys/dev/i2c: ds1307.c ds1307reg.h

Log Message:
Add DS1340.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/i2c/ds1307.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/i2c/ds1307reg.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/dev/i2c/ds1307.c
diff -u src/sys/dev/i2c/ds1307.c:1.22 src/sys/dev/i2c/ds1307.c:1.23
--- src/sys/dev/i2c/ds1307.c:1.22	Tue Apr  5 10:53:16 2016
+++ src/sys/dev/i2c/ds1307.c	Tue Oct  4 15:06:59 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: ds1307.c,v 1.22 2016/04/05 10:53:16 bouyer Exp $	*/
+/*	$NetBSD: ds1307.c,v 1.23 2016/10/04 15:06:59 kiyohara Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ds1307.c,v 1.22 2016/04/05 10:53:16 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ds1307.c,v 1.23 2016/10/04 15:06:59 kiyohara Exp $");
 
 #include 
 #include 
@@ -83,6 +83,13 @@ static const struct dsrtc_model dsrtc_mo
 		.dm_rtc_size = DS1339_RTC_SIZE,
 		.dm_flags = DSRTC_FLAG_BCD,
 	}, {
+		.dm_model = 1340,
+		.dm_ch_reg = DS_SECONDS,
+		.dm_ch_value = DS1340_SECONDS_EOSC,
+		.dm_rtc_start = DS1340_RTC_START,
+		.dm_rtc_size = DS1340_RTC_SIZE,
+		.dm_flags = DSRTC_FLAG_BCD,
+	}, {
 		.dm_model = 1672,
 		.dm_rtc_start = DS1672_RTC_START,
 		.dm_rtc_size = DS1672_RTC_SIZE,

Index: src/sys/dev/i2c/ds1307reg.h
diff -u src/sys/dev/i2c/ds1307reg.h:1.6 src/sys/dev/i2c/ds1307reg.h:1.7
--- src/sys/dev/i2c/ds1307reg.h:1.6	Tue Apr  5 10:53:16 2016
+++ src/sys/dev/i2c/ds1307reg.h	Tue Oct  4 15:06:59 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: ds1307reg.h,v 1.6 2016/04/05 10:53:16 bouyer Exp $	*/
+/*	$NetBSD: ds1307reg.h,v 1.7 2016/10/04 15:06:59 kiyohara Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -65,6 +65,10 @@
 #define	DS1339_NVRAM_START	0
 #define	DS1339_NVRAM_SIZE	0
 
+#define	DS1340_RTC_START	0
+#define	DS1340_RTC_SIZE		DS_RTC_SIZE
+#define	DS1340_SECONDS_EOSC		(1 << 7) /* Clock Hold */
+
 #define DS1672_CNTR1		0x00
 #define DS1672_CNTR2		0x01
 #define DS1672_CNTR3		0x02



CVS commit: src/sys/dev/marvell

2016-10-04 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Oct  4 15:02:27 UTC 2016

Modified Files:
src/sys/dev/marvell: marvellreg.h

Log Message:
Add 88AP510.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/marvell/marvellreg.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/dev/marvell/marvellreg.h
diff -u src/sys/dev/marvell/marvellreg.h:1.9 src/sys/dev/marvell/marvellreg.h:1.10
--- src/sys/dev/marvell/marvellreg.h:1.9	Wed Jun  3 04:00:06 2015
+++ src/sys/dev/marvell/marvellreg.h	Tue Oct  4 15:02:27 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: marvellreg.h,v 1.9 2015/06/03 04:00:06 hsuenaga Exp $	*/
+/*	$NetBSD: marvellreg.h,v 1.10 2016/10/04 15:02:27 kiyohara Exp $	*/
 /*
  * Copyright (c) 2009 KIYOHARA Takashi
  * All rights reserved.
@@ -59,6 +59,8 @@
 #define MARVELL_MV78XX0_MV78100		PCI_PRODUCT_MARVELL_MV78100
 #define MARVELL_MV78XX0_MV78200		PCI_PRODUCT_MARVELL_MV78200
 
+#define MARVELL_DOVE_88AP510		PCI_PRODUCT_MARVELL_88AP510
+
 #define MARVELL_ARMADAXP_MV78130	PCI_PRODUCT_MARVELL_MV78130
 #define MARVELL_ARMADAXP_MV78160	PCI_PRODUCT_MARVELL_MV78160
 #define MARVELL_ARMADAXP_MV78230	PCI_PRODUCT_MARVELL_MV78230



CVS commit: src/sys/dev/pci

2016-10-04 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Oct  4 14:55:32 UTC 2016

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add Marvell 88AP510.


To generate a diff of this commit:
cvs rdiff -u -r1.1265 -r1.1266 src/sys/dev/pci/pcidevs

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

Modified files:

Index: src/sys/dev/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1265 src/sys/dev/pci/pcidevs:1.1266
--- src/sys/dev/pci/pcidevs:1.1265	Fri Sep 16 05:42:22 2016
+++ src/sys/dev/pci/pcidevs	Tue Oct  4 14:55:32 2016
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1265 2016/09/16 05:42:22 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1266 2016/10/04 14:55:32 kiyohara Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -2322,6 +2322,7 @@ product FREESCALE P5010		0x0429	P5010
 
 /* Marvell products */
 product MARVELL GT64010A	0x0146	GT-64010A System Controller
+product MARVELL 88AP510		0x0510	88AP510
 product MARVELL 88F1181		0x1181	88F1181
 product MARVELL 88F1281		0x1281	88F1281 SoC Orion2
 product MARVELL 88W8300_1	0x1fa6	Libertas 88W8300



CVS commit: src/sys/dev/nand

2016-10-04 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Oct  4 14:47:18 UTC 2016

Modified Files:
src/sys/dev/nand: nand.c

Log Message:
Use ONFI_STATUS_WP instead of 0x80.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/nand/nand.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/dev/nand/nand.c
diff -u src/sys/dev/nand/nand.c:1.24 src/sys/dev/nand/nand.c:1.25
--- src/sys/dev/nand/nand.c:1.24	Tue Oct  4 14:43:55 2016
+++ src/sys/dev/nand/nand.c	Tue Oct  4 14:47:18 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: nand.c,v 1.24 2016/10/04 14:43:55 kiyohara Exp $	*/
+/*	$NetBSD: nand.c,v 1.25 2016/10/04 14:47:18 kiyohara Exp $	*/
 
 /*-
  * Copyright (c) 2010 Department of Software Engineering,
@@ -34,7 +34,7 @@
 /* Common driver for NAND chips implementing the ONFI 2.2 specification */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nand.c,v 1.24 2016/10/04 14:43:55 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nand.c,v 1.25 2016/10/04 14:47:18 kiyohara Exp $");
 
 #include "locators.h"
 
@@ -640,7 +640,7 @@ nand_get_status(device_t self)
 static bool
 nand_check_wp(device_t self)
 {
-	if (nand_get_status(self) & 0x80)
+	if (nand_get_status(self) & ONFI_STATUS_WP)
 		return false;
 	else
 		return true;



CVS commit: src/sys/dev/nand

2016-10-04 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Oct  4 14:43:55 UTC 2016

Modified Files:
src/sys/dev/nand: nand.c

Log Message:
Wait STATUS_RDY after ONFI_RESET.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/nand/nand.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/dev/nand/nand.c
diff -u src/sys/dev/nand/nand.c:1.23 src/sys/dev/nand/nand.c:1.24
--- src/sys/dev/nand/nand.c:1.23	Sun Oct 20 17:13:18 2013
+++ src/sys/dev/nand/nand.c	Tue Oct  4 14:43:55 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: nand.c,v 1.23 2013/10/20 17:13:18 christos Exp $	*/
+/*	$NetBSD: nand.c,v 1.24 2016/10/04 14:43:55 kiyohara Exp $	*/
 
 /*-
  * Copyright (c) 2010 Department of Software Engineering,
@@ -34,7 +34,7 @@
 /* Common driver for NAND chips implementing the ONFI 2.2 specification */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nand.c,v 1.23 2013/10/20 17:13:18 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nand.c,v 1.24 2016/10/04 14:43:55 kiyohara Exp $");
 
 #include "locators.h"
 
@@ -63,6 +63,7 @@ int nand_print(void *, const char *);
 
 static int nand_search(device_t, cfdata_t, const int *, void *);
 static void nand_address_row(device_t, size_t);
+static inline uint8_t nand_get_status(device_t);
 static void nand_address_column(device_t, size_t, size_t);
 static int nand_fill_chip_structure(device_t, struct nand_chip *);
 static int nand_scan_media(device_t, struct nand_chip *);
@@ -354,6 +355,7 @@ nand_scan_media(device_t self, struct na
 
 	nand_select(self, true);
 	nand_command(self, ONFI_RESET);
+	KASSERT(nand_get_status(self) & ONFI_STATUS_RDY);
 	nand_select(self, false);
 
 	/* check if the device implements the ONFI standard */



CVS commit: src/sys/arch/arm/omap

2016-08-05 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Fri Aug  5 14:32:36 UTC 2016

Modified Files:
src/sys/arch/arm/omap: omap3_scm.c

Log Message:
Support TI_DM37XX.  These register maps like to OMAP 34xx/35xx.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/omap/omap3_scm.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/arm/omap/omap3_scm.c
diff -u src/sys/arch/arm/omap/omap3_scm.c:1.5 src/sys/arch/arm/omap/omap3_scm.c:1.6
--- src/sys/arch/arm/omap/omap3_scm.c:1.5	Sun Jul  3 12:27:04 2016
+++ src/sys/arch/arm/omap/omap3_scm.c	Fri Aug  5 14:32:36 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: omap3_scm.c,v 1.5 2016/07/03 12:27:04 kiyohara Exp $ */
+/* $NetBSD: omap3_scm.c,v 1.6 2016/08/05 14:32:36 kiyohara Exp $ */
 
 /*-
  * Copyright (c) 2013 Jared D. McNeill 
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: omap3_scm.c,v 1.5 2016/07/03 12:27:04 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap3_scm.c,v 1.6 2016/08/05 14:32:36 kiyohara Exp $");
 
 #include "opt_omap.h"
 
@@ -51,7 +51,7 @@ __KERNEL_RCSID(0, "$NetBSD: omap3_scm.c,
 #define SCM_OFFSET_INTERFACE_3530	0
 #define SCM_OFFSET_GENERAL_3530		0x270
 
-#if defined(OMAP_3430) || defined(OMAP_3530)
+#if defined(OMAP_3430) || defined(OMAP_3530) || defined(TI_DM37XX)
 #define SCM_BASE		SCM_BASE_3530
 #define SCM_SIZE		SCM_SIZE_3530
 #define SCM_CONTROL_IDCODE	SCM_CONTROL_IDCODE_3530



CVS commit: src/sys/arch/arm/omap

2016-08-04 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Thu Aug  4 14:08:23 UTC 2016

Modified Files:
src/sys/arch/arm/omap: if_cpsw.c

Log Message:
s/for(/for (/.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arm/omap/if_cpsw.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/arm/omap/if_cpsw.c
diff -u src/sys/arch/arm/omap/if_cpsw.c:1.15 src/sys/arch/arm/omap/if_cpsw.c:1.16
--- src/sys/arch/arm/omap/if_cpsw.c:1.15	Thu Aug  4 14:05:20 2016
+++ src/sys/arch/arm/omap/if_cpsw.c	Thu Aug  4 14:08:23 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_cpsw.c,v 1.15 2016/08/04 14:05:20 kiyohara Exp $	*/
+/*	$NetBSD: if_cpsw.c,v 1.16 2016/08/04 14:08:23 kiyohara Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -53,7 +53,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: if_cpsw.c,v 1.15 2016/08/04 14:05:20 kiyohara Exp $");
+__KERNEL_RCSID(1, "$NetBSD: if_cpsw.c,v 1.16 2016/08/04 14:08:23 kiyohara Exp $");
 
 #include 
 #include 
@@ -745,7 +745,7 @@ cpsw_mii_wait(struct cpsw_softc * const 
 {
 	u_int tries;
 
-	for(tries = 0; tries < 1000; tries++) {
+	for (tries = 0; tries < 1000; tries++) {
 		if ((cpsw_read_4(sc, reg) & __BIT(31)) == 0)
 			return 0;
 		delay(1);



CVS commit: src/sys/arch/arm/omap

2016-08-04 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Thu Aug  4 14:05:20 UTC 2016

Modified Files:
src/sys/arch/arm/omap: if_cpsw.c

Log Message:
Change message for aprint_normal() "CPSW Ethernet" to "Layer 2 3-Port Switch".
Its described in Technical Reference Manual.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/omap/if_cpsw.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/arm/omap/if_cpsw.c
diff -u src/sys/arch/arm/omap/if_cpsw.c:1.14 src/sys/arch/arm/omap/if_cpsw.c:1.15
--- src/sys/arch/arm/omap/if_cpsw.c:1.14	Fri Jun 10 13:27:11 2016
+++ src/sys/arch/arm/omap/if_cpsw.c	Thu Aug  4 14:05:20 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_cpsw.c,v 1.14 2016/06/10 13:27:11 ozaki-r Exp $	*/
+/*	$NetBSD: if_cpsw.c,v 1.15 2016/08/04 14:05:20 kiyohara Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -53,7 +53,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: if_cpsw.c,v 1.14 2016/06/10 13:27:11 ozaki-r Exp $");
+__KERNEL_RCSID(1, "$NetBSD: if_cpsw.c,v 1.15 2016/08/04 14:05:20 kiyohara Exp $");
 
 #include 
 #include 
@@ -403,7 +403,7 @@ cpsw_attach(device_t parent, device_t se
 
 	sc->sc_dev = self;
 
-	aprint_normal(": TI CPSW Ethernet\n");
+	aprint_normal(": TI Layer 2 3-Port Switch\n");
 	aprint_naive("\n");
 
 	callout_init(&sc->sc_tick_ch, 0);



CVS commit: src/sys/arch/arm/omap

2016-08-04 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Thu Aug  4 07:14:50 UTC 2016

Modified Files:
src/sys/arch/arm/omap: omap3_sdhc.c omap3_sdmmcreg.h

Log Message:
Support OMAP 4430.  But ADMA2 don't working yet.
tested on Gumstix DuoVero.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/arm/omap/omap3_sdhc.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/omap/omap3_sdmmcreg.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/arm/omap/omap3_sdhc.c
diff -u src/sys/arch/arm/omap/omap3_sdhc.c:1.21 src/sys/arch/arm/omap/omap3_sdhc.c:1.22
--- src/sys/arch/arm/omap/omap3_sdhc.c:1.21	Mon Jul  4 15:45:37 2016
+++ src/sys/arch/arm/omap/omap3_sdhc.c	Thu Aug  4 07:14:50 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: omap3_sdhc.c,v 1.21 2016/07/04 15:45:37 kiyohara Exp $	*/
+/*	$NetBSD: omap3_sdhc.c,v 1.22 2016/08/04 07:14:50 kiyohara Exp $	*/
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: omap3_sdhc.c,v 1.21 2016/07/04 15:45:37 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap3_sdhc.c,v 1.22 2016/08/04 07:14:50 kiyohara Exp $");
 
 #include "opt_omap.h"
 #include "edma.h"
@@ -87,7 +87,6 @@ static void obiosdhc_attach(device_t, de
 static int obiosdhc_detach(device_t, int);
 
 static int obiosdhc_bus_width(struct sdhc_softc *, int);
-static int obiosdhc_bus_clock(struct sdhc_softc *, int);
 static int obiosdhc_rod(struct sdhc_softc *, int);
 static int obiosdhc_write_protect(struct sdhc_softc *);
 static int obiosdhc_card_detect(struct sdhc_softc *);
@@ -96,6 +95,7 @@ struct obiosdhc_softc {
 	struct sdhc_softc	sc;
 	bus_space_tag_t		sc_bst;
 	bus_space_handle_t	sc_bsh;
+	bus_space_handle_t	sc_hl_bsh;
 	bus_space_handle_t	sc_sdhc_bsh;
 	struct sdhc_host	*sc_hosts[1];
 	void 			*sc_ih;		/* interrupt vectoring */
@@ -173,19 +173,19 @@ obiosdhc_match(device_t parent, cfdata_t
 	if (oa->obio_addr == SDMMC1_BASE_3430
 	|| oa->obio_addr == SDMMC2_BASE_3430
 	|| oa->obio_addr == SDMMC3_BASE_3430)
-return 1;
+		return 1;
 #elif defined(OMAP_3530)
 	if (oa->obio_addr == SDMMC1_BASE_3530
 	|| oa->obio_addr == SDMMC2_BASE_3530
 	|| oa->obio_addr == SDMMC3_BASE_3530)
-return 1;
+		return 1;
 #elif defined(OMAP4) || defined(OMAP5)
 	if (oa->obio_addr == SDMMC1_BASE_4430
 	|| oa->obio_addr == SDMMC2_BASE_4430
 	|| oa->obio_addr == SDMMC3_BASE_4430
 	|| oa->obio_addr == SDMMC4_BASE_4430
 	|| oa->obio_addr == SDMMC5_BASE_4430)
-return 1;
+		return 1;
 #endif
 
 #ifdef TI_AM335X
@@ -195,7 +195,7 @@ obiosdhc_match(device_t parent, cfdata_t
 			return 1;
 #endif
 
-return 0;
+	return 0;
 }
 
 static void
@@ -208,6 +208,10 @@ obiosdhc_attach(device_t parent, device_
 	int error, timo, clksft, n;
 	bool support8bit = false;
 	const char *transfer_mode = "PIO";
+#if defined(OMAP4)
+	uint32_t v;
+	int x, y;
+#endif
 #ifdef TI_AM335X
 	size_t i;
 #endif
@@ -219,16 +223,44 @@ obiosdhc_attach(device_t parent, device_
 	sc->sc.sc_flags |= SDHC_FLAG_32BIT_ACCESS;
 	sc->sc.sc_flags |= SDHC_FLAG_NO_LED_ON;
 	sc->sc.sc_flags |= SDHC_FLAG_RSP136_CRC;
-	sc->sc.sc_flags |= SDHC_FLAG_SINGLE_ONLY;
 	if (support8bit)
 		sc->sc.sc_flags |= SDHC_FLAG_8BIT_MODE;
-#ifdef TI_AM335X
+#if defined(OMAP_3430)
+	sc->sc.sc_flags |= SDHC_FLAG_SINGLE_ONLY;
+#elif defined(OMAP_3530) || defined(TI_DM37XX)
+	/*
+	 * Advisory 2.1.1.128: MMC: Multiple Block Read Operation Issue
+	 * from "OMAP3530/25/15/03 Applications Processor Silicon Revisions
+	 * 3.1.2, 3.1, 3.0, 2.1, and 2.0".
+	 */
+	switch (omap_devid()) {
+	case DEVID_OMAP35X_ES10:
+	case DEVID_OMAP35X_ES20:
+	case DEVID_OMAP35X_ES21:
+	case DEVID_AMDM37X_ES10:	/*  ? */
+	case DEVID_AMDM37X_ES11:	/*  ? */
+	case DEVID_AMDM37X_ES12:	/*  ? */
+		sc->sc.sc_flags |= SDHC_FLAG_SINGLE_ONLY;
+		break;
+	default:
+		break;
+	}
+	sc->sc.sc_flags |= SDHC_FLAG_NO_HS_BIT;
+#elif defined(TI_AM335X)
 	sc->sc.sc_flags |= SDHC_FLAG_WAIT_RESET;
-	sc->sc.sc_flags &= ~SDHC_FLAG_SINGLE_ONLY;
-#endif
-#if defined(OMAP_3530)
-	if (omap_chipid() == CHIPID_OMAP3530)
-		sc->sc.sc_flags &= ~SDHC_FLAG_SINGLE_ONLY;
+#elif defined(OMAP_4430)
+	/*
+	 * MMCHS_HCTL.HSPE Is Not Functional
+	 * Errata ID: i626
+	 *
+	 * Due to design issue MMCHS_HCTL.HSPE bit does not work as intended.
+	 * This means that the configuration must always be the normal speed
+	 * mode configuration (MMCHS_HCTL.HSPE=0).
+	 */
+	sc->sc.sc_flags |= SDHC_FLAG_NO_HS_BIT;
+
+//	sc->sc.sc_flags |= SDHC_FLAG_USE_DMA;
+//	sc->sc.sc_flags |= SDHC_FLAG_USE_ADMA2;
 #endif
 	sc->sc.sc_host = sc->sc_hosts;
 	sc->sc.sc_clkbase = 96000;	/* 96MHZ */
@@ -237,7 +269,6 @@ obiosdhc_attach(device_t parent, device_
 	sc->sc.sc_vendor_rod = obiosdhc_rod;
 	sc->sc.sc_vendor_write_protect = obiosdhc_write_protect;
 	sc->sc.sc_vendor_card_detect = obiosdhc_card_detect;

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

2016-08-04 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Thu Aug  4 07:06:14 UTC 2016

Modified Files:
src/sys/arch/evbarm/conf: PANDABOARD

Log Message:
Fix address for omapgpio4.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/evbarm/conf/PANDABOARD

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/conf/PANDABOARD
diff -u src/sys/arch/evbarm/conf/PANDABOARD:1.19 src/sys/arch/evbarm/conf/PANDABOARD:1.20
--- src/sys/arch/evbarm/conf/PANDABOARD:1.19	Sat Sep 26 11:16:12 2015
+++ src/sys/arch/evbarm/conf/PANDABOARD	Thu Aug  4 07:06:14 2016
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: PANDABOARD,v 1.19 2015/09/26 11:16:12 maxv Exp $
+#	$NetBSD: PANDABOARD,v 1.20 2016/08/04 07:06:14 kiyohara Exp $
 #
 #	PANDABOARD -- TI OMAP 4430 Eval Board Kernel
 #
@@ -190,7 +190,7 @@ omapgpio0	at obio1 addr 0x4a31 size 
 omapgpio1	at obio2 addr 0x48055000 size 0x0400 intrbase 192 intr 62
 omapgpio2	at obio2 addr 0x48057000 size 0x0400 intrbase 224 intr 63
 omapgpio3	at obio2 addr 0x48059000 size 0x0400 intrbase 256 intr 64
-omapgpio4	at obio2 addr 0x4805a000 size 0x0400 intrbase 288 intr 65
+omapgpio4	at obio2 addr 0x4805b000 size 0x0400 intrbase 288 intr 65
 omapgpio5	at obio2 addr 0x4805d000 size 0x0400 intrbase 320 intr 66
 
 gpio*		at omapgpio?



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

2016-08-04 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Thu Aug  4 07:02:39 UTC 2016

Modified Files:
src/sys/arch/evbarm/conf: OVERO std.overo

Log Message:
Move BOARDTYPE and EVBARM_BOARDTYPE from std.overo to OVERO.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/evbarm/conf/OVERO
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/evbarm/conf/std.overo

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/conf/OVERO
diff -u src/sys/arch/evbarm/conf/OVERO:1.43 src/sys/arch/evbarm/conf/OVERO:1.44
--- src/sys/arch/evbarm/conf/OVERO:1.43	Sat Sep 26 11:16:12 2015
+++ src/sys/arch/evbarm/conf/OVERO	Thu Aug  4 07:02:39 2016
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: OVERO,v 1.43 2015/09/26 11:16:12 maxv Exp $
+#	$NetBSD: OVERO,v 1.44 2016/08/04 07:02:39 kiyohara Exp $
 #
 #	OVERO -- Gumstix. Inc. Overo COMS platforms kernel
 #
@@ -24,6 +24,9 @@ makeoptions	CPUFLAGS="-mcpu=cortex-a8 -m
 
 # Architecture options
 
+makeoptions	BOARDTYPE="overo"
+options 	EVBARM_BOARDTYPE=overo
+
 # Gumstix options
 options 	OVERO
 # Can specify 'expansion=' in args from u-boot.

Index: src/sys/arch/evbarm/conf/std.overo
diff -u src/sys/arch/evbarm/conf/std.overo:1.6 src/sys/arch/evbarm/conf/std.overo:1.7
--- src/sys/arch/evbarm/conf/std.overo:1.6	Fri Nov  1 18:41:06 2013
+++ src/sys/arch/evbarm/conf/std.overo	Thu Aug  4 07:02:39 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: std.overo,v 1.6 2013/11/01 18:41:06 skrll Exp $
+#	$NetBSD: std.overo,v 1.7 2016/08/04 07:02:39 kiyohara Exp $
 #
 # standard NetBSD/evbarm for OVERO options
 
@@ -13,8 +13,6 @@ options 	__HAVE_FAST_SOFTINTS		# should 
 
 options 	KERNEL_BASE_EXT=0x8000
 makeoptions	LOADADDRESS="0x8020"
-makeoptions	BOARDTYPE="overo"
-options 	EVBARM_BOARDTYPE=overo
 makeoptions	BOARDMKFRAG="${THISARM}/conf/mk.gumstix"
 
 options 	ARM_INTR_IMPL=""



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

2016-08-03 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Thu Aug  4 06:54:47 UTC 2016

Modified Files:
src/sys/arch/evbarm/conf: VTC100

Log Message:
Fix description to 'NEXCOM VTC100'.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/evbarm/conf/VTC100

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/conf/VTC100
diff -u src/sys/arch/evbarm/conf/VTC100:1.6 src/sys/arch/evbarm/conf/VTC100:1.7
--- src/sys/arch/evbarm/conf/VTC100:1.6	Thu Aug  4 06:53:10 2016
+++ src/sys/arch/evbarm/conf/VTC100	Thu Aug  4 06:54:47 2016
@@ -1,7 +1,7 @@
 #
-#	$NetBSD: VTC100,v 1.6 2016/08/04 06:53:10 kiyohara Exp $
+#	$NetBSD: VTC100,v 1.7 2016/08/04 06:54:47 kiyohara Exp $
 #
-#	BEAGLEBONE -- TI AM335x board Kernel
+#	VTC100 -- NEXCOM VTC100 Kernel
 #
 
 include	"arch/evbarm/conf/std.beagle"



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

2016-08-03 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Thu Aug  4 06:53:10 UTC 2016

Modified Files:
src/sys/arch/evbarm/conf: VTC100

Log Message:
Enable tiotg and USB devices.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbarm/conf/VTC100

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/conf/VTC100
diff -u src/sys/arch/evbarm/conf/VTC100:1.5 src/sys/arch/evbarm/conf/VTC100:1.6
--- src/sys/arch/evbarm/conf/VTC100:1.5	Thu Aug  4 06:50:27 2016
+++ src/sys/arch/evbarm/conf/VTC100	Thu Aug  4 06:53:10 2016
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: VTC100,v 1.5 2016/08/04 06:50:27 kiyohara Exp $
+#	$NetBSD: VTC100,v 1.6 2016/08/04 06:53:10 kiyohara Exp $
 #
 #	BEAGLEBONE -- TI AM335x board Kernel
 #
@@ -268,32 +268,31 @@ cpsw*		at obio2 addr 0x4a10 size 0x8
 atphy*		at mii? phy ?		# Attansic/Atheros PHYs
 
 # On-board USB. Experimental
-#tiotg* 	at mainbus0 base 0x4740 size 0x5000 intrbase 17
-#motg*	at tiotg? port ?
-#usb*		at motg?
-#uhub*		at usb?
-#uhub*		at uhub? port ?
+tiotg* 	at mainbus0 base 0x4740 size 0x5000 intrbase 17
+motg*	at tiotg? port ?
+usb*		at motg?
+uhub*		at usb?
+uhub*		at uhub? port ?
 
-#uhidev* 	at uhub?
+uhidev* 	at uhub?
 
 # USB Keyboards
-#ukbd*	at uhidev? reportid ?
-#wskbd*	at ukbd? console ? mux 1
+ukbd*	at uhidev? reportid ?
+wskbd*	at ukbd? console ? mux 1
 
 # USB Mice
-#ums*	at uhidev? reportid ?
-#wsmouse* at ums? mux 0
+ums*	at uhidev? reportid ?
+wsmouse* at ums? mux 0
 
-#umass*		at uhub? port ? configuration ? interface ?
-#wd*		at umass?
+umass*		at uhub? port ? configuration ? interface ?
+wd*		at umass?
 # SCSI bus support
-#scsibus*	at scsi?
+scsibus*	at scsi?
 # SCSI devices
-#sd*		at scsibus? target ? lun ?	# SCSI disk drives
+sd*		at scsibus? target ? lun ?	# SCSI disk drives
 
-#u3ginit*	at uhub? port ?
-#u3g*		at uhub? port ?
-#ucom*		at u3g?
+u3g*		at uhub? port ?
+ucom*		at u3g?
 
 # Pseudo-Devices
 



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

2016-08-03 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Thu Aug  4 06:50:28 UTC 2016

Modified Files:
src/sys/arch/evbarm/conf: VTC100

Log Message:
Add disabled MOTG_DEBUG and remove ?HCI_DEBUG.  Also disable USB_DEBUG.


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

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/conf/VTC100
diff -u src/sys/arch/evbarm/conf/VTC100:1.4 src/sys/arch/evbarm/conf/VTC100:1.5
--- src/sys/arch/evbarm/conf/VTC100:1.4	Thu Jul 21 09:10:55 2016
+++ src/sys/arch/evbarm/conf/VTC100	Thu Aug  4 06:50:27 2016
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: VTC100,v 1.4 2016/07/21 09:10:55 kiyohara Exp $
+#	$NetBSD: VTC100,v 1.5 2016/08/04 06:50:27 kiyohara Exp $
 #
 #	BEAGLEBONE -- TI AM335x board Kernel
 #
@@ -145,10 +145,8 @@ makeoptions	DEBUG="-g"	# compile full sy
 makeoptions	COPY_SYMTAB=1
 
 ## USB Debugging options
-options USB_DEBUG
-options EHCI_DEBUG
-options OHCI_DEBUG
-options UHUB_DEBUG
+#options 	USB_DEBUG
+#options 	MOTG_DEBUG
 
 
 # Valid options for BOOT_ARGS:



CVS commit: src/sys/arch/arm/omap

2016-08-03 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Thu Aug  4 06:44:58 UTC 2016

Modified Files:
src/sys/arch/arm/omap: tiotg.c

Log Message:
Set host-mode always.  motg(4) doesn't supports device and OTG modes.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/omap/tiotg.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/arm/omap/tiotg.c
diff -u src/sys/arch/arm/omap/tiotg.c:1.5 src/sys/arch/arm/omap/tiotg.c:1.6
--- src/sys/arch/arm/omap/tiotg.c:1.5	Mon Jul 11 14:46:33 2016
+++ src/sys/arch/arm/omap/tiotg.c	Thu Aug  4 06:44:58 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: tiotg.c,v 1.5 2016/07/11 14:46:33 kiyohara Exp $ */
+/* $NetBSD: tiotg.c,v 1.6 2016/08/04 06:44:58 kiyohara Exp $ */
 /*
  * Copyright (c) 2013 Manuel Bouyer.  All rights reserved.
  *
@@ -24,7 +24,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tiotg.c,v 1.5 2016/07/11 14:46:33 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tiotg.c,v 1.6 2016/08/04 06:44:58 kiyohara Exp $");
 
 #include "opt_omap.h"
 #include "locators.h"
@@ -335,10 +335,18 @@ ti_motg_attach(device_t parent, device_t
 	DPRINTF("now val 0x%x", val, 0, 0, 0);
 #endif
 	/* XXX configure mode */
+#if 0
 	if (sc->sc_ctrlport == 0)
 		sc->sc_motg.sc_mode = MOTG_MODE_DEVICE;
 	else
 		sc->sc_motg.sc_mode = MOTG_MODE_HOST;
+#else
+	/* X
+	 * Both ports always the host mode only.
+	 * And motg(4) doesn't supports device and OTG modes.
+	 */
+	sc->sc_motg.sc_mode = MOTG_MODE_HOST;
+#endif
 	if (sc->sc_motg.sc_mode == MOTG_MODE_HOST) {
 		val = TIOTG_USBC_READ4(sc, USBCTRL_MODE);
 		val |= USBCTRL_MODE_IDDIGMUX;



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

2016-07-21 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Thu Jul 21 09:10:55 UTC 2016

Modified Files:
src/sys/arch/evbarm/conf: VTC100

Log Message:
Attach atphy instead of ukphy.


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

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/conf/VTC100
diff -u src/sys/arch/evbarm/conf/VTC100:1.3 src/sys/arch/evbarm/conf/VTC100:1.4
--- src/sys/arch/evbarm/conf/VTC100:1.3	Tue Jul 12 13:20:03 2016
+++ src/sys/arch/evbarm/conf/VTC100	Thu Jul 21 09:10:55 2016
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: VTC100,v 1.3 2016/07/12 13:20:03 kiyohara Exp $
+#	$NetBSD: VTC100,v 1.4 2016/07/21 09:10:55 kiyohara Exp $
 #
 #	BEAGLEBONE -- TI AM335x board Kernel
 #
@@ -267,7 +267,7 @@ pseudo-device	wsfont
 
 # Ethernet
 cpsw*		at obio2 addr 0x4a10 size 0x8000 intrbase 40
-ukphy*		at mii?
+atphy*		at mii? phy ?		# Attansic/Atheros PHYs
 
 # On-board USB. Experimental
 #tiotg* 	at mainbus0 base 0x4740 size 0x5000 intrbase 17



CVS commit: src/sys/arch/arm/marvell

2016-07-12 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Jul 12 13:43:18 UTC 2016

Modified Files:
src/sys/arch/arm/marvell: pci_machdep.c

Log Message:
Fix intr_establish.  PCI interrupt is LEVEL LOW.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/marvell/pci_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/arm/marvell/pci_machdep.c
diff -u src/sys/arch/arm/marvell/pci_machdep.c:1.9 src/sys/arch/arm/marvell/pci_machdep.c:1.10
--- src/sys/arch/arm/marvell/pci_machdep.c:1.9	Fri Oct  2 05:22:50 2015
+++ src/sys/arch/arm/marvell/pci_machdep.c	Tue Jul 12 13:43:18 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_machdep.c,v 1.9 2015/10/02 05:22:50 msaitoh Exp $	*/
+/*	$NetBSD: pci_machdep.c,v 1.10 2016/07/12 13:43:18 kiyohara Exp $	*/
 /*
  * Copyright (c) 2008 KIYOHARA Takashi
  * All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.9 2015/10/02 05:22:50 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.10 2016/07/12 13:43:18 kiyohara Exp $");
 
 #include "opt_mvsoc.h"
 #include "gtpci.h"
@@ -352,7 +352,8 @@ gtpci_gpp_intr_establish(void *v, pci_in
 	int2gpp = prop_dictionary_get(device_properties(sc->sc_dev), "int2gpp");
 	gpp = prop_array_get(int2gpp, int_pin);
 	gpp_pin = prop_number_integer_value(gpp);
-	return mvsocgpp_intr_establish(gpp_pin, ipl, 0, intrhand, intrarg);
+	return mvsocgpp_intr_establish(gpp_pin, ipl, IST_LEVEL_LOW, intrhand,
+	intrarg);
 }
 
 static void



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

2016-07-12 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Jul 12 13:32:14 UTC 2016

Modified Files:
src/sys/arch/evbarm/conf: README.evbarm

Log Message:
Add VTC100 and KURONAS_X4.


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

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/conf/README.evbarm
diff -u src/sys/arch/evbarm/conf/README.evbarm:1.11 src/sys/arch/evbarm/conf/README.evbarm:1.12
--- src/sys/arch/evbarm/conf/README.evbarm:1.11	Fri Apr 10 11:04:58 2015
+++ src/sys/arch/evbarm/conf/README.evbarm	Tue Jul 12 13:32:14 2016
@@ -1,4 +1,4 @@
-$NetBSD: README.evbarm,v 1.11 2015/04/10 11:04:58 hkenken Exp $
+$NetBSD: README.evbarm,v 1.12 2016/07/12 13:32:14 kiyohara Exp $
 
 config		date		boards
 ---
@@ -32,6 +32,7 @@ IXM1200		2002/07/15	Intel IMX1200 eval b
 JETSONTK1	2015/05/29	NVIDIA Jetson TK1 development kit
 KOBO		2014/07/25	Kobo touch (eReaders)
 KUROBOX_PRO	2010/10/02	Kuroutoshikou KURO-BOX/PRO
+KURONAS_X4	2016/07/11	Kuroutoshikou KURO-NAS/x4
 LUBBOCK		2003/06/18	Intel Lubbock DBPXA250 board
 MARVELL_NAS	2010/10/02	Generic Marvell SoC based NAS
 MINI2440	2012/01/30	FrendlyARM Mini2440 S3C2440 SoC board
@@ -64,5 +65,6 @@ TOASTER		2005/08/14	NetBSD/toaster based
 TS7200		2004/12/23	Technologic Systems TS-7200 board
 TWINTAIL	2005/02/26	Genetec corp. "Twintail" PXA255 eval board
 VIPER		2005/06/06	Arcom Viper PXA255 ARM board
+VTC100		2016/07/04	NEXCOM VTC100
 ZAO425		2003/05/23	NOVATEC NTNP425B "ZAO425" IXP425 eval board
 ZEDBOARD	2015/01/23	Xilinx Zynq-7000



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

2016-07-12 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Jul 12 13:28:46 UTC 2016

Added Files:
src/sys/arch/evbarm/conf: KURONAS_X4

Log Message:
Add 'KURONAS x4' configuration.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbarm/conf/KURONAS_X4

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/conf/KURONAS_X4
diff -u /dev/null src/sys/arch/evbarm/conf/KURONAS_X4:1.1
--- /dev/null	Tue Jul 12 13:28:46 2016
+++ src/sys/arch/evbarm/conf/KURONAS_X4	Tue Jul 12 13:28:46 2016
@@ -0,0 +1,39 @@
+#	$NetBSD: KURONAS_X4,v 1.1 2016/07/12 13:28:46 kiyohara Exp $
+#
+#  KUROBOX_PRO -- KUROUTOSHIKOU. KURO-BOX/PRO platform kernel
+#
+
+include 	"arch/evbarm/conf/MARVELL_NAS"
+
+# Board Type
+makeoptions	BOARDTYPE="kuronas_x4"
+options 	EVBARM_BOARDTYPE=kuronas_x4
+
+makeoptions	CPUFLAGS="-mcpu=xscale"	# Xscale instruction set support
+no options	CPU_SHEEVA
+no options	KIRKWOOD
+
+# Also build a kernel with root on wd0, to avoid query for root fs
+config		netbsd-wd0	root on wd0 type ffs
+
+# Development and Debugging options
+
+#options 	PERFCTRS	# performance counters
+options 	DIAGNOSTIC	# internal consistency checks
+options 	DEBUG
+#options 	PMAP_DEBUG	# Enable pmap_debug_level code
+#options 	VERBOSE_INIT_ARM # verbose bootstraping messages
+#options 	DDB_HISTORY_SIZE=100	# Enable history editing in DDB
+#options 	KGDB
+#options 	DEBUG_KGDB
+makeoptions	DEBUG="-g"	# compile full symbol table
+#makeoptions	COPTS="-O2"
+makeoptions	COPY_SYMTAB=1
+#options 	AUDIO_DEBUG=2
+
+
+rs5c372rtc* at iic? addr 0x32		# RICOH RS5C372 RTC
+
+# PCI network interfaces
+#mskc*	at pci? dev ? function ?	# Marvell Yukon 2 Gigabit Ethernet
+#msk*	at mskc?



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

2016-07-12 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Jul 12 13:20:03 UTC 2016

Modified Files:
src/sys/arch/evbarm/conf: VTC100

Log Message:
Comment-out tiotg.  It is not working yet.
Also clean-up and disable usb devices.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/conf/VTC100

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/conf/VTC100
diff -u src/sys/arch/evbarm/conf/VTC100:1.2 src/sys/arch/evbarm/conf/VTC100:1.3
--- src/sys/arch/evbarm/conf/VTC100:1.2	Tue Jul 12 13:16:50 2016
+++ src/sys/arch/evbarm/conf/VTC100	Tue Jul 12 13:20:03 2016
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: VTC100,v 1.2 2016/07/12 13:16:50 kiyohara Exp $
+#	$NetBSD: VTC100,v 1.3 2016/07/12 13:20:03 kiyohara Exp $
 #
 #	BEAGLEBONE -- TI AM335x board Kernel
 #
@@ -270,63 +270,32 @@ cpsw*		at obio2 addr 0x4a10 size 0x8
 ukphy*		at mii?
 
 # On-board USB. Experimental
-tiotg* 	at mainbus0 base 0x4740 size 0x5000 intrbase 17
-motg*	at tiotg? port ?
-usb*		at motg?
-uhub*		at usb?
-uhub*		at uhub? port ?
+#tiotg* 	at mainbus0 base 0x4740 size 0x5000 intrbase 17
+#motg*	at tiotg? port ?
+#usb*		at motg?
+#uhub*		at usb?
+#uhub*		at uhub? port ?
 
-uhidev*		at uhub?
+#uhidev* 	at uhub?
 
 # USB Keyboards
-ukbd*	at uhidev? reportid ?
-wskbd*	at ukbd? console ? mux 1
+#ukbd*	at uhidev? reportid ?
+#wskbd*	at ukbd? console ? mux 1
 
 # USB Mice
-ums*	at uhidev? reportid ?
-wsmouse* at ums? mux 0
+#ums*	at uhidev? reportid ?
+#wsmouse* at ums? mux 0
 
-# USB generic touchscreen
-uts*	at uhidev? reportid ?
-wsmouse* at uts? mux 0
-
-# USB Modem
-umodem* at uhub? port ? configuration ?
-ucom*	at umodem?
-# Serial adapters
-ubsa*	at uhub? port ?		# Belkin serial adapter
-ucom*	at ubsa? portno ?
-
-uchcom* at uhub? port ? 	# WinChipHead CH341/CH340 serial adapter
-ucom*	at uchcom? portno ?
-
-uftdi*	at uhub? port ?		# FTDI FT8U100AX serial adapter
-ucom*	at uftdi? portno ?
-
-uipaq*	at uhub? port ?		# iPAQ PDAs
-ucom*	at uipaq? portno ?
-
-umct*	at uhub? port ?		# MCT USB-RS232 serial adapter
-ucom*	at umct? portno ?
-
-uplcom* at uhub? port ? 	# I/O DATA USB-RSAQ2 serial adapter
-ucom*	at uplcom? portno ?
-
-uslsa*	at uhub? port ?		# Silicon Labs USB-RS232 serial adapter
-ucom*	at uslsa? portno ?
-
-uvscom* at uhub? port ? 	# SUNTAC Slipper U VS-10U serial adapter
-ucom*	at uvscom? portno ?
-
-
-umass*		at uhub? port ? configuration ? interface ?
-wd*		at umass?
+#umass*		at uhub? port ? configuration ? interface ?
+#wd*		at umass?
 # SCSI bus support
-scsibus*	at scsi?
+#scsibus*	at scsi?
 # SCSI devices
-sd*		at scsibus? target ? lun ?  # SCSI disk drives
+#sd*		at scsibus? target ? lun ?	# SCSI disk drives
 
-axe*		at uhub? port ? configuration ? interface ?
+#u3ginit*	at uhub? port ?
+#u3g*		at uhub? port ?
+#ucom*		at u3g?
 
 # Pseudo-Devices
 
@@ -340,6 +309,7 @@ pseudo-device	drvctl			# driver control
 # network pseudo-devices
 pseudo-device	bpfilter		# Berkeley packet filter
 pseudo-device	loop			# network loopback
+#pseudo-device	ppp			# Point-to-Point Protocol
 #pseudo-device	kttcp			# network loopback
 
 # miscellaneous pseudo-devices



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

2016-07-12 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Jul 12 13:16:50 UTC 2016

Modified Files:
src/sys/arch/evbarm/conf: VTC100

Log Message:
cpsw's intrbase is 40.


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

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/conf/VTC100
diff -u src/sys/arch/evbarm/conf/VTC100:1.1 src/sys/arch/evbarm/conf/VTC100:1.2
--- src/sys/arch/evbarm/conf/VTC100:1.1	Mon Jul  4 15:53:25 2016
+++ src/sys/arch/evbarm/conf/VTC100	Tue Jul 12 13:16:50 2016
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: VTC100,v 1.1 2016/07/04 15:53:25 kiyohara Exp $
+#	$NetBSD: VTC100,v 1.2 2016/07/12 13:16:50 kiyohara Exp $
 #
 #	BEAGLEBONE -- TI AM335x board Kernel
 #
@@ -266,7 +266,7 @@ pseudo-device	wsmux			# mouse & keyboard
 pseudo-device	wsfont
 
 # Ethernet
-cpsw*		at obio2 addr 0x4a10 size 0x8000 intrbase 93
+cpsw*		at obio2 addr 0x4a10 size 0x8000 intrbase 40
 ukphy*		at mii?
 
 # On-board USB. Experimental



CVS commit: src/sys/arch/arm/omap

2016-07-11 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Mon Jul 11 14:53:05 UTC 2016

Modified Files:
src/sys/arch/arm/omap: omap2_gpio.c

Log Message:
Support OMAP 4430.
tested on Gumstix DuoVero.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/arm/omap/omap2_gpio.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/arm/omap/omap2_gpio.c
diff -u src/sys/arch/arm/omap/omap2_gpio.c:1.17 src/sys/arch/arm/omap/omap2_gpio.c:1.18
--- src/sys/arch/arm/omap/omap2_gpio.c:1.17	Sat Jul  9 15:04:06 2016
+++ src/sys/arch/arm/omap/omap2_gpio.c	Mon Jul 11 14:53:05 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: omap2_gpio.c,v 1.17 2016/07/09 15:04:06 kiyohara Exp $	*/
+/*	$NetBSD: omap2_gpio.c,v 1.18 2016/07/11 14:53:05 kiyohara Exp $	*/
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -28,7 +28,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: omap2_gpio.c,v 1.17 2016/07/09 15:04:06 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap2_gpio.c,v 1.18 2016/07/11 14:53:05 kiyohara Exp $");
 
 #define _INTR_PRIVATE
 
@@ -61,8 +61,11 @@ __KERNEL_RCSID(0, "$NetBSD: omap2_gpio.c
 #endif
 
 static void gpio_pic_block_irqs(struct pic_softc *, size_t, uint32_t);
+static void gpio_pic_block_irqs2(struct pic_softc *, size_t, uint32_t);
 static void gpio_pic_unblock_irqs(struct pic_softc *, size_t, uint32_t);
+static void gpio_pic_unblock_irqs2(struct pic_softc *, size_t, uint32_t);
 static int gpio_pic_find_pending_irqs(struct pic_softc *);
+static int gpio_pic_find_pending_irqs2(struct pic_softc *);
 static void gpio_pic_establish_irq(struct pic_softc *, struct intrsource *);
 
 const struct pic_ops gpio_pic_ops = {
@@ -71,6 +74,12 @@ const struct pic_ops gpio_pic_ops = {
 	.pic_find_pending_irqs = gpio_pic_find_pending_irqs,
 	.pic_establish_irq = gpio_pic_establish_irq,
 };
+const struct pic_ops gpio_pic_ops2 = {
+	.pic_block_irqs = gpio_pic_block_irqs2,
+	.pic_unblock_irqs = gpio_pic_unblock_irqs2,
+	.pic_find_pending_irqs = gpio_pic_find_pending_irqs2,
+	.pic_establish_irq = gpio_pic_establish_irq,
+};
 
 struct gpio_softc {
 	device_t gpio_dev;
@@ -78,6 +87,7 @@ struct gpio_softc {
 	struct intrsource *gpio_is;
 	bus_space_tag_t gpio_memt;
 	bus_space_handle_t gpio_memh;
+	bus_space_handle_t gpio_memh2;
 	uint32_t gpio_enable_mask;
 	uint32_t gpio_edge_mask;
 	uint32_t gpio_edge_falling_mask;
@@ -100,6 +110,10 @@ struct gpio_softc {
 	bus_space_read_4((gpio)->gpio_memt, (gpio)->gpio_memh, (reg))
 #define	GPIO_WRITE(gpio, reg, val) \
 	bus_space_write_4((gpio)->gpio_memt, (gpio)->gpio_memh, (reg), (val))
+#define	GPIO_READ2(gpio, reg) \
+	bus_space_read_4((gpio)->gpio_memt, (gpio)->gpio_memh2, (reg))
+#define	GPIO_WRITE2(gpio, reg, val) \
+	bus_space_write_4((gpio)->gpio_memt, (gpio)->gpio_memh2, (reg), (val))
 
 void
 gpio_pic_unblock_irqs(struct pic_softc *pic, size_t irq_base, uint32_t irq_mask)
@@ -119,6 +133,22 @@ gpio_pic_unblock_irqs(struct pic_softc *
 }
 
 void
+gpio_pic_unblock_irqs2(struct pic_softc *pic, size_t irq_base, uint32_t irq_mask)
+{
+	struct gpio_softc * const gpio = PIC_TO_SOFTC(pic);
+	KASSERT(irq_base == 0);
+
+	/*
+	 * If this a level source, ack it now.  If it's still asserted
+	 * it'll come back.
+	 */
+	GPIO_WRITE2(gpio, GPIO_IRQSTATUS_SET_0, irq_mask);
+	if (irq_mask & gpio->gpio_level_mask)
+		GPIO_WRITE2(gpio, GPIO_IRQSTATUS_0,
+		irq_mask & gpio->gpio_level_mask);
+}
+
+void
 gpio_pic_block_irqs(struct pic_softc *pic, size_t irq_base, uint32_t irq_mask)
 {
 	struct gpio_softc * const gpio = PIC_TO_SOFTC(pic);
@@ -135,6 +165,22 @@ gpio_pic_block_irqs(struct pic_softc *pi
 		irq_mask & gpio->gpio_edge_mask);
 }
 
+void
+gpio_pic_block_irqs2(struct pic_softc *pic, size_t irq_base, uint32_t irq_mask)
+{
+	struct gpio_softc * const gpio = PIC_TO_SOFTC(pic);
+	KASSERT(irq_base == 0);
+
+	GPIO_WRITE2(gpio, GPIO_IRQSTATUS_CLR_0, irq_mask);
+	/*
+	 * If any of the sources are edge triggered, ack them now so
+	 * we won't lose them.
+	 */
+	if (irq_mask & gpio->gpio_edge_mask)
+		GPIO_WRITE2(gpio, GPIO_IRQSTATUS_0,
+		irq_mask & gpio->gpio_edge_mask);
+}
+
 int
 gpio_pic_find_pending_irqs(struct pic_softc *pic)
 {
@@ -155,6 +201,24 @@ gpio_pic_find_pending_irqs(struct pic_so
 	return 1;
 }
 
+int
+gpio_pic_find_pending_irqs2(struct pic_softc *pic)
+{
+	struct gpio_softc * const gpio = PIC_TO_SOFTC(pic);
+	uint32_t pending;
+
+	pending = GPIO_READ2(gpio, GPIO_IRQSTATUS_0);
+	if (pending == 0)
+		return 0;
+
+	/*
+	 * Now find all the pending bits and mark them as pending.
+	 */
+	(void) pic_mark_pending_sources(&gpio->gpio_pic, 0, pending);
+
+	return 1;
+}
+
 void
 gpio_pic_establish_irq(struct pic_softc *pic, struct intrsource *is)
 {
@@ -170,9 +234,14 @@ gpio_pic_establish_irq(struct pic_softc 
 	/*
 	 * Make sure the irq isn't enabled and not asserting.
 	 */
+#if defined(OMAP_4430) || defined(TI_A

CVS commit: src/sys/arch/arm/omap

2016-07-11 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Mon Jul 11 14:51:11 UTC 2016

Modified Files:
src/sys/arch/arm/omap: omap2_reg.h

Log Message:
Add more GPIO registers.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/arm/omap/omap2_reg.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/arm/omap/omap2_reg.h
diff -u src/sys/arch/arm/omap/omap2_reg.h:1.32 src/sys/arch/arm/omap/omap2_reg.h:1.33
--- src/sys/arch/arm/omap/omap2_reg.h:1.32	Sun Jul  3 12:27:04 2016
+++ src/sys/arch/arm/omap/omap2_reg.h	Mon Jul 11 14:51:11 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: omap2_reg.h,v 1.32 2016/07/03 12:27:04 kiyohara Exp $ */
+/* $NetBSD: omap2_reg.h,v 1.33 2016/07/11 14:51:11 kiyohara Exp $ */
 
 /*
  * Copyright (c) 2007 Microsoft
@@ -789,6 +789,23 @@
 #define	GPIO5_BASE_TI_DM37XX		0x49056000
 #define	GPIO6_BASE_TI_DM37XX		0x49058000
 
+#define	GPIO_SIZE2			0x100
+
+#define	GPIO_REVISION			0x000
+#define	GPIO_SYSCONFIG			0x010
+#define	GPIO_EOI			0x020	/* AM33xx */
+#define	GPIO_IRQSTATUS_RAW_0		0x024
+#define	GPIO_IRQSTATUS_RAW_1		0x028
+#define	GPIO_IRQSTATUS_0		0x02c
+#define	GPIO_IRQSTATUS_1		0x030
+#define	GPIO_IRQSTATUS_SET_0		0x034
+#define	GPIO_IRQSTATUS_SET_1		0x038
+#define	GPIO_IRQSTATUS_CLR_0		0x03c
+#define	GPIO_IRQSTATUS_CLR_1		0x040
+#define	GPIO_IRQWAKEN_0			0x044
+#define	GPIO_IRQWAKEN_1			0x048
+#define	GPIO_SYSSTATUS			0x114
+
 #define	GPIO_IRQSTATUS1			0x018
 #define	GPIO_IRQENABLE1			0x01c
 #define	GPIO_WAKEUPENABLE		0x020



CVS commit: src/sys/arch/arm/omap

2016-07-11 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Mon Jul 11 14:46:33 UTC 2016

Modified Files:
src/sys/arch/arm/omap: tiotg.c

Log Message:
s/^ +/  /


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/omap/tiotg.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/arm/omap/tiotg.c
diff -u src/sys/arch/arm/omap/tiotg.c:1.4 src/sys/arch/arm/omap/tiotg.c:1.5
--- src/sys/arch/arm/omap/tiotg.c:1.4	Mon Jul  4 15:35:55 2016
+++ src/sys/arch/arm/omap/tiotg.c	Mon Jul 11 14:46:33 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: tiotg.c,v 1.4 2016/07/04 15:35:55 kiyohara Exp $ */
+/* $NetBSD: tiotg.c,v 1.5 2016/07/11 14:46:33 kiyohara Exp $ */
 /*
  * Copyright (c) 2013 Manuel Bouyer.  All rights reserved.
  *
@@ -24,7 +24,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tiotg.c,v 1.4 2016/07/04 15:35:55 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tiotg.c,v 1.5 2016/07/11 14:46:33 kiyohara Exp $");
 
 #include "opt_omap.h"
 #include "locators.h"
@@ -133,14 +133,14 @@ tiotg_match(device_t parent, cfdata_t ma
 	if (mb->mb_iobase == MAINBUSCF_BASE_DEFAULT ||
 	mb->mb_iosize == MAINBUSCF_SIZE_DEFAULT ||
 	mb->mb_intrbase == MAINBUSCF_INTRBASE_DEFAULT)
-return 0;
-return 1;
+		return 0;
+	return 1;
 }
 
 static void
 tiotg_attach(device_t parent, device_t self, void *aux)
 {
-	struct tiotg_softc   *sc = device_private(self);
+	struct tiotg_softc *sc = device_private(self);
 	struct mainbus_attach_args *mb = aux;
 	uint32_t val;
 
@@ -157,7 +157,7 @@ tiotg_attach(device_t parent, device_t s
 	sc->sc_intrbase = mb->mb_intrbase;
 	sc->sc_ih = intr_establish(mb->mb_intrbase, IPL_USB, IST_LEVEL,
 	tiotg_intr, sc);
-KASSERT(sc->sc_ih != NULL);
+	KASSERT(sc->sc_ih != NULL);
 	aprint_normal(": TI dual-port USB controller");
 	/* XXX this looks wrong */
 	prcm_write_4(AM335X_PRCM_CM_WKUP, CM_WKUP_CM_CLKDCOLDO_DPLL_PER,



CVS commit: src/sys/arch/arm/arm32

2016-07-11 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Mon Jul 11 14:35:00 UTC 2016

Modified Files:
src/sys/arch/arm/arm32: cpu.c

Log Message:
Add Cortex-A9 r1.


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.114 src/sys/arch/arm/arm32/cpu.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/arm/arm32/cpu.c
diff -u src/sys/arch/arm/arm32/cpu.c:1.113 src/sys/arch/arm/arm32/cpu.c:1.114
--- src/sys/arch/arm/arm32/cpu.c:1.113	Thu Mar  3 17:01:31 2016
+++ src/sys/arch/arm/arm32/cpu.c	Mon Jul 11 14:35:00 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.113 2016/03/03 17:01:31 skrll Exp $	*/
+/*	$NetBSD: cpu.c,v 1.114 2016/07/11 14:35:00 kiyohara Exp $	*/
 
 /*
  * Copyright (c) 1995 Mark Brinicombe.
@@ -46,7 +46,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.113 2016/03/03 17:01:31 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.114 2016/07/11 14:35:00 kiyohara Exp $");
 
 #include 
 #include 
@@ -501,6 +501,8 @@ const struct cpuidtab cpuids[] = {
 	  pN_steppings, "7A" },
 	{ CPU_ID_CORTEXA8R3,	CPU_CLASS_CORTEX,	"Cortex-A8 r3",
 	  pN_steppings, "7A" },
+	{ CPU_ID_CORTEXA9R1,	CPU_CLASS_CORTEX,	"Cortex-A9 r1",
+	  pN_steppings, "7A" },
 	{ CPU_ID_CORTEXA9R2,	CPU_CLASS_CORTEX,	"Cortex-A9 r2",
 	  pN_steppings, "7A" },
 	{ CPU_ID_CORTEXA9R3,	CPU_CLASS_CORTEX,	"Cortex-A9 r3",



CVS commit: src/sys/arch/arm/omap

2016-07-09 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Jul  9 15:04:06 UTC 2016

Modified Files:
src/sys/arch/arm/omap: omap2_gpio.c omap_edma.c

Log Message:
Remove white-spaces.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arm/omap/omap2_gpio.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/omap/omap_edma.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/arm/omap/omap2_gpio.c
diff -u src/sys/arch/arm/omap/omap2_gpio.c:1.16 src/sys/arch/arm/omap/omap2_gpio.c:1.17
--- src/sys/arch/arm/omap/omap2_gpio.c:1.16	Sat Jun 15 21:59:37 2013
+++ src/sys/arch/arm/omap/omap2_gpio.c	Sat Jul  9 15:04:06 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: omap2_gpio.c,v 1.16 2013/06/15 21:59:37 matt Exp $	*/
+/*	$NetBSD: omap2_gpio.c,v 1.17 2016/07/09 15:04:06 kiyohara Exp $	*/
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -28,22 +28,22 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: omap2_gpio.c,v 1.16 2013/06/15 21:59:37 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap2_gpio.c,v 1.17 2016/07/09 15:04:06 kiyohara Exp $");
 
 #define _INTR_PRIVATE
 
 #include "locators.h"
 #include "gpio.h"
 #include "opt_omap.h"
- 
+
 #include 
 #include 
 #include 
- 
+
 #include 
-  
+
 #include 
- 
+
 #include 
 #include 
 #include 
@@ -175,7 +175,7 @@ gpio_pic_establish_irq(struct pic_softc 
 	GPIO_WRITE(gpio, GPIO_IRQSTATUS1, irq_mask);
 
 	/*
-	 * Convert the type to a gpio type and figure out which bits in what 
+	 * Convert the type to a gpio type and figure out which bits in what
 	 * register we have to tweak.
 	 */
 	gpio->gpio_edge_rising_mask &= ~irq_mask;
@@ -209,7 +209,7 @@ gpio_pic_establish_irq(struct pic_softc 
 	 */
 	v = GPIO_READ(gpio, GPIO_OE);
 	v |= irq_mask;
-	GPIO_WRITE(gpio, GPIO_OE, v); 
+	GPIO_WRITE(gpio, GPIO_OE, v);
 #if 0
 	for (i = 0, maybe_is = NULL; i < 32; i++) {
 		if ((is = pic->pic_sources[i]) != NULL) {
@@ -222,7 +222,7 @@ gpio_pic_establish_irq(struct pic_softc 
 		KASSERT(is != NULL);
 		is->is_ipl = maybe_is->is_ipl;
 		(*is->is_pic->pic_ops->pic_establish_irq)(is->is_pic, is);
-	} 
+	}
 #endif
 }
 
@@ -253,7 +253,7 @@ omap2gpio_pin_write(void *arg, int pin, 
 
 	old = GPIO_READ(gpio, GPIO_DATAOUT);
 	if (value)
-		new = old | mask; 
+		new = old | mask;
 	else
 		new = old & ~mask;
 
@@ -438,7 +438,7 @@ gpio_attach(device_t parent, device_t se
 		pic_add(&gpio->gpio_pic, oa->obio_intrbase);
 		aprint_normal(": interrupts %d..%d",
 		oa->obio_intrbase, oa->obio_intrbase + 31);
-		gpio->gpio_is = intr_establish(oa->obio_intr, 
+		gpio->gpio_is = intr_establish(oa->obio_intr,
 		IPL_HIGH, IST_LEVEL, pic_handle_intr, &gpio->gpio_pic);
 		KASSERT(gpio->gpio_is != NULL);
 		aprint_normal(", intr %d", oa->obio_intr);

Index: src/sys/arch/arm/omap/omap_edma.c
diff -u src/sys/arch/arm/omap/omap_edma.c:1.2 src/sys/arch/arm/omap/omap_edma.c:1.3
--- src/sys/arch/arm/omap/omap_edma.c:1.2	Mon Jul  4 15:35:55 2016
+++ src/sys/arch/arm/omap/omap_edma.c	Sat Jul  9 15:04:06 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: omap_edma.c,v 1.2 2016/07/04 15:35:55 kiyohara Exp $ */
+/* $NetBSD: omap_edma.c,v 1.3 2016/07/09 15:04:06 kiyohara Exp $ */
 
 /*-
  * Copyright (c) 2014 Jared D. McNeill 
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: omap_edma.c,v 1.2 2016/07/04 15:35:55 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap_edma.c,v 1.3 2016/07/09 15:04:06 kiyohara Exp $");
 
 #include "opt_omap.h"
 
@@ -504,7 +504,7 @@ edma_halt(struct edma_channel *ch)
 	bus_size_t off = (ch->ch_index < 32 ? 0 : 4);
 	uint32_t bit = __BIT(ch->ch_index < 32 ?
 			 ch->ch_index : ch->ch_index - 32);
-	
+
 	EDMA_WRITE(sc, EDMA_EECR_REG + off, bit);
 	EDMA_WRITE(sc, EDMA_ECR_REG + off, bit);
 	EDMA_WRITE(sc, EDMA_SECR_REG + off, bit);



CVS commit: src/sys/arch/arm/omap

2016-07-07 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Thu Jul  7 15:27:42 UTC 2016

Modified Files:
src/sys/arch/arm/omap: obio_com.c

Log Message:
com@obio's type is COM_TYPE_OMAP.  This mean is able to change the baudrate.
tested on VTC100's com1(GPS).


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/omap/obio_com.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/arm/omap/obio_com.c
diff -u src/sys/arch/arm/omap/obio_com.c:1.6 src/sys/arch/arm/omap/obio_com.c:1.7
--- src/sys/arch/arm/omap/obio_com.c:1.6	Thu Jul  7 15:20:58 2016
+++ src/sys/arch/arm/omap/obio_com.c	Thu Jul  7 15:27:42 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: obio_com.c,v 1.6 2016/07/07 15:20:58 kiyohara Exp $	*/
+/*	$NetBSD: obio_com.c,v 1.7 2016/07/07 15:27:42 kiyohara Exp $	*/
 
 /*
  * Based on arch/arm/omap/omap_com.c
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: obio_com.c,v 1.6 2016/07/07 15:20:58 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: obio_com.c,v 1.7 2016/07/07 15:27:42 kiyohara Exp $");
 
 #include "opt_omap.h"
 #include "opt_com.h"
@@ -151,7 +151,7 @@ obiouart_attach(device_t parent, device_
 	iot = obio->obio_iot;
 	iobase = obio->obio_addr;
 	sc->sc_frequency = OMAP_COM_FREQ;
-	sc->sc_type = COM_TYPE_NORMAL;
+	sc->sc_type = COM_TYPE_OMAP;
 
 	if (com_is_console(iot, iobase, &ioh) == 0 &&
 	bus_space_map(iot, iobase, obio->obio_size, 0, &ioh)) {



CVS commit: src/sys/arch/arm/omap

2016-07-07 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Thu Jul  7 15:20:58 UTC 2016

Modified Files:
src/sys/arch/arm/omap: obio_com.c

Log Message:
Call uart_enable() before comprobe1().
And rename to uart_enable_omap().  Also do soft reset in new uart_enable().
Add uart_enable_am335x().  Its enable to clocks.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/omap/obio_com.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/arm/omap/obio_com.c
diff -u src/sys/arch/arm/omap/obio_com.c:1.5 src/sys/arch/arm/omap/obio_com.c:1.6
--- src/sys/arch/arm/omap/obio_com.c:1.5	Wed Apr  9 21:02:31 2014
+++ src/sys/arch/arm/omap/obio_com.c	Thu Jul  7 15:20:58 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: obio_com.c,v 1.5 2014/04/09 21:02:31 hans Exp $	*/
+/*	$NetBSD: obio_com.c,v 1.6 2016/07/07 15:20:58 kiyohara Exp $	*/
 
 /*
  * Based on arch/arm/omap/omap_com.c
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: obio_com.c,v 1.5 2014/04/09 21:02:31 hans Exp $");
+__KERNEL_RCSID(0, "$NetBSD: obio_com.c,v 1.6 2016/07/07 15:20:58 kiyohara Exp $");
 
 #include "opt_omap.h"
 #include "opt_com.h"
@@ -59,13 +59,38 @@ __KERNEL_RCSID(0, "$NetBSD: obio_com.c,v
 #include 
 #include 
 
+#include 
+#include 
+
 #include "locators.h"
 
 static int	obiouart_match(device_t, cfdata_t, void *);
 static void	obiouart_attach(device_t, device_t, void *);
-static int	uart_enable(struct obio_attach_args *);
+#if defined(TI_AM335X)
+static int	uart_enable_am335x(struct obio_attach_args *);
+#else
+static int	uart_enable_omap(struct obio_attach_args *);
+#endif
+static int	uart_enable(struct obio_attach_args *, bus_space_handle_t);
 static void	obiouart_callout(void *);
 
+#if defined(TI_AM335X)
+struct am335x_com {
+	bus_addr_t as_base_addr;
+	int as_intr;
+	struct omap_module as_module;
+};
+
+static const struct am335x_com am335x_com[] = {
+	{ 0x44e09000, 72, { AM335X_PRCM_CM_WKUP, 0xb4 } },
+	{ 0x48022000, 73, { AM335X_PRCM_CM_PER, 0x6c } },
+	{ 0x48024000, 74, { AM335X_PRCM_CM_PER, 0x70 } },
+	{ 0x481a6000, 44, { AM335X_PRCM_CM_PER, 0x74 } },
+	{ 0x481a8000, 45, { AM335X_PRCM_CM_PER, 0x78 } },
+	{ 0x481aa000, 46, { AM335X_PRCM_CM_PER, 0x38 } },
+};
+#endif
+
 struct com_obio_softc {
 	struct com_softc sc_sc;
 	struct callout sc_callout;
@@ -87,7 +112,7 @@ obiouart_match(device_t parent, cfdata_t
 #if 0
 	/*
 	 * XXX this should be ifdefed on a board-dependent switch
-	 * We don't know what is the irq for com0 on the sdp2430 
+	 * We don't know what is the irq for com0 on the sdp2430
 	 */
 	if (obio->obio_intr == OBIOCF_INTR_DEFAULT)
 		panic("obiouart must have intr specified in config.");
@@ -99,14 +124,12 @@ obiouart_match(device_t parent, cfdata_t
 	if (com_is_console(obio->obio_iot, obio->obio_addr, NULL))
 		return 1;
 
-	if (uart_enable(obio) != 0)
-		return 1;
-
 	if (bus_space_map(obio->obio_iot, obio->obio_addr, obio->obio_size,
-			  0, &bh))
-		return 1;
-
-	rv = comprobe1(obio->obio_iot, bh);
+			  0, &bh) != 0)
+		return 0;
+	rv = 0;
+	if (uart_enable(obio, bh) == 0)
+		rv = comprobe1(obio->obio_iot, bh);
 
 	bus_space_unmap(obio->obio_iot, bh, obio->obio_size);
 
@@ -161,8 +184,29 @@ obiouart_callout(void *arg)
 }
 
 
+#if defined(TI_AM335X)
+
 static int
-uart_enable(struct obio_attach_args *obio)
+uart_enable_am335x(struct obio_attach_args *obio)
+{
+	int i;
+
+	/* XXX Not really AM335X-specific.  */
+	for (i = 0; i < __arraycount(am335x_com); i++)
+		if ((obio->obio_addr == am335x_com[i].as_base_addr) &&
+		(obio->obio_intr == am335x_com[i].as_intr)) {
+			prcm_module_enable(&am335x_com[i].as_module);
+			break;
+		}
+	KASSERT(i < __arraycount(am335x_com));
+
+	return 0;
+}
+
+#else
+
+static int
+uart_enable_omap(struct obio_attach_args *obio)
 {
 	bus_space_handle_t ioh;
 	uint32_t r;
@@ -222,3 +266,33 @@ err:
 
 	return 0;
 }
+
+#endif
+
+static int
+uart_enable(struct obio_attach_args *obio, bus_space_handle_t bh)
+{
+	uint32_t v;
+
+#if defined(TI_AM335X)
+	if (uart_enable_am335x(obio) != 0)
+		return -1;
+#else
+	if (uart_enable_omap(obio) != 0)
+		return -1;
+#endif
+
+	v = bus_space_read_4(obio->obio_iot, bh, OMAP_COM_SYSC);
+	v |= OMAP_COM_SYSC_SOFT_RESET;
+	bus_space_write_4(obio->obio_iot, bh, OMAP_COM_SYSC, v);
+	v = bus_space_read_4(obio->obio_iot, bh, OMAP_COM_SYSS);
+	while (!(v & OMAP_COM_SYSS_RESET_DONE))
+		v = bus_space_read_4(obio->obio_iot, bh, OMAP_COM_SYSS);
+
+	/* Disable smart idle */
+	v = bus_space_read_4(obio->obio_iot, bh, OMAP_COM_SYSC);
+	v |= OMAP_COM_SYSC_NO_IDLE;
+	bus_space_write_4(obio->obio_iot, bh, OMAP_COM_SYSC, v);
+
+	return 0;
+}



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

2016-07-04 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Mon Jul  4 15:53:25 UTC 2016

Added Files:
src/sys/arch/evbarm/conf: VTC100

Log Message:
Add NEXCOM VTC100.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbarm/conf/VTC100

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/conf/VTC100
diff -u /dev/null src/sys/arch/evbarm/conf/VTC100:1.1
--- /dev/null	Mon Jul  4 15:53:25 2016
+++ src/sys/arch/evbarm/conf/VTC100	Mon Jul  4 15:53:25 2016
@@ -0,0 +1,353 @@
+#
+#	$NetBSD: VTC100,v 1.1 2016/07/04 15:53:25 kiyohara Exp $
+#
+#	BEAGLEBONE -- TI AM335x board Kernel
+#
+
+include	"arch/evbarm/conf/std.beagle"
+
+# estimated number of users
+
+maxusers	32
+
+# Standard system options
+
+options 	RTC_OFFSET=0	# hardware clock is this many mins. west of GMT
+#options 	NTP		# NTP phase/frequency locked loop
+
+# CPU options
+
+options 	CPU_CORTEXA8
+options 	TI_AM335X
+options 	PMAPCOUNTERS
+
+# XXX The Cortex PMC delay() doesn't seem to work.
+#no options	CORTEX_PMC
+
+# Architecture options
+#makeoptions	CPUFLAGS+="-mthumb"
+
+# File systems
+
+file-system	FFS		# UFS
+#file-system	LFS		# log-structured file system
+file-system	MFS		# memory file system
+file-system	NFS		# Network file system
+#file-system 	ADOSFS		# AmigaDOS-compatible file system
+file-system 	EXT2FS		# second extended file system (linux)
+#file-system	CD9660		# ISO 9660 + Rock Ridge file system
+file-system	MSDOSFS		# MS-DOS file system
+#file-system	FDESC		# /dev/fd
+#file-system	KERNFS		# /kern
+file-system	NULLFS		# loopback file system
+#file-system	PROCFS		# /proc
+#file-system	PUFFS		# Userspace file systems (e.g. ntfs-3g & sshfs)
+#file-system	UMAPFS		# NULLFS + uid and gid remapping
+#file-system	UNION		# union file system
+file-system	TMPFS		# memory file system
+file-system	PTYFS		# /dev/pts/N support
+
+# File system options
+#options 	QUOTA		# legacy UFS quotas
+#options 	QUOTA2		# new, in-filesystem UFS quotas
+#options 	FFS_EI		# FFS Endian Independent support
+#options 	NFSSERVER
+options 	WAPBL		# File system journaling support
+#options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
+
+# Networking options
+
+#options 	GATEWAY		# packet forwarding
+options 	INET		# IP + ICMP + TCP + UDP
+options 	INET6		# IPV6
+#options 	IPSEC		# IP security
+#options 	IPSEC_DEBUG	# debug for IP security
+#options 	MROUTING	# IP multicast routing
+#options 	PIM		# Protocol Independent Multicast
+#options 	NETATALK	# AppleTalk networking
+#options 	PPP_BSDCOMP	# BSD-Compress compression support for PPP
+#options 	PPP_DEFLATE	# Deflate compression support for PPP
+#options 	PPP_FILTER	# Active filter support for PPP (requires bpf)
+#options 	TCP_DEBUG	# Record last TCP_NDEBUG packets with SO_DEBUG
+
+options 	NFS_BOOT_BOOTP
+options 	NFS_BOOT_DHCP
+#options		NFS_BOOT_BOOTSTATIC
+#options		NFS_BOOTSTATIC_MYIP="\"192.168.1.4\""
+#options		NFS_BOOTSTATIC_GWIP="\"192.168.1.1\""
+#options		NFS_BOOTSTATIC_MASK="\"255.255.255.0\""
+#options		NFS_BOOTSTATIC_SERVADDR="\"192.168.1.1\""
+#options		NFS_BOOTSTATIC_SERVER="\"192.168.1.1:/nfs/sdp2430\""
+
+options		NFS_BOOT_RWSIZE=1024
+
+# Compatibility options
+
+options		COMPAT_NETBSD32	# allow running arm (e.g. non-earm) binaries
+#options 	COMPAT_43	# 4.3BSD compatibility.
+#options 	COMPAT_09	# NetBSD 0.9,
+#options 	COMPAT_10	# NetBSD 1.0,
+#options 	COMPAT_11	# NetBSD 1.1,
+#options 	COMPAT_12	# NetBSD 1.2,
+#options 	COMPAT_13	# NetBSD 1.3,
+#options 	COMPAT_14	# NetBSD 1.4,
+#options 	COMPAT_15	# NetBSD 1.5,
+#options 	COMPAT_16	# NetBSD 1.6,
+#options 	COMPAT_20	# NetBSD 2.0,
+options 	COMPAT_30	# NetBSD 3.0,
+options 	COMPAT_40	# NetBSD 4.0,
+options 	COMPAT_50	# NetBSD 5.0,
+options 	COMPAT_60	# NetBSD 6.0, and
+options 	COMPAT_70	# NetBSD 7.0 binary compatibility.
+#options 	TCP_COMPAT_42	# 4.2BSD TCP/IP bug compat. Not recommended.
+#options		COMPAT_BSDPTY	# /dev/[pt]ty?? ptys.
+
+# Shared memory options
+
+options 	SYSVMSG		# System V-like message queues
+options 	SYSVSEM		# System V-like semaphores
+options 	SYSVSHM		# System V-like memory sharing
+
+# Device options
+
+#options 	MEMORY_DISK_HOOKS	# boottime setup of ramdisk
+#options 	MEMORY_DISK_ROOT_SIZE=8192	# Size in blocks
+#options 	MEMORY_DISK_DYNAMIC
+#options 	MINIROOTSIZE=1000	# Size in blocks
+#options 	MEMORY_DISK_IS_ROOT	# use memory disk as root
+
+# Wedge support
+options 	DKWEDGE_AUTODISCOVER	# Automatically add dk(4) instances
+options 	DKWEDGE_METHOD_GPT	# Supports GPT partitions as wedges
+
+# Miscellaneous kernel options
+options 	KTRACE		# system call tracing, a la ktrace(1)
+#options 	SCSIVERBOSE	# Verbose SCSI errors
+#options 	MIIVERBOSE	# Verbose MII autoconfuration messages
+#options 	DDB_KEYCODE=0x40
+#options 	USERCONF	# userconf(4) support
+#options	PIPE_SOCKETPAIR	# smaller, but slower pipe(2)
+
+# Development and Debugging options
+
+#options 	PERFCTRS	# performance counter

CVS commit: src/sys/arch

2016-07-04 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Mon Jul  4 15:45:38 UTC 2016

Modified Files:
src/sys/arch/arm/omap: omap3_sdhc.c omap3_sdmmcreg.h
src/sys/arch/evbarm/conf: BEAGLEBONE

Log Message:
AM335x's sdhc@obio use offset 0x100.
Oops this space maybe use HL registers?  OMAP4430 use this space.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arm/omap/omap3_sdhc.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/omap/omap3_sdmmcreg.h
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/evbarm/conf/BEAGLEBONE

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/arm/omap/omap3_sdhc.c
diff -u src/sys/arch/arm/omap/omap3_sdhc.c:1.20 src/sys/arch/arm/omap/omap3_sdhc.c:1.21
--- src/sys/arch/arm/omap/omap3_sdhc.c:1.20	Mon Apr 25 13:20:42 2016
+++ src/sys/arch/arm/omap/omap3_sdhc.c	Mon Jul  4 15:45:37 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: omap3_sdhc.c,v 1.20 2016/04/25 13:20:42 kiyohara Exp $	*/
+/*	$NetBSD: omap3_sdhc.c,v 1.21 2016/07/04 15:45:37 kiyohara Exp $	*/
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: omap3_sdhc.c,v 1.20 2016/04/25 13:20:42 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap3_sdhc.c,v 1.21 2016/07/04 15:45:37 kiyohara Exp $");
 
 #include "opt_omap.h"
 #include "edma.h"
@@ -243,8 +243,13 @@ obiosdhc_attach(device_t parent, device_
 
 	clksft = ffs(sc->sc.sc_clkmsk) - 1;
 
+#if defined(TI_AM335X)
+	error = bus_space_map(sc->sc_bst, oa->obio_addr + OMAP4_SDMMC_HL_SIZE,
+	oa->obio_size - OMAP4_SDMMC_HL_SIZE, 0, &sc->sc_bsh);
+#else
 	error = bus_space_map(sc->sc_bst, oa->obio_addr, oa->obio_size, 0,
 	&sc->sc_bsh);
+#endif
 	if (error) {
 		aprint_error_dev(self,
 		"can't map registers: %d\n", error);
@@ -261,7 +266,7 @@ obiosdhc_attach(device_t parent, device_
 
 		cv_init(&sc->sc_edma_cv, "sdhcedma");
 		sc->sc_edma_fifo = oa->obio_addr +
-		OMAP3_SDMMC_SDHC_OFFSET + SDHC_DATA;
+		OMAP4_SDMMC_HL_SIZE + OMAP3_SDMMC_SDHC_OFFSET + SDHC_DATA;
 		sc->sc.sc_flags |= SDHC_FLAG_USE_DMA;
 		sc->sc.sc_flags |= SDHC_FLAG_EXTERNAL_DMA;
 		sc->sc.sc_flags |= SDHC_FLAG_EXTDMA_DMAEN;

Index: src/sys/arch/arm/omap/omap3_sdmmcreg.h
diff -u src/sys/arch/arm/omap/omap3_sdmmcreg.h:1.7 src/sys/arch/arm/omap/omap3_sdmmcreg.h:1.8
--- src/sys/arch/arm/omap/omap3_sdmmcreg.h:1.7	Sat Jul 27 17:10:28 2013
+++ src/sys/arch/arm/omap/omap3_sdmmcreg.h	Mon Jul  4 15:45:37 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: omap3_sdmmcreg.h,v 1.7 2013/07/27 17:10:28 jklos Exp $	*/
+/*	$NetBSD: omap3_sdmmcreg.h,v 1.8 2016/07/04 15:45:37 kiyohara Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -45,13 +45,15 @@
 #define SDMMC4_BASE_4430	0x480D1000	// same for omap5
 #define SDMMC5_BASE_4430	0x480D5000	// same for omap5
 
-#define	SDMMC1_BASE_TIAM335X	0x48060100
-#define	SDMMC2_BASE_TIAM335X	0x481d8100
-#define	SDMMC3_BASE_TIAM335X	0x47810100
+#define	SDMMC1_BASE_TIAM335X	0x4806
+#define	SDMMC2_BASE_TIAM335X	0x481d8000
+#define	SDMMC3_BASE_TIAM335X	0x4781
 
 #define	OMAP3_SDMMC_SDHC_OFFSET	0x100
 #define	OMAP3_SDMMC_SDHC_SIZE	0x100
 
+#define	OMAP4_SDMMC_HL_SIZE	0x100
+
 #define MMCHS_SYSCONFIG		0x010	/* System Configuration */
 #  define SYSCONFIG_CLOCKACTIVITY_MASK	(3 << 8)
 #  define SYSCONFIG_CLOCKACTIVITY_FCLK	(2 << 8)

Index: src/sys/arch/evbarm/conf/BEAGLEBONE
diff -u src/sys/arch/evbarm/conf/BEAGLEBONE:1.35 src/sys/arch/evbarm/conf/BEAGLEBONE:1.36
--- src/sys/arch/evbarm/conf/BEAGLEBONE:1.35	Mon Jul  4 15:35:55 2016
+++ src/sys/arch/evbarm/conf/BEAGLEBONE	Mon Jul  4 15:45:38 2016
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: BEAGLEBONE,v 1.35 2016/07/04 15:35:55 kiyohara Exp $
+#	$NetBSD: BEAGLEBONE,v 1.36 2016/07/04 15:45:38 kiyohara Exp $
 #
 #	BEAGLEBONE -- TI AM335x board Kernel
 #
@@ -196,16 +196,13 @@ prcm0		at obio0 addr 0x44e0 size 0x2
 sitaracm0	at obio0 addr 0x44e1 size 0x2000
 
 # SDHC controllers
-# XXX Kludge -- the am335x's mmc registers start at an offset of #x100
-# from other omap3.  (What about omap4?)  Need to adapt the omap sdhc
-# driver to handle this.
-sdhc0		at obio1 addr 0x48060100 size 0x0f00 intr 64 edmabase 24
+sdhc0		at obio1 addr 0x4806 size 0x1000 intr 64 edmabase 24
 sdmmc0		at sdhc0
 ld0		at sdmmc0
-sdhc1		at obio1 addr 0x481d8100 size 0x0f00 intr 28 edmabase 2 # BB Black
+sdhc1		at obio1 addr 0x481d8000 size 0x1000 intr 28 edmabase 2 # BB Black
 sdmmc1		at sdhc1
 ld1		at sdmmc1
-#sdhc2		at obio0 addr 0x47810100 size 0xff00 intr 29
+#sdhc2		at obio0 addr 0x4781 size 0x1000 intr 29
 #sdmmc2		at sdhc2
 #ld2		at sdmmc2
 sdmmc*		at sdhc?		# SD/MMC bus



CVS commit: src/sys/arch

2016-07-04 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Mon Jul  4 15:35:55 UTC 2016

Modified Files:
src/sys/arch/arm/omap: files.omap2 omap_edma.c tiotg.c
src/sys/arch/evbarm/conf: BEAGLEBONE

Log Message:
Attach edma and tiotg at mainbus instead of obio0.
And splits obio0 to obio[012], like OMAP3530.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/arm/omap/files.omap2
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/omap/omap_edma.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/omap/tiotg.c
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/evbarm/conf/BEAGLEBONE

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/arm/omap/files.omap2
diff -u src/sys/arch/arm/omap/files.omap2:1.32 src/sys/arch/arm/omap/files.omap2:1.33
--- src/sys/arch/arm/omap/files.omap2:1.32	Mon Nov  2 00:48:45 2015
+++ src/sys/arch/arm/omap/files.omap2	Mon Jul  4 15:35:55 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: files.omap2,v 1.32 2015/11/02 00:48:45 jmcneill Exp $
+#	$NetBSD: files.omap2,v 1.33 2016/07/04 15:35:55 kiyohara Exp $
 #
 # Configuration info for Texas Instruments OMAP2/OMAP3 CPU support
 # Based on xscale/files.pxa2x0
@@ -122,6 +122,17 @@ device	gpmc { [addr=-1], [size=0], [intr
 attach	gpmc at mainbus
 file	arch/arm/omap/omap2_gpmc.c		gpmc
 
+device	edma
+attach	edma at mainbus
+file	arch/arm/omap/omap_edma.c		edma needs-flag
+
+# TI OTG controller
+define  tiotg_port {[port = -1], [mode = -1]}
+device	tiotg: tiotg_port
+attach	tiotg at mainbus
+file	arch/arm/omap/tiotg.c			tiotg
+attach  motg at tiotg_port
+
 # SDMMC controller
 attach	sdhc at obio with obiosdhc
 file	arch/arm/omap/omap3_sdhc.c		obiosdhc
@@ -144,13 +155,6 @@ file	arch/arm/omap/obio_ohci.c		obioohci
 attach	ehci at obio with omap3_ehci
 file	arch/arm/omap/omap3_ehci.c		omap3_ehci
 
-# TI OTG controller
-define  tiotg_port {[port = -1], [mode = -1]}
-device	tiotg: tiotg_port
-attach	tiotg at obio
-file	arch/arm/omap/tiotg.c			tiotg
-attach  motg at tiotg_port
-
 attach	ahcisata at obio with omap5_ahcisata
 file	arch/arm/omap/omap5_ahcisata.c		omap5_ahcisata
 
@@ -171,10 +175,6 @@ device 	omapdma
 attach 	omapdma at obio
 file	arch/arm/omap/omap3_sdma.c		omapdma needs-flag
 
-device	edma
-attach	edma at obio
-file	arch/arm/omap/omap_edma.c		edma needs-flag
-
 device	trng
 attach	trng at obio
 file	arch/arm/omap/am335x_trng.c		trng

Index: src/sys/arch/arm/omap/omap_edma.c
diff -u src/sys/arch/arm/omap/omap_edma.c:1.1 src/sys/arch/arm/omap/omap_edma.c:1.2
--- src/sys/arch/arm/omap/omap_edma.c:1.1	Tue Apr 14 18:37:43 2015
+++ src/sys/arch/arm/omap/omap_edma.c	Mon Jul  4 15:35:55 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: omap_edma.c,v 1.1 2015/04/14 18:37:43 bouyer Exp $ */
+/* $NetBSD: omap_edma.c,v 1.2 2016/07/04 15:35:55 kiyohara Exp $ */
 
 /*-
  * Copyright (c) 2014 Jared D. McNeill 
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: omap_edma.c,v 1.1 2015/04/14 18:37:43 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap_edma.c,v 1.2 2016/07/04 15:35:55 kiyohara Exp $");
 
 #include "opt_omap.h"
 
@@ -39,14 +39,16 @@ __KERNEL_RCSID(0, "$NetBSD: omap_edma.c,
 #include 
 #include 
 
+#include 
+
 #include 
 #include 
 #include 
 #include 
 
 #include 
-#include 
 #include 
+#include 
 
 #ifdef TI_AM335X
 static const struct omap_module edma3cc_module =
@@ -120,12 +122,12 @@ CFATTACH_DECL_NEW(edma, sizeof(struct ed
 static int
 edma_match(device_t parent, cfdata_t match, void *aux)
 {
-	struct obio_attach_args *obio = aux;
+	struct mainbus_attach_args *mb = aux;
 
 #ifdef TI_AM335X
-	if (obio->obio_addr == AM335X_TPCC_BASE &&
-	obio->obio_size == AM335X_TPCC_SIZE &&
-	obio->obio_intrbase == AM335X_INT_EDMACOMPINT)
+	if (mb->mb_iobase == AM335X_TPCC_BASE &&
+	mb->mb_iosize == AM335X_TPCC_SIZE &&
+	mb->mb_intrbase == AM335X_INT_EDMACOMPINT)
 		return 1;
 #endif
 
@@ -136,13 +138,13 @@ static void
 edma_attach(device_t parent, device_t self, void *aux)
 {
 	struct edma_softc *sc = device_private(self);
-	struct obio_attach_args *obio = aux;
+	struct mainbus_attach_args *mb = aux;
 	int idx;
 
 	sc->sc_dev = self;
-	sc->sc_iot = obio->obio_iot;
+	sc->sc_iot = &omap_bs_tag;
 	mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_SCHED);
-	if (bus_space_map(obio->obio_iot, obio->obio_addr, obio->obio_size,
+	if (bus_space_map(sc->sc_iot, mb->mb_iobase, mb->mb_iosize,
 	0, &sc->sc_ioh) != 0) {
 		aprint_error(": couldn't map address spcae\n");
 		return;
@@ -163,13 +165,13 @@ edma_attach(device_t parent, device_t se
 
 	edma_init(sc);
 
-	sc->sc_ih = intr_establish(obio->obio_intrbase + 0,
+	sc->sc_ih = intr_establish(mb->mb_intrbase + 0,
 	IPL_SCHED, IST_LEVEL, edma_intr, sc);
 	KASSERT(sc->sc_ih != NULL);
 
-	sc->sc_mperr_ih = intr_establish(obio->obio_intrbase + 1,
+	sc->sc_mperr_ih = intr_establish(mb->mb_intrbase + 1,
 	IPL_SCHED, IST_LEVEL, edma_mperr_intr, sc);
-	sc->sc_errint_ih = intr_establish(obio->obio_intrbase 

CVS commit: src/sys/arch/arm/omap

2016-07-03 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sun Jul  3 12:27:04 UTC 2016

Modified Files:
src/sys/arch/arm/omap: omap2_obiovar.h omap2_reg.h omap3_scm.c

Log Message:
Print DeviceID in attach().  Also test OMAP35x/AM37x/DM37x.  And add 
omap_devid().
  Tested on OMAP3503, OMAP3530 and AM3703.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/omap/omap2_obiovar.h \
src/sys/arch/arm/omap/omap3_scm.c
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/arm/omap/omap2_reg.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/arm/omap/omap2_obiovar.h
diff -u src/sys/arch/arm/omap/omap2_obiovar.h:1.4 src/sys/arch/arm/omap/omap2_obiovar.h:1.5
--- src/sys/arch/arm/omap/omap2_obiovar.h:1.4	Mon Apr 25 13:14:37 2016
+++ src/sys/arch/arm/omap/omap2_obiovar.h	Sun Jul  3 12:27:04 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: omap2_obiovar.h,v 1.4 2016/04/25 13:14:37 kiyohara Exp $ */
+/* $NetBSD: omap2_obiovar.h,v 1.5 2016/07/03 12:27:04 kiyohara Exp $ */
 
 /*
  * Copyright (c) 2007 Microsoft
@@ -54,5 +54,6 @@ struct obio_softc {
 };
 
 uint32_t omap_chipid(void);
+uint32_t omap_devid(void);
 
 #endif /* _ARM_OMAP_OMAP2_OBIOVAR_H_ */
Index: src/sys/arch/arm/omap/omap3_scm.c
diff -u src/sys/arch/arm/omap/omap3_scm.c:1.4 src/sys/arch/arm/omap/omap3_scm.c:1.5
--- src/sys/arch/arm/omap/omap3_scm.c:1.4	Mon Apr 25 13:14:37 2016
+++ src/sys/arch/arm/omap/omap3_scm.c	Sun Jul  3 12:27:04 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: omap3_scm.c,v 1.4 2016/04/25 13:14:37 kiyohara Exp $ */
+/* $NetBSD: omap3_scm.c,v 1.5 2016/07/03 12:27:04 kiyohara Exp $ */
 
 /*-
  * Copyright (c) 2013 Jared D. McNeill 
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: omap3_scm.c,v 1.4 2016/04/25 13:14:37 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap3_scm.c,v 1.5 2016/07/03 12:27:04 kiyohara Exp $");
 
 #include "opt_omap.h"
 
@@ -47,12 +47,14 @@ __KERNEL_RCSID(0, "$NetBSD: omap3_scm.c,
 
 #define SCM_BASE_3530			0x48002000
 #define SCM_SIZE_3530			0x1000
+#define SCM_CONTROL_IDCODE_3530		0x308204
 #define SCM_OFFSET_INTERFACE_3530	0
 #define SCM_OFFSET_GENERAL_3530		0x270
 
 #if defined(OMAP_3430) || defined(OMAP_3530)
 #define SCM_BASE		SCM_BASE_3530
 #define SCM_SIZE		SCM_SIZE_3530
+#define SCM_CONTROL_IDCODE	SCM_CONTROL_IDCODE_3530
 #define SCM_OFFSET_INTERFACE	SCM_OFFSET_INTERFACE_3530
 #define SCM_OFFSET_GENERAL	SCM_OFFSET_GENERAL_3530
 #endif
@@ -105,7 +107,8 @@ struct omap3_scm_softc {
 	bus_space_tag_t		sc_iot;
 	bus_space_handle_t	sc_ioh;
 
-	uint32_t		sc_cid;
+	uint32_t		sc_cid;	/* Chip Identification */
+	uint32_t		sc_did;	/* Device IDCODE */
 
 	/* GENERAL */
 	struct sysmon_envsys	*sc_sme;
@@ -143,9 +146,28 @@ omap3_scm_attach(device_t parent, device
 {
 	struct omap3_scm_softc *sc = device_private(self);
 	struct obio_attach_args *obio = opaque;
+	bus_space_handle_t ioh;
 	uint32_t rev;
 	char buf[256];
-	const char *cid;
+	const char *cid, *did, *fmt;
+	const char *omap35x_fmt = "\177\020"
+	"b\0TO_OUT\0"
+	"b\1four_bit_mmc\0"
+	"b\2CCP2_CSI1\0"
+	"b\3CMADS_FL3G\0"
+	"b\4NEON_VFPLite\0"
+	"b\5ISP_disable\0"
+	"f\6\2IVA2_MHz\0=\0 430\0=\2 266\0"
+	"f\10\2ARM_MHz\0=\0 600\0=\1 400\0=\2 266\0"
+	"f\12\2MPU_L2_cache_size\0=\0 0KB\0=\1 64KB\0=\2 128KB\0=\3 Full\0"
+	"b\14IVA_disable_acc\0"
+	"f\15\2SGX_scalable_control\0=\0Full\0=\1Half\0=\2not-present\0\0";
+	const char *amdm37x_fmt = "\177\020"
+	"f\0\4Feature Tiering\0=\0All features aval\0=\1ISP not avail\0"
+	"f\11\1MPU/IVA frequency\0=\0 800/600 MHz\0=\1 1000/800 MHz\0"
+	"f\12\2MPU_L2_cache_size\0=\0 0KB\0=\2 128KB\0=\3 Full\0"
+	"f\14\1IVA 2.2 subsystem\0=\0Full use\0=\1Not available\0"
+	"f\15\2 2D/3D accelerator\0=\0Full use\0=\2HW not present\0";
 
 	aprint_naive("\n");
 
@@ -159,32 +181,83 @@ omap3_scm_attach(device_t parent, device
 		aprint_error(": couldn't map address space\n");
 		return;
 	}
+	if (bus_space_map(obio->obio_iot,
+	obio->obio_addr + SCM_CONTROL_IDCODE, sizeof(uint32_t),
+	0, &ioh) != 0) {
+		aprint_error(": couldn't map CONTROL_IDCODE space\n");
+		return;
+	}
+	sc->sc_did = bus_space_read_4(sc->sc_iot, ioh, 0);
+	bus_space_unmap(sc->sc_iot, ioh, sizeof(uint32_t));
 
 	rev = SCM_READ_REG(sc, CONTROL_REVISION);
 	aprint_normal(": rev. 0x%x\n", rev & 0xff);
 	sc->sc_cid = SCM_READ_REG(sc, CONTROL_OMAP_STATUS & 0x);
-	switch (sc->sc_cid) {
-	case CHIPID_OMAP3503:	cid = "OMAP3503";	break;
-	case CHIPID_OMAP3515:	cid = "OMAP3515";	break;
-	case CHIPID_OMAP3525:	cid = "OMAP3525";	break;
-	case CHIPID_OMAP3530:	cid = "OMAP3530";	break;
-	default:		cid = "unknwon";	break;
+	cid = did = fmt = NULL;
+	switch (sc->sc_did) {
+	case DEVID_OMAP35X_ES10:
+	case DEVID_OMAP35X_ES20:
+	case DEVID_OMAP35X_ES21:
+	case DEVID_OMAP35X_ES30:
+	case DEVID_OMAP35X_ES31:
+	case DEVID_OMAP35X_ES312:
+		switch (sc->sc_cid) {
+		case CHIPID_OMAP3503:	cid = "OMAP3503";	

CVS commit: src/sys/dev/sdmmc

2016-07-03 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sun Jul  3 11:55:27 UTC 2016

Modified Files:
src/sys/dev/sdmmc: sdhc.c

Log Message:
Please more delay, if timeout in sdhc_wait_intr().


To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.94 src/sys/dev/sdmmc/sdhc.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/dev/sdmmc/sdhc.c
diff -u src/sys/dev/sdmmc/sdhc.c:1.93 src/sys/dev/sdmmc/sdhc.c:1.94
--- src/sys/dev/sdmmc/sdhc.c:1.93	Thu Dec 31 11:53:19 2015
+++ src/sys/dev/sdmmc/sdhc.c	Sun Jul  3 11:55:27 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdhc.c,v 1.93 2015/12/31 11:53:19 ryo Exp $	*/
+/*	$NetBSD: sdhc.c,v 1.94 2016/07/03 11:55:27 kiyohara Exp $	*/
 /*	$OpenBSD: sdhc.c,v 1.25 2009/01/13 19:44:20 grange Exp $	*/
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.93 2015/12/31 11:53:19 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.94 2016/07/03 11:55:27 kiyohara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -1532,6 +1532,7 @@ sdhc_exec_command(sdmmc_chipset_handle_t
 	probing = (cmd->c_flags & SCF_TOUT_OK) != 0;
 	if (!sdhc_wait_intr(hp, SDHC_COMMAND_COMPLETE, SDHC_COMMAND_TIMEOUT, probing)) {
 		DPRINTF(1,("%s: timeout for command\n", __func__));
+		sdmmc_delay(50);
 		cmd->c_error = ETIMEDOUT;
 		goto out;
 	}



CVS commit: src/sys

2016-07-03 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sun Jul  3 11:40:58 UTC 2016

Modified Files:
src/sys/arch/evbarm/beagle: beagle_machdep.c
src/sys/dev/i2c: files.i2c

Log Message:
Add 'needs-flag' to tps65217pmic.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/evbarm/beagle/beagle_machdep.c
cvs rdiff -u -r1.71 -r1.72 src/sys/dev/i2c/files.i2c

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/beagle/beagle_machdep.c
diff -u src/sys/arch/evbarm/beagle/beagle_machdep.c:1.63 src/sys/arch/evbarm/beagle/beagle_machdep.c:1.64
--- src/sys/arch/evbarm/beagle/beagle_machdep.c:1.63	Sun Jul  3 11:25:27 2016
+++ src/sys/arch/evbarm/beagle/beagle_machdep.c	Sun Jul  3 11:40:58 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: beagle_machdep.c,v 1.63 2016/07/03 11:25:27 kiyohara Exp $ */
+/*	$NetBSD: beagle_machdep.c,v 1.64 2016/07/03 11:40:58 kiyohara Exp $ */
 
 /*
  * Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,7 +125,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: beagle_machdep.c,v 1.63 2016/07/03 11:25:27 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: beagle_machdep.c,v 1.64 2016/07/03 11:40:58 kiyohara Exp $");
 
 #include "opt_machdep.h"
 #include "opt_ddb.h"
@@ -141,6 +141,7 @@ __KERNEL_RCSID(0, "$NetBSD: beagle_machd
 #include "sdhc.h"
 #include "ukbd.h"
 #include "arml2cc.h"
+#include "tps65217pmic.h"
 
 #include 
 #include 
@@ -1125,10 +1126,15 @@ beagle_device_register(device_t self, vo
 int
 set_mpu_volt(int mvolt)
 {
+
+#if NTPS65217PMIC > 0
 	if (pmic_dev == NULL)
 		return ENODEV;
 
 	/* MPU voltage is on vdcd2 */
 	return tps65217pmic_set_volt(pmic_dev, "DCDC2", mvolt);
+#else
+	return -1;
+#endif
 }
 #endif

Index: src/sys/dev/i2c/files.i2c
diff -u src/sys/dev/i2c/files.i2c:1.71 src/sys/dev/i2c/files.i2c:1.72
--- src/sys/dev/i2c/files.i2c:1.71	Mon Jun 20 04:18:12 2016
+++ src/sys/dev/i2c/files.i2c	Sun Jul  3 11:40:58 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: files.i2c,v 1.71 2016/06/20 04:18:12 pgoyette Exp $
+#	$NetBSD: files.i2c,v 1.72 2016/07/03 11:40:58 kiyohara Exp $
 
 obsolete defflag	opt_i2cbus.h		I2C_SCAN
 define	i2cbus { }
@@ -204,7 +204,7 @@ file	dev/i2c/tps65950.c		tps65950pm
 # TI TPS65217
 device	tps65217pmic: sysmon_envsys
 attach	tps65217pmic at iic
-file	dev/i2c/tps65217pmic.c 		tps65217pmic
+file	dev/i2c/tps65217pmic.c 		tps65217pmic	needs-flag
 
 # Microchip MCP980x
 device	mcp980x: sysmon_envsys



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

2016-07-03 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sun Jul  3 11:25:27 UTC 2016

Modified Files:
src/sys/arch/evbarm/beagle: beagle_machdep.c

Log Message:
No need beagle_putchar(), if not defined VERBOSE_INIT_ARM.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/evbarm/beagle/beagle_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/beagle/beagle_machdep.c
diff -u src/sys/arch/evbarm/beagle/beagle_machdep.c:1.62 src/sys/arch/evbarm/beagle/beagle_machdep.c:1.63
--- src/sys/arch/evbarm/beagle/beagle_machdep.c:1.62	Mon Nov  2 22:21:26 2015
+++ src/sys/arch/evbarm/beagle/beagle_machdep.c	Sun Jul  3 11:25:27 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: beagle_machdep.c,v 1.62 2015/11/02 22:21:26 jmcneill Exp $ */
+/*	$NetBSD: beagle_machdep.c,v 1.63 2016/07/03 11:25:27 kiyohara Exp $ */
 
 /*
  * Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,7 +125,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: beagle_machdep.c,v 1.62 2015/11/02 22:21:26 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: beagle_machdep.c,v 1.63 2016/07/03 11:25:27 kiyohara Exp $");
 
 #include "opt_machdep.h"
 #include "opt_ddb.h"
@@ -421,6 +421,7 @@ beagle_db_trap(int where)
 }
 #endif
 
+#ifdef VERBOSE_INIT_ARM
 void beagle_putchar(char c);
 void
 beagle_putchar(char c)
@@ -442,6 +443,9 @@ beagle_putchar(char c)
 	}
 #endif
 }
+#else
+#define beagle_putchar(c)	((void)0)
+#endif
 
 /*
  * u_int initarm(...)



CVS commit: src/sys/arch/arm/omap

2016-04-25 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Mon Apr 25 13:20:42 UTC 2016

Modified Files:
src/sys/arch/arm/omap: omap3_sdhc.c

Log Message:
Check ChipID == OMAP3530.  OVERO supports both OMAP3530/3503.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/omap/omap3_sdhc.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/arm/omap/omap3_sdhc.c
diff -u src/sys/arch/arm/omap/omap3_sdhc.c:1.19 src/sys/arch/arm/omap/omap3_sdhc.c:1.20
--- src/sys/arch/arm/omap/omap3_sdhc.c:1.19	Mon Nov  2 22:21:01 2015
+++ src/sys/arch/arm/omap/omap3_sdhc.c	Mon Apr 25 13:20:42 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: omap3_sdhc.c,v 1.19 2015/11/02 22:21:01 jmcneill Exp $	*/
+/*	$NetBSD: omap3_sdhc.c,v 1.20 2016/04/25 13:20:42 kiyohara Exp $	*/
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: omap3_sdhc.c,v 1.19 2015/11/02 22:21:01 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap3_sdhc.c,v 1.20 2016/04/25 13:20:42 kiyohara Exp $");
 
 #include "opt_omap.h"
 #include "edma.h"
@@ -227,7 +227,8 @@ obiosdhc_attach(device_t parent, device_
 	sc->sc.sc_flags &= ~SDHC_FLAG_SINGLE_ONLY;
 #endif
 #if defined(OMAP_3530)
-	sc->sc.sc_flags &= ~SDHC_FLAG_SINGLE_ONLY;
+	if (omap_chipid() == CHIPID_OMAP3530)
+		sc->sc.sc_flags &= ~SDHC_FLAG_SINGLE_ONLY;
 #endif
 	sc->sc.sc_host = sc->sc_hosts;
 	sc->sc.sc_clkbase = 96000;	/* 96MHZ */



CVS commit: src/sys/arch/arm/omap

2016-04-25 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Mon Apr 25 13:17:16 UTC 2016

Modified Files:
src/sys/arch/arm/omap: omap2_obio.c

Log Message:
Add omapscm to critical_devs[].


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/arm/omap/omap2_obio.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/arm/omap/omap2_obio.c
diff -u src/sys/arch/arm/omap/omap2_obio.c:1.22 src/sys/arch/arm/omap/omap2_obio.c:1.23
--- src/sys/arch/arm/omap/omap2_obio.c:1.22	Tue Apr 14 18:37:43 2015
+++ src/sys/arch/arm/omap/omap2_obio.c	Mon Apr 25 13:17:16 2016
@@ -1,7 +1,7 @@
-/*	$Id: omap2_obio.c,v 1.22 2015/04/14 18:37:43 bouyer Exp $	*/
+/*	$Id: omap2_obio.c,v 1.23 2016/04/25 13:17:16 kiyohara Exp $	*/
 
 /* adapted from: */
-/*	$NetBSD: omap2_obio.c,v 1.22 2015/04/14 18:37:43 bouyer Exp $ */
+/*	$NetBSD: omap2_obio.c,v 1.23 2016/04/25 13:17:16 kiyohara Exp $ */
 
 
 /*
@@ -103,7 +103,7 @@
 
 #include "opt_omap.h"
 #include 
-__KERNEL_RCSID(0, "$NetBSD: omap2_obio.c,v 1.22 2015/04/14 18:37:43 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap2_obio.c,v 1.23 2016/04/25 13:17:16 kiyohara Exp $");
 
 #include "locators.h"
 #include "obio.h"
@@ -366,6 +366,9 @@ static const struct {
 	bus_addr_t addr;
 	bool required;
 } critical_devs[] = {
+#if defined(OMAP_3530)
+	{ .name = "omapscm", .addr = 0x48002000, .required = true },
+#endif
 #if defined(OMAP_2430) || defined(OMAP_2420)
 	{ .name = "avic", .addr = INTC_BASE, .required = true },
 #endif



CVS commit: src/sys/arch/arm/omap

2016-04-25 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Mon Apr 25 13:14:37 UTC 2016

Modified Files:
src/sys/arch/arm/omap: omap2_obiovar.h omap3_scm.c

Log Message:
Add function omap_chipid().


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/omap/omap2_obiovar.h \
src/sys/arch/arm/omap/omap3_scm.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/arm/omap/omap2_obiovar.h
diff -u src/sys/arch/arm/omap/omap2_obiovar.h:1.3 src/sys/arch/arm/omap/omap2_obiovar.h:1.4
--- src/sys/arch/arm/omap/omap2_obiovar.h:1.3	Tue Apr 14 18:37:43 2015
+++ src/sys/arch/arm/omap/omap2_obiovar.h	Mon Apr 25 13:14:37 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: omap2_obiovar.h,v 1.3 2015/04/14 18:37:43 bouyer Exp $ */
+/* $NetBSD: omap2_obiovar.h,v 1.4 2016/04/25 13:14:37 kiyohara Exp $ */
 
 /*
  * Copyright (c) 2007 Microsoft
@@ -53,4 +53,6 @@ struct obio_softc {
 	device_t		sc_obio_dev;
 };
 
+uint32_t omap_chipid(void);
+
 #endif /* _ARM_OMAP_OMAP2_OBIOVAR_H_ */
Index: src/sys/arch/arm/omap/omap3_scm.c
diff -u src/sys/arch/arm/omap/omap3_scm.c:1.3 src/sys/arch/arm/omap/omap3_scm.c:1.4
--- src/sys/arch/arm/omap/omap3_scm.c:1.3	Mon Apr 25 13:07:03 2016
+++ src/sys/arch/arm/omap/omap3_scm.c	Mon Apr 25 13:14:37 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: omap3_scm.c,v 1.3 2016/04/25 13:07:03 kiyohara Exp $ */
+/* $NetBSD: omap3_scm.c,v 1.4 2016/04/25 13:14:37 kiyohara Exp $ */
 
 /*-
  * Copyright (c) 2013 Jared D. McNeill 
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: omap3_scm.c,v 1.3 2016/04/25 13:07:03 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap3_scm.c,v 1.4 2016/04/25 13:14:37 kiyohara Exp $");
 
 #include "opt_omap.h"
 
@@ -254,3 +254,15 @@ omap3_scm_sensor_refresh(struct sysmon_e
 		edata->state = ENVSYS_SVALID;
 	}
 }
+
+uint32_t
+omap_chipid(void)
+{
+	struct omap3_scm_softc *sc;
+	device_t dev;
+
+	dev = device_find_by_xname("omapscm0");
+	KASSERT(dev != NULL);
+	sc = device_private(dev);
+	return sc->sc_cid;
+}



CVS commit: src/sys/arch/arm/omap

2016-04-25 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Mon Apr 25 13:07:03 UTC 2016

Modified Files:
src/sys/arch/arm/omap: omap2_reg.h omap3_scm.c

Log Message:
Print OMAP3 ChipID.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/arm/omap/omap2_reg.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/omap/omap3_scm.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/arm/omap/omap2_reg.h
diff -u src/sys/arch/arm/omap/omap2_reg.h:1.30 src/sys/arch/arm/omap/omap2_reg.h:1.31
--- src/sys/arch/arm/omap/omap2_reg.h:1.30	Sat Jun  6 14:00:32 2015
+++ src/sys/arch/arm/omap/omap2_reg.h	Mon Apr 25 13:07:03 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: omap2_reg.h,v 1.30 2015/06/06 14:00:32 jmcneill Exp $ */
+/* $NetBSD: omap2_reg.h,v 1.31 2016/04/25 13:07:03 kiyohara Exp $ */
 
 /*
  * Copyright (c) 2007 Microsoft
@@ -141,6 +141,12 @@
 #define	TI_DM37XX_L4_EMULATION_BASE	0x5400
 #define	TI_DM37XX_L4_EMULATION_SIZE	0x0080	/* 8MB */
 
+
+#define CHIPID_OMAP3503		0x5c00
+#define CHIPID_OMAP3515		0x1c00
+#define CHIPID_OMAP3525		0x4c00
+#define CHIPID_OMAP3530		0x0c00
+
 /*
  * Clock Management registers base, offsets, and size
  */

Index: src/sys/arch/arm/omap/omap3_scm.c
diff -u src/sys/arch/arm/omap/omap3_scm.c:1.2 src/sys/arch/arm/omap/omap3_scm.c:1.3
--- src/sys/arch/arm/omap/omap3_scm.c:1.2	Wed Mar 13 03:08:17 2013
+++ src/sys/arch/arm/omap/omap3_scm.c	Mon Apr 25 13:07:03 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: omap3_scm.c,v 1.2 2013/03/13 03:08:17 khorben Exp $ */
+/* $NetBSD: omap3_scm.c,v 1.3 2016/04/25 13:07:03 kiyohara Exp $ */
 
 /*-
  * Copyright (c) 2013 Jared D. McNeill 
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: omap3_scm.c,v 1.2 2013/03/13 03:08:17 khorben Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap3_scm.c,v 1.3 2016/04/25 13:07:03 kiyohara Exp $");
 
 #include "opt_omap.h"
 
@@ -67,6 +67,8 @@ __KERNEL_RCSID(0, "$NetBSD: omap3_scm.c,
 #define CONTROL_TEMP_SENSOR_EOCZ	__BIT(7)
 #define CONTROL_TEMP_SENSOR_TEMP_MASK	__BITS(6,0)
 
+#define CONTROL_OMAP_STATUS		0x44c
+
 /* CONTROL_TEMP_SENSOR TEMP bits to tenths of a degree */
 static const int omap3_scm_adc2temp[128] = {
 	-400, -400, -400, -400, -400,
@@ -103,6 +105,8 @@ struct omap3_scm_softc {
 	bus_space_tag_t		sc_iot;
 	bus_space_handle_t	sc_ioh;
 
+	uint32_t		sc_cid;
+
 	/* GENERAL */
 	struct sysmon_envsys	*sc_sme;
 	envsys_data_t		sc_sensor;
@@ -140,6 +144,8 @@ omap3_scm_attach(device_t parent, device
 	struct omap3_scm_softc *sc = device_private(self);
 	struct obio_attach_args *obio = opaque;
 	uint32_t rev;
+	char buf[256];
+	const char *cid;
 
 	aprint_naive("\n");
 
@@ -156,6 +162,29 @@ omap3_scm_attach(device_t parent, device
 
 	rev = SCM_READ_REG(sc, CONTROL_REVISION);
 	aprint_normal(": rev. 0x%x\n", rev & 0xff);
+	sc->sc_cid = SCM_READ_REG(sc, CONTROL_OMAP_STATUS & 0x);
+	switch (sc->sc_cid) {
+	case CHIPID_OMAP3503:	cid = "OMAP3503";	break;
+	case CHIPID_OMAP3515:	cid = "OMAP3515";	break;
+	case CHIPID_OMAP3525:	cid = "OMAP3525";	break;
+	case CHIPID_OMAP3530:	cid = "OMAP3530";	break;
+	default:		cid = "unknwon";	break;
+	}
+	aprint_normal_dev(self, "%s: ", cid);
+	snprintb(buf, sizeof(buf), "\177\020"
+	"b\0TO_OUT\0"
+	"b\1four_bit_mmc\0"
+	"b\2CCP2_CSI1\0"
+	"b\3CMADS_FL3G\0"
+	"b\4NEON_VFPLite\0"
+	"b\5ISP_disable\0"
+	"f\6\2IVA2_MHz\0=\0 430\0=\2 266\0"
+	"f\10\2ARM_MHz\0=\0 600\0=\1 400\0=\2 266\0"
+	"f\12\2MPU_L2_cache_size\0=\0 0KB\0=\1 64KB\0=\2 128KB\0=\3 Full\0"
+	"b\14IVA_disable_acc\0"
+	"f\15\2SGX_scalable_control\0=\0Full\0=\1Half\0=\2not-present\0\0",
+	sc->sc_cid);
+	aprint_normal("%s\n", buf);
 
 	omap3_scm_sensor_attach(sc);
 }



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

2016-04-19 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Apr 19 12:02:56 UTC 2016

Modified Files:
src/sys/arch/evbarm/conf: mk.gumstix

Log Message:
OVERO's .ub file includes release


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbarm/conf/mk.gumstix

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/conf/mk.gumstix
diff -u src/sys/arch/evbarm/conf/mk.gumstix:1.4 src/sys/arch/evbarm/conf/mk.gumstix:1.5
--- src/sys/arch/evbarm/conf/mk.gumstix:1.4	Thu Jun 30 18:20:24 2011
+++ src/sys/arch/evbarm/conf/mk.gumstix	Tue Apr 19 12:02:55 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: mk.gumstix,v 1.4 2011/06/30 18:20:24 matt Exp $
+#	$NetBSD: mk.gumstix,v 1.5 2016/04/19 12:02:55 kiyohara Exp $
 
 SYSTEM_FIRST_OBJ=	gumstix_start.o
 SYSTEM_FIRST_SFILE=	${THISARM}/gumstix/gumstix_start.S
@@ -18,25 +18,25 @@ MKUBOOTIMAGEARGS+=	-n "NetBSD/$(BOARDTYP
 MKUBOOTIMAGEARGS_NONE=	${MKUBOOTIMAGEARGS} -C none
 MKUBOOTIMAGEARGS_GZ=	${MKUBOOTIMAGEARGS} -C gz
 
-#
-# U-boot that operates with old basix/connex has some bugs.
-#
 SYSTEM_LD_TAIL_EXTRA+=; \
 	echo ${OBJCOPY} -S -O binary $@ $@.bin; \
 	${OBJCOPY} -S -O binary $@ $@.bin; \
+	echo ${TOOL_MKUBOOTIMAGE} ${MKUBOOTIMAGEARGS_NONE} $@.bin $@.ub; \
+	${TOOL_MKUBOOTIMAGE} ${MKUBOOTIMAGEARGS_NONE} $@.bin $@.ub; \
 	echo ${TOOL_GZIP} -c $@.bin > $@.bin.gz; \
 	${TOOL_GZIP} -c $@.bin > $@.bin.gz; \
 	echo ${TOOL_MKUBOOTIMAGE} ${MKUBOOTIMAGEARGS_GZ} $@.bin.gz $@.gz.ub; \
 	${TOOL_MKUBOOTIMAGE} ${MKUBOOTIMAGEARGS_GZ} $@.bin.gz $@.gz.ub
 
+#
+# U-boot that operates with old basix/connex has some bugs.
+#
 .if ${BOARDTYPE} == "gumstix"
 	#
 	# These not have expanding buffer over 4Mbyte. (before version 1.1.5)
 	# And these cannot handle the endian of entry point. (1.1.4 and older)
 	#
 SYSTEM_LD_TAIL_EXTRA+=; \
-	echo ${TOOL_MKUBOOTIMAGE} ${MKUBOOTIMAGEARGS_NONE} $@.bin $@.ub; \
-	${TOOL_MKUBOOTIMAGE} ${MKUBOOTIMAGEARGS_NONE} $@.bin $@.ub; \
 	echo ${TOOL_MKUBOOTIMAGE} ${MKUBOOTIMAGEARGS_NONE:C/((-a (0x)*)([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2}))/\1 -e \3\7\6\5\4/W} $@.bin $@-old.ub; \
 	${TOOL_MKUBOOTIMAGE} ${MKUBOOTIMAGEARGS_NONE:C/((-a (0x)*)([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2}))/\1 -e \3\7\6\5\4/W} $@.bin $@-old.ub
 .endif



  1   2   3   4   5   6   7   8   >