Module Name:    src
Committed By:   matt
Date:           Wed Aug 29 17:48:17 UTC 2012

Modified Files:
        src/sys/arch/arm/omap: files.omap2 omap2_gpio.c omap2_gpmcreg.h
            omap2_intr.h omap2_obioreg.h omap2_reg.h

Log Message:
Add some more OMAP4430 support.
Add defines needed to determine clock rates of OMAP3530/TIAM37XX and
OMAP4430.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/omap/files.omap2
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/omap/omap2_gpio.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/omap/omap2_gpmcreg.h \
    src/sys/arch/arm/omap/omap2_intr.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/omap/omap2_obioreg.h
cvs rdiff -u -r1.9 -r1.10 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/files.omap2
diff -u src/sys/arch/arm/omap/files.omap2:1.13 src/sys/arch/arm/omap/files.omap2:1.14
--- src/sys/arch/arm/omap/files.omap2:1.13	Wed Aug 22 22:18:21 2012
+++ src/sys/arch/arm/omap/files.omap2	Wed Aug 29 17:48:17 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: files.omap2,v 1.13 2012/08/22 22:18:21 matt Exp $
+#	$NetBSD: files.omap2,v 1.14 2012/08/29 17:48:17 matt Exp $
 #
 # Configuration info for Texas Instruments OMAP2/OMAP3 CPU support
 # Based on xscale/files.pxa2x0
@@ -39,7 +39,7 @@ file	arch/arm/arm/bus_space_a4x.S		obio
 device	omapicu: pic, pic_splfuncs
 attach	omapicu at obio with omap2icu
 file	arch/arm/omap/omap2_icu.c		(omap2 | omap3) & omapicu
-file	arch/arm/omap/omap2430_intr.c		omap2 & !omapicu
+file	arch/arm/omap/omap2430_intr.c		omap2 & !omapicu & !omap4
 
 # OMAP2 GPIO controllers
 device	omapgpio: gpiobus

Index: src/sys/arch/arm/omap/omap2_gpio.c
diff -u src/sys/arch/arm/omap/omap2_gpio.c:1.10 src/sys/arch/arm/omap/omap2_gpio.c:1.11
--- src/sys/arch/arm/omap/omap2_gpio.c:1.10	Wed Aug 22 22:18:21 2012
+++ src/sys/arch/arm/omap/omap2_gpio.c	Wed Aug 29 17:48:17 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: omap2_gpio.c,v 1.10 2012/08/22 22:18:21 matt Exp $	*/
+/*	$NetBSD: omap2_gpio.c,v 1.11 2012/08/29 17:48:17 matt Exp $	*/
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -28,7 +28,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: omap2_gpio.c,v 1.10 2012/08/22 22:18:21 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap2_gpio.c,v 1.11 2012/08/29 17:48:17 matt Exp $");
 
 #define _INTR_PRIVATE
 
@@ -348,6 +348,17 @@ gpio_match(device_t parent, cfdata_t cfd
 	    || oa->obio_addr == GPIO6_BASE_3530)
 		return 1;
 #endif
