Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch First pass as supporting the TI DM37XX which is use...
details: https://anonhg.NetBSD.org/src/rev/803ac593d0e0
branches: trunk
changeset: 781146:803ac593d0e0
user: matt <matt%NetBSD.org@localhost>
date: Wed Aug 22 22:18:21 2012 +0000
description:
First pass as supporting the TI DM37XX which is used in the BeagleBoard-XM.
(compile tested but hasn't been run on an actual board).
diffstat:
sys/arch/arm/omap/files.omap2 | 3 +-
sys/arch/arm/omap/omap2_gpio.c | 13 +-
sys/arch/arm/omap/omap2_gpmcreg.h | 5 +-
sys/arch/arm/omap/omap2_obioreg.h | 23 ++-
sys/arch/arm/omap/omap2_reg.h | 31 ++-
sys/arch/evbarm/beagle/beagle.h | 17 +-
sys/arch/evbarm/beagle/beagle_machdep.c | 8 +-
sys/arch/evbarm/beagle/beagle_start.S | 6 +-
sys/arch/evbarm/conf/BEAGLEBOARDXM | 310 ++++++++++++++++++++++++++++++++
9 files changed, 402 insertions(+), 14 deletions(-)
diffs (truncated from 584 to 300 lines):
diff -r c5ddb1d920d5 -r 803ac593d0e0 sys/arch/arm/omap/files.omap2
--- a/sys/arch/arm/omap/files.omap2 Wed Aug 22 21:17:58 2012 +0000
+++ b/sys/arch/arm/omap/files.omap2 Wed Aug 22 22:18:21 2012 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.omap2,v 1.12 2012/08/20 12:38:28 matt Exp $
+# $NetBSD: files.omap2,v 1.13 2012/08/22 22:18:21 matt Exp $
#
# Configuration info for Texas Instruments OMAP2/OMAP3 CPU support
# Based on xscale/files.pxa2x0
@@ -20,6 +20,7 @@
defflag opt_omap.h OMAP_3530: OMAP3
defflag opt_omap.h OMAP_4430: OMAP4
defflag opt_omap.h TI_AM335X: OMAP3
+defflag opt_omap.h TI_DM37XX: OMAP3
# OBIO just an attach point
device obio { [addr=-1], [size=0], [intr=-1], [mult=1], [intrbase=-1], [nobyteacc=0]
diff -r c5ddb1d920d5 -r 803ac593d0e0 sys/arch/arm/omap/omap2_gpio.c
--- a/sys/arch/arm/omap/omap2_gpio.c Wed Aug 22 21:17:58 2012 +0000
+++ b/sys/arch/arm/omap/omap2_gpio.c Wed Aug 22 22:18:21 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: omap2_gpio.c,v 1.9 2012/08/20 12:38:28 matt Exp $ */
+/* $NetBSD: omap2_gpio.c,v 1.10 2012/08/22 22:18:21 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.9 2012/08/20 12:38:28 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap2_gpio.c,v 1.10 2012/08/22 22:18:21 matt Exp $");
#define _INTR_PRIVATE
@@ -355,6 +355,15 @@
|| 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
+ || oa->obio_addr == GPIO3_BASE_TI_DM37XX
+ || oa->obio_addr == GPIO4_BASE_TI_DM37XX
+ || oa->obio_addr == GPIO5_BASE_TI_DM37XX
+ || oa->obio_addr == GPIO6_BASE_TI_DM37XX)
+ return 1;
+#endif
return 0;
}
diff -r c5ddb1d920d5 -r 803ac593d0e0 sys/arch/arm/omap/omap2_gpmcreg.h
--- a/sys/arch/arm/omap/omap2_gpmcreg.h Wed Aug 22 21:17:58 2012 +0000
+++ b/sys/arch/arm/omap/omap2_gpmcreg.h Wed Aug 22 22:18:21 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: omap2_gpmcreg.h,v 1.6 2012/08/20 12:38:28 matt Exp $ */
+/* $NetBSD: omap2_gpmcreg.h,v 1.7 2012/08/22 22:18:21 matt Exp $ */
/*
* Copyright (c) 2007 Microsoft
* All rights reserved.
@@ -50,6 +50,9 @@
#ifdef TI_AM335X
#define GPMC_BASE 0x50000000
#endif
+#ifdef TI_DM37XX
+#define GPMC_BASE 0x6e000000
+#endif
#define GPMC_REVISION 0x000
#define GPMC_SYSCONFIG 0x010
diff -r c5ddb1d920d5 -r 803ac593d0e0 sys/arch/arm/omap/omap2_obioreg.h
--- a/sys/arch/arm/omap/omap2_obioreg.h Wed Aug 22 21:17:58 2012 +0000
+++ b/sys/arch/arm/omap/omap2_obioreg.h Wed Aug 22 22:18:21 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: omap2_obioreg.h,v 1.4 2012/08/20 12:38:29 matt Exp $ */
+/* $NetBSD: omap2_obioreg.h,v 1.5 2012/08/22 22:18:21 matt Exp $ */
/*
* Copyright (c) 2007 Microsoft
@@ -91,4 +91,25 @@
#define GPIO3_BASE GPIO3_BASE_TI_AM335X
#endif
+#if defined(TI_DM37XX)
+#define OMAP2_OBIO_0_BASE TI_DM37XX_L4_CORE_BASE
+#define OMAP2_OBIO_0_SIZE TI_DM37XX_L4_CORE_SIZE
+
+#define OMAP2_OBIO_1_BASE TI_DM37XX_L4_WAKEUP_BASE
+#define OMAP2_OBIO_1_SIZE TI_DM37XX_L4_WAKEUP_SIZE
+
+#define OMAP2_OBIO_2_BASE TI_DM37XX_L4_PERIPHERAL_BASE
+#define OMAP2_OBIO_2_SIZE TI_DM37XX_L4_PERIPHERAL_SIZE
+
+#define OMAP2_OBIO_3_BASE TI_DM37XX_L4_EMULATION_BASE
+#define OMAP2_OBIO_3_SIZE TI_DM37XX_L4_EMULATION_SIZE
+
+#define GPIO1_BASE GPIO1_BASE_TI_DM37XX
+#define GPIO2_BASE GPIO2_BASE_TI_DM37XX
+#define GPIO3_BASE GPIO3_BASE_TI_DM37XX
+#define GPIO4_BASE GPIO4_BASE_TI_DM37XX
+#define GPIO5_BASE GPIO5_BASE_TI_DM37XX
+#define GPIO6_BASE GPIO6_BASE_TI_DM37XX
+#endif
+
#endif /* _ARM_OMAP_OMAP2_OBIOREG_H_ */
diff -r c5ddb1d920d5 -r 803ac593d0e0 sys/arch/arm/omap/omap2_reg.h
--- a/sys/arch/arm/omap/omap2_reg.h Wed Aug 22 21:17:58 2012 +0000
+++ b/sys/arch/arm/omap/omap2_reg.h Wed Aug 22 22:18:21 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: omap2_reg.h,v 1.6 2012/08/20 12:38:29 matt Exp $ */
+/* $NetBSD: omap2_reg.h,v 1.7 2012/08/22 22:18:21 matt Exp $ */
/*
* Copyright (c) 2007 Microsoft
@@ -84,6 +84,20 @@
#define TI_AM335X_L4_FAST_BASE 0x4A000000
#define TI_AM335X_L4_FAST_SIZE 0x01000000 /* 16MB */
+/* TI Sitara DM37xx (OMAP like) */
+
+#define TI_DM37XX_L4_CORE_BASE 0x48000000
+#define TI_DM37XX_L4_CORE_SIZE 0x01000000 /* 16MB */
+
+#define TI_DM37XX_L4_WAKEUP_BASE 0x48300000
+#define TI_DM37XX_L4_WAKEUP_SIZE 0x00010000 /* 64KB */
+
+#define TI_DM37XX_L4_PERIPHERAL_BASE 0x49000000
+#define TI_DM37XX_L4_PERIPHERAL_SIZE 0x00100000 /* 1MB */
+
+#define TI_DM37XX_L4_EMULATION_BASE 0x54000000
+#define TI_DM37XX_L4_EMULATION_SIZE 0x00800000 /* 8MB */
+
/*
* Clock Management registers base, offsets, and size
*/
@@ -102,6 +116,9 @@
#ifdef TI_AM335X
#define OMAP2_CM_BASE TI_AM335X_L4_WAKEUP_BASE
#endif
+#ifdef TI_DM37XX
+#define OMAP2_CM_BASE TI_DM37XX_L4_WAKEUP_BASE
+#endif
#define OMAP2_CM_CLKSEL_MPU 0x140
#define OMAP2_CM_FCLKEN1_CORE 0x200
@@ -275,6 +292,9 @@
#ifdef TI_AM335X
#define OMAP2_PRM_BASE 0x48306000
#endif
+#ifdef TI_DM37XX
+#define OMAP2_PRM_BASE 0x48306000
+#endif
#define OMAP2_PRM_SIZE 0x00002000 /* 8k */
@@ -457,7 +477,7 @@
* Interrupts
*/
#define INTC_BASE 0x480FE000
-#define INTC_BASE_3530 0x48200000 /* Also TI_AM335X */
+#define INTC_BASE_3530 0x48200000 /* Also TI_AM335X and TI_DM37XX */
#define INTC_REVISISON 0x0000
#define INTC_SYSCONFIG 0x0010
#define INTC_SYSSTATUS 0x0014
@@ -552,6 +572,13 @@
#define GPIO2_BASE_TI_AM335X 0x481ac000
#define GPIO3_BASE_TI_AM335X 0x481ae000
+#define GPIO1_BASE_TI_DM37XX 0x48310000
+#define GPIO2_BASE_TI_DM37XX 0x49050000
+#define GPIO3_BASE_TI_DM37XX 0x49052000
+#define GPIO4_BASE_TI_DM37XX 0x49054000
+#define GPIO5_BASE_TI_DM37XX 0x49056000
+#define GPIO6_BASE_TI_DM37XX 0x49058000
+
#define GPIO_IRQSTATUS1 0x018
#define GPIO_IRQENABLE1 0x01c
#define GPIO_WAKEUPENABLE 0x020
diff -r c5ddb1d920d5 -r 803ac593d0e0 sys/arch/evbarm/beagle/beagle.h
--- a/sys/arch/evbarm/beagle/beagle.h Wed Aug 22 21:17:58 2012 +0000
+++ b/sys/arch/evbarm/beagle/beagle.h Wed Aug 22 22:18:21 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: beagle.h,v 1.4 2012/08/20 12:40:40 matt Exp $ */
+/* $NetBSD: beagle.h,v 1.5 2012/08/22 22:18:22 matt Exp $ */
/*
* Copyright (c) 2007 Microsoft
* All rights reserved.
@@ -67,6 +67,15 @@
#define OMAP_L4_FAST_SIZE TI_AM335X_L4_FAST_SIZE
#endif
+#ifdef TI_DM37XX
+#define OMAP_L4_CORE_BASE TI_DM37XX_L4_CORE_BASE
+#define OMAP_L4_CORE_SIZE TI_DM37XX_L4_CORE_SIZE
+#define OMAP_L4_PERIPHERAL_BASE TI_DM37XX_L4_PERIPHERAL_BASE
+#define OMAP_L4_PERIPHERAL_SIZE TI_DM37XX_L4_PERIPHERAL_SIZE
+#define OMAP_L4_WAKEUP_BASE TI_DM37XX_L4_WAKEUP_BASE
+#define OMAP_L4_WAKEUP_SIZE TI_DM37XX_L4_WAKEUP_SIZE
+#endif
+
/*
* We devmap IO starting at KERNEL_VM_BASE + KERNEL_VM_SIZE
*/
@@ -83,9 +92,13 @@
#define OMAP_L4_FAST_VBASE (OMAP_L4_PERIPHERAL_VBASE + OMAP_L4_PERIPHERAL_SIZE)
#define OMAP_KERNEL_IO_VEND (OMAP_L4_FAST_VBASE + OMAP_L4_FAST_SIZE)
#define CONSADDR_VA ((CONSADDR - OMAP_L4_CORE_BASE) + OMAP_L4_CORE_VBASE)
+#elif defined(TI_DM37XX)
+#define OMAP_L4_CORE_VBASE OMAP_KERNEL_IO_VBASE
+#define OMAP_L4_PERIPHERAL_VBASE (OMAP_L4_CORE_VBASE + OMAP_L4_CORE_SIZE)
+#define OMAP_KERNEL_IO_VEND (OMAP_L4_PERIPHERAL_VBASE + OMAP_L4_PERIPHERAL_SIZE)
+#define CONSADDR_VA ((CONSADDR - OMAP_L4_CORE_BASE) + OMAP_L4_CORE_VBASE)
#else
#error unknown OMAP variant
#endif
-
#endif /* _EVBARM_BEAGLE_BEAGLE_H */
diff -r c5ddb1d920d5 -r 803ac593d0e0 sys/arch/evbarm/beagle/beagle_machdep.c
--- a/sys/arch/evbarm/beagle/beagle_machdep.c Wed Aug 22 21:17:58 2012 +0000
+++ b/sys/arch/evbarm/beagle/beagle_machdep.c Wed Aug 22 22:18:21 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: beagle_machdep.c,v 1.16 2012/08/20 12:40:40 matt Exp $ */
+/* $NetBSD: beagle_machdep.c,v 1.17 2012/08/22 22:18:22 matt Exp $ */
/*
* Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,7 +125,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: beagle_machdep.c,v 1.16 2012/08/20 12:40:40 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: beagle_machdep.c,v 1.17 2012/08/22 22:18:22 matt Exp $");
#include "opt_machdep.h"
#include "opt_ddb.h"
@@ -366,7 +366,9 @@
.pd_prot = VM_PROT_READ|VM_PROT_WRITE,
.pd_cache = PTE_NOCACHE
},
-#if defined(OMAP_L4_WAKEUP_BASE) && (OMAP_L4_WAKEUP_BASE != OMAP_L4_CORE_BASE)
+#if defined(OMAP_L4_WAKEUP_BASE) \
+ && (OMAP_L4_WAKEUP_BASE < OMAP_L4_CORE_BASE \
+ || OMAP_L4_CORE_BASE + OMAP_L4_CORE_SIZE <= OMAP_L4_WAKEUP_BASE)
{
/*
* Map all 256KB of the L4 Wakeup area
diff -r c5ddb1d920d5 -r 803ac593d0e0 sys/arch/evbarm/beagle/beagle_start.S
--- a/sys/arch/evbarm/beagle/beagle_start.S Wed Aug 22 21:17:58 2012 +0000
+++ b/sys/arch/evbarm/beagle/beagle_start.S Wed Aug 22 22:18:21 2012 +0000
@@ -92,7 +92,7 @@
#include <arm/omap/omap2_obioreg.h>
#include <evbarm/beagle/beagle.h>
-RCSID("$NetBSD: beagle_start.S,v 1.7 2012/08/20 12:40:40 matt Exp $")
+RCSID("$NetBSD: beagle_start.S,v 1.8 2012/08/22 22:18:22 matt Exp $")
#define Invalidate_I_cache(reg) \
mcr p15, 0, reg, c7, c5, 0 /* Invalidate Entire I cache */
@@ -282,7 +282,9 @@
(OMAP_L4_PERIPHERAL_SIZE + L1_S_SIZE - 1) / L1_S_SIZE,
L1_S_PROTO | L1_S_APv7_KRW)
-#ifdef OMAP_L4_WAKEUP_BASE
+#if defined(OMAP_L4_WAKEUP_BASE) \
+ && (OMAP_L4_WAKEUP_BASE < OMAP_L4_CORE_BASE \
+ || OMAP_L4_CORE_BASE + OMAP_L4_CORE_SIZE <= OMAP_L4_WAKEUP_BASE)
/* Map all 4MB of L4 WAKEUP (so console will work) */
MMU_INIT(OMAP_L4_WAKEUP_VBASE, OMAP_L4_WAKEUP_BASE,
(OMAP_L4_WAKEUP_SIZE + L1_S_SIZE - 1) / L1_S_SIZE,
diff -r c5ddb1d920d5 -r 803ac593d0e0 sys/arch/evbarm/conf/BEAGLEBOARDXM
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/evbarm/conf/BEAGLEBOARDXM Wed Aug 22 22:18:21 2012 +0000
@@ -0,0 +1,310 @@
+#
+# $NetBSD: BEAGLEBOARDXM,v 1.1 2012/08/22 22:18:21 matt Exp $
+#
+# BEAGLEBOARD -- TI OMAP 3530 Eval 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_DM37XX
+options PMAPCOUNTERS
+
+# Architecture options
+
+# File systems
Home |
Main Index |
Thread Index |
Old Index