+
+#ifdef OMAP_4430
+	if (oa->obio_addr == GPIO1_BASE_4430
+	    || oa->obio_addr == GPIO2_BASE_4430
+	    || oa->obio_addr == GPIO3_BASE_4430
+	    || oa->obio_addr == GPIO4_BASE_4430
+	    || oa->obio_addr == GPIO5_BASE_4430
+	    || oa->obio_addr == GPIO6_BASE_4430)
+		return 1;
+#endif
+
 #ifdef TI_AM335X
 	if (oa->obio_addr == GPIO0_BASE_TI_AM335X
 	    || oa->obio_addr == GPIO1_BASE_TI_AM335X
@@ -355,6 +366,7 @@ gpio_match(device_t parent, cfdata_t cfd
 	    || oa->obio_addr == GPIO3_BASE_TI_AM335X)
 		return 1;
 #endif
+
 #ifdef TI_DM37XX
 	if (oa->obio_addr == GPIO1_BASE_TI_DM37XX
 	    || oa->obio_addr == GPIO2_BASE_TI_DM37XX

Index: src/sys/arch/arm/omap/omap2_gpmcreg.h
diff -u src/sys/arch/arm/omap/omap2_gpmcreg.h:1.7 src/sys/arch/arm/omap/omap2_gpmcreg.h:1.8
--- src/sys/arch/arm/omap/omap2_gpmcreg.h:1.7	Wed Aug 22 22:18:21 2012
+++ src/sys/arch/arm/omap/omap2_gpmcreg.h	Wed Aug 29 17:48:17 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: omap2_gpmcreg.h,v 1.7 2012/08/22 22:18:21 matt Exp $	*/
+/*	$NetBSD: omap2_gpmcreg.h,v 1.8 2012/08/29 17:48:17 matt Exp $	*/
 /*
  * Copyright (c) 2007 Microsoft
  * All rights reserved.
@@ -47,7 +47,7 @@
 #ifdef OMAP_3530
 #define GPMC_BASE			0x6e000000
 #endif
-#ifdef TI_AM335X
+#if defined(TI_AM335X) || defined(OMAP_4430)
 #define GPMC_BASE			0x50000000
 #endif
 #ifdef TI_DM37XX
Index: src/sys/arch/arm/omap/omap2_intr.h
diff -u src/sys/arch/arm/omap/omap2_intr.h:1.7 src/sys/arch/arm/omap/omap2_intr.h:1.8
--- src/sys/arch/arm/omap/omap2_intr.h:1.7	Sat Jul 14 07:42:57 2012
+++ src/sys/arch/arm/omap/omap2_intr.h	Wed Aug 29 17:48:17 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: omap2_intr.h,v 1.7 2012/07/14 07:42:57 matt Exp $ */
+/*	$NetBSD: omap2_intr.h,v 1.8 2012/08/29 17:48:17 matt Exp $ */
 
 /*
  * Define the SDP2430 specific information and then include the generic OMAP
@@ -39,11 +39,10 @@
 #include <arm/cpufunc.h>
 #endif
 
-#if defined(OMAP2) || defined(OMAP3)
-#include <arm/omap/omap2430_intr.h>
-#endif
 #if defined(OMAP_4430)
 #include <arm/omap/omap4430_intr.h>
+#elif defined(OMAP2) || defined(OMAP3)
+#include <arm/omap/omap2430_intr.h>
 #endif
 
 #ifndef _LOCORE

Index: src/sys/arch/arm/omap/omap2_obioreg.h
diff -u src/sys/arch/arm/omap/omap2_obioreg.h:1.5 src/sys/arch/arm/omap/omap2_obioreg.h:1.6
--- src/sys/arch/arm/omap/omap2_obioreg.h:1.5	Wed Aug 22 22:18:21 2012
+++ src/sys/arch/arm/omap/omap2_obioreg.h	Wed Aug 29 17:48:17 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: omap2_obioreg.h,v 1.5 2012/08/22 22:18:21 matt Exp $	*/
+/*	$NetBSD: omap2_obioreg.h,v 1.6 2012/08/29 17:48:17 matt Exp $	*/
 
 /*
  * Copyright (c) 2007 Microsoft
@@ -74,6 +74,28 @@
 #define	GPIO3_BASE		GPIO3_BASE_3530
 #define	GPIO4_BASE		GPIO4_BASE_3530
 #define	GPIO5_BASE		GPIO5_BASE_3530
+#define	GPIO6_BASE		GPIO6_BASE_3530
+#endif
+
+#if defined(OMAP_4430)
+#define	OMAP2_OBIO_0_BASE	OMAP4430_L4_CORE_BASE
+#define	OMAP2_OBIO_0_SIZE	OMAP4430_L4_CORE_SIZE
+
+#define	OMAP2_OBIO_1_BASE	OMAP4430_L4_WAKEUP_BASE
+#define	OMAP2_OBIO_1_SIZE	OMAP4430_L4_WAKEUP_SIZE
+
+#define	OMAP2_OBIO_2_BASE	OMAP4430_L4_PERIPHERAL_BASE
+#define	OMAP2_OBIO_2_SIZE	OMAP4430_L4_PERIPHERAL_SIZE
+
+#define	OMAP2_OBIO_3_BASE	OMAP4430_L4_ABE_BASE
+#define	OMAP2_OBIO_3_SIZE	OMAP4430_L4_ABE_SIZE
+
+#define	GPIO1_BASE		GPIO1_BASE_4430
+#define	GPIO2_BASE		GPIO2_BASE_4430
+#define	GPIO3_BASE		GPIO3_BASE_4430
+#define	GPIO4_BASE		GPIO4_BASE_4430
+#define	GPIO5_BASE		GPIO5_BASE_4430
+#define	GPIO6_BASE		GPIO6_BASE_4430
 #endif
 
 #if defined(TI_AM335X)

Index: src/sys/arch/arm/omap/omap2_reg.h
diff -u src/sys/arch/arm/omap/omap2_reg.h:1.9 src/sys/arch/arm/omap/omap2_reg.h:1.10
--- src/sys/arch/arm/omap/omap2_reg.h:1.9	Fri Aug 24 06:34:08 2012
+++ src/sys/arch/arm/omap/omap2_reg.h	Wed Aug 29 17:48:17 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: omap2_reg.h,v 1.9 2012/08/24 06:34:08 matt Exp $ */
+/* $NetBSD: omap2_reg.h,v 1.10 2012/08/29 17:48:17 matt Exp $ */
 
 /*
  * Copyright (c) 2007 Microsoft
@@ -61,17 +61,17 @@
 
 /* OMAP4 processors */
 
-#define OMAP4430_L4_CORE_BASE		0x48000000
-#define OMAP4430_L4_CORE_SIZE		0x01000000	/* 16 MB */
+#define OMAP4430_L4_CORE_BASE		0x4A000000
+#define OMAP4430_L4_CORE_SIZE		0x01000000	/* 16MB - CFG */
 
 #define OMAP4430_L4_WAKEUP_BASE		0x4A300000
 #define OMAP4430_L4_WAKEUP_SIZE		0x00040000	/* 256KB */
 
 #define OMAP4430_L4_PERIPHERAL_BASE	0x49000000
-#define OMAP4430_L4_PERIPHERAL_SIZE	0x00100000	/* 1MB of 16MB */
+#define OMAP4430_L4_PERIPHERAL_SIZE	0x01000000	/* 16MB */
 
-#define OMAP4430_L4_EMULATION_BASE	0x54000000	/* Actually L3 */
-#define OMAP4430_L4_EMULATION_SIZE	0x00800000	/* 8MB */
+#define OMAP4430_L4_ABE_BASE		0x40000000	/* Actually L3 */
+#define OMAP4430_L4_ABE_SIZE		0x01000000	/* 16MB */
 
 /* TI Sitara AM335x (OMAP like) */
 
@@ -282,12 +282,25 @@
 #define	OMAP3_CM_CLKSEL1_PLL_MPU	0x940
 #define	OMAP3_CM_CLKSEL2_PLL_MPU	0x944
 
-#define	OMAP3_CM_CLKSEL1_PLL_MPU_CLK_SRC	__BITS(21,9)
+#define	OMAP3_CM_CLKSEL1_PLL_MPU_CLK_SRC	__BITS(21,19)
 #define	OMAP3_CM_CLKSEL1_PLL_MPU_DPLL_MULT	__BITS(18,8)
 #define	OMAP3_CM_CLKSEL1_PLL_MPU_DPLL_DIV	__BITS(6,0)
 
 #define	OMAP3_CM_CLKSEL2_PLL_MPU_DPLL_CLKOUT_DIV	__BITS(4,0)
 
+#define	OMAP4_CM_SYS_CLKSEL		0x110
+#define	OMAP4_CM_CLKSEL_DPLL_MPU	0x16c
+#define	OMAP4_CM_DIV_M2_DPLL_MPU	0x170
+
+#define	OMAP4_CM_SYS_CLKSEL_CLKIN	__BITS(2,0)
+#define OMAP4_CM_CLKSEL_FREQS	{ 0, 12000, 13000, 16800, 19200, 26000, 27000, 38400 }
+#define	OMAP4_CM_CLKSEL_MULT	1000
+
+#define	OMAP4_CM_CLKSEL_DPLL_MPU_DCC_EN		__BIT(22)
+#define	OMAP4_CM_CLKSEL_DPLL_MPU_DPLL_MULT	__BITS(18,8)
+#define	OMAP4_CM_CLKSEL_DPLL_MPU_DPLL_DIV	__BITS(6,0)
+
+#define	OMAP4_CM_DIV_M2_DPLL_MPU_DPLL_CLKOUT_DIV	__BITS(4,0)
 /*
  * Power Management registers base, offsets, and size
  */
@@ -295,7 +308,7 @@
 #define	OMAP2_PRM_BASE			0x48306000
 #endif
 #ifdef OMAP_4430
-#define	OMAP2_PRM_BASE			0x4A306000
+#define	OMAP2_PRM_BASE			(OMAP4430_L4_WAKEUP_BASE + 0x6000)
 #endif
 #ifdef TI_AM335X
 #define	OMAP2_PRM_BASE			0x48306000
@@ -599,6 +612,13 @@
 #define	GPIO5_BASE_3530			0x49056000
 #define	GPIO6_BASE_3530			0x49058000
 
+#define	GPIO1_BASE_4430			0x4a310000
+#define	GPIO2_BASE_4430			0x48055000
+#define	GPIO3_BASE_4430			0x48057000
+#define	GPIO4_BASE_4430			0x48059000
+#define	GPIO5_BASE_4430			0x4805b000
+#define	GPIO6_BASE_4430			0x4805d000
+
 #define	GPIO0_BASE_TI_AM335X		0x44e07000
 #define	GPIO1_BASE_TI_AM335X		0x4804c000
 #define	GPIO2_BASE_TI_AM335X		0x481ac000

Reply via email to