Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/omap Add support for the TI AM335x (beaglebone)...
details: https://anonhg.NetBSD.org/src/rev/221d3cadd0ec
branches: trunk
changeset: 781110:221d3cadd0ec
user: matt <matt%NetBSD.org@localhost>
date: Mon Aug 20 12:38:28 2012 +0000
description:
Add support for the TI AM335x (beaglebone) and the OMAP4430 (pandaboard)
diffstat:
sys/arch/arm/omap/files.omap2 | 3 +-
sys/arch/arm/omap/omap2_gpio.c | 11 ++++-
sys/arch/arm/omap/omap2_gpmcreg.h | 5 ++-
sys/arch/arm/omap/omap2_icu.c | 6 +-
sys/arch/arm/omap/omap2_obio.c | 8 ++--
sys/arch/arm/omap/omap2_obioreg.h | 17 ++++++++-
sys/arch/arm/omap/omap2_reg.h | 70 ++++++++++++++++++++++++++++------
sys/arch/arm/omap/omap_nobyteacc_io.S | 6 +-
8 files changed, 98 insertions(+), 28 deletions(-)
diffs (297 lines):
diff -r 697b098215af -r 221d3cadd0ec sys/arch/arm/omap/files.omap2
--- a/sys/arch/arm/omap/files.omap2 Mon Aug 20 11:59:29 2012 +0000
+++ b/sys/arch/arm/omap/files.omap2 Mon Aug 20 12:38:28 2012 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.omap2,v 1.11 2012/07/12 03:30:29 matt Exp $
+# $NetBSD: files.omap2,v 1.12 2012/08/20 12:38:28 matt Exp $
#
# Configuration info for Texas Instruments OMAP2/OMAP3 CPU support
# Based on xscale/files.pxa2x0
@@ -19,6 +19,7 @@
defflag opt_omap.h OMAP_2420: OMAP2
defflag opt_omap.h OMAP_3530: OMAP3
defflag opt_omap.h OMAP_4430: OMAP4
+defflag opt_omap.h TI_AM335X: OMAP3
# OBIO just an attach point
device obio { [addr=-1], [size=0], [intr=-1], [mult=1], [intrbase=-1], [nobyteacc=0]
diff -r 697b098215af -r 221d3cadd0ec sys/arch/arm/omap/omap2_gpio.c
--- a/sys/arch/arm/omap/omap2_gpio.c Mon Aug 20 11:59:29 2012 +0000
+++ b/sys/arch/arm/omap/omap2_gpio.c Mon Aug 20 12:38:28 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: omap2_gpio.c,v 1.8 2011/07/01 20:30:21 dyoung Exp $ */
+/* $NetBSD: omap2_gpio.c,v 1.9 2012/08/20 12:38:28 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.8 2011/07/01 20:30:21 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap2_gpio.c,v 1.9 2012/08/20 12:38:28 matt Exp $");
#define _INTR_PRIVATE
@@ -348,6 +348,13 @@
|| oa->obio_addr == GPIO6_BASE_3530)
return 1;
#endif
+#ifdef TI_AM335X
+ if (oa->obio_addr == GPIO0_BASE_TI_AM335X
+ || oa->obio_addr == GPIO1_BASE_TI_AM335X
+ || oa->obio_addr == GPIO2_BASE_TI_AM335X
+ || oa->obio_addr == GPIO3_BASE_TI_AM335X)
+ return 1;
+#endif
return 0;
}
diff -r 697b098215af -r 221d3cadd0ec sys/arch/arm/omap/omap2_gpmcreg.h
--- a/sys/arch/arm/omap/omap2_gpmcreg.h Mon Aug 20 11:59:29 2012 +0000
+++ b/sys/arch/arm/omap/omap2_gpmcreg.h Mon Aug 20 12:38:28 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: omap2_gpmcreg.h,v 1.5 2011/02/07 23:22:18 ahoka Exp $ */
+/* $NetBSD: omap2_gpmcreg.h,v 1.6 2012/08/20 12:38:28 matt Exp $ */
/*
* Copyright (c) 2007 Microsoft
* All rights reserved.
@@ -47,6 +47,9 @@
#ifdef OMAP_3530
#define GPMC_BASE 0x6e000000
#endif
+#ifdef TI_AM335X
+#define GPMC_BASE 0x50000000
+#endif
#define GPMC_REVISION 0x000
#define GPMC_SYSCONFIG 0x010
diff -r 697b098215af -r 221d3cadd0ec sys/arch/arm/omap/omap2_icu.c
--- a/sys/arch/arm/omap/omap2_icu.c Mon Aug 20 11:59:29 2012 +0000
+++ b/sys/arch/arm/omap/omap2_icu.c Mon Aug 20 12:38:28 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: omap2_icu.c,v 1.8 2011/07/01 20:30:21 dyoung Exp $ */
+/* $NetBSD: omap2_icu.c,v 1.9 2012/08/20 12:38:28 matt Exp $ */
/*
* Define the SDP2430 specific information and then include the generic OMAP
* interrupt header.
@@ -30,7 +30,7 @@
#define _INTR_PRIVATE
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: omap2_icu.c,v 1.8 2011/07/01 20:30:21 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap2_icu.c,v 1.9 2012/08/20 12:38:28 matt Exp $");
#include <sys/param.h>
#include <sys/evcnt.h>
@@ -172,7 +172,7 @@
#if defined(OMAP_2430) || defined(OMAP_2420)
return oa->obio_addr == INTC_BASE;
-#elif defined(OMAP_3530)
+#elif defined(OMAP3)
return oa->obio_addr == INTC_BASE_3530;
#else
#error unsupported OMAP variant
diff -r 697b098215af -r 221d3cadd0ec sys/arch/arm/omap/omap2_obio.c
--- a/sys/arch/arm/omap/omap2_obio.c Mon Aug 20 11:59:29 2012 +0000
+++ b/sys/arch/arm/omap/omap2_obio.c Mon Aug 20 12:38:28 2012 +0000
@@ -1,7 +1,7 @@
-/* $Id: omap2_obio.c,v 1.12 2011/07/01 20:30:21 dyoung Exp $ */
+/* $Id: omap2_obio.c,v 1.13 2012/08/20 12:38:28 matt Exp $ */
/* adapted from: */
-/* $NetBSD: omap2_obio.c,v 1.12 2011/07/01 20:30:21 dyoung Exp $ */
+/* $NetBSD: omap2_obio.c,v 1.13 2012/08/20 12:38:28 matt Exp $ */
/*
@@ -103,7 +103,7 @@
#include "opt_omap.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: omap2_obio.c,v 1.12 2011/07/01 20:30:21 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap2_obio.c,v 1.13 2012/08/20 12:38:28 matt Exp $");
#include "locators.h"
#include "obio.h"
@@ -348,7 +348,7 @@
bus_addr_t addr;
bool required;
} critical_devs[] = {
-#ifdef OMAP_3530
+#ifdef OMAP3
{ .name = "avic", .addr = INTC_BASE_3530, .required = true },
#else
{ .name = "avic", .addr = INTC_BASE, .required = true },
diff -r 697b098215af -r 221d3cadd0ec sys/arch/arm/omap/omap2_obioreg.h
--- a/sys/arch/arm/omap/omap2_obioreg.h Mon Aug 20 11:59:29 2012 +0000
+++ b/sys/arch/arm/omap/omap2_obioreg.h Mon Aug 20 12:38:28 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: omap2_obioreg.h,v 1.3 2008/10/22 10:45:47 matt Exp $ */
+/* $NetBSD: omap2_obioreg.h,v 1.4 2012/08/20 12:38:29 matt Exp $ */
/*
* Copyright (c) 2007 Microsoft
@@ -76,4 +76,19 @@
#define GPIO5_BASE GPIO5_BASE_3530
#endif
+#if defined(TI_AM335X)
+#define OMAP2_OBIO_0_BASE TI_AM335X_L4_WAKEUP_BASE
+#define OMAP2_OBIO_0_SIZE TI_AM335X_L4_WAKEUP_SIZE
+
+#define OMAP2_OBIO_1_BASE TI_AM335X_L4_PERIPHERAL_BASE
+#define OMAP2_OBIO_1_SIZE TI_AM335X_L4_PERIPHERAL_SIZE
+
+#define OMAP2_OBIO_2_BASE TI_AM335X_L4_FAST_BASE
+#define OMAP2_OBIO_2_SIZE TI_AM335X_L4_FAST_SIZE
+
+#define GPIO1_BASE GPIO1_BASE_TI_AM335X
+#define GPIO2_BASE GPIO2_BASE_TI_AM335X
+#define GPIO3_BASE GPIO3_BASE_TI_AM335X
+#endif
+
#endif /* _ARM_OMAP_OMAP2_OBIOREG_H_ */
diff -r 697b098215af -r 221d3cadd0ec sys/arch/arm/omap/omap2_reg.h
--- a/sys/arch/arm/omap/omap2_reg.h Mon Aug 20 11:59:29 2012 +0000
+++ b/sys/arch/arm/omap/omap2_reg.h Mon Aug 20 12:38:28 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: omap2_reg.h,v 1.5 2012/07/12 03:38:25 matt Exp $ */
+/* $NetBSD: omap2_reg.h,v 1.6 2012/08/20 12:38:29 matt Exp $ */
/*
* Copyright (c) 2007 Microsoft
@@ -33,7 +33,7 @@
#define _ARM_OMAP_OMAP2_REG_H_
/*
- * Header for misc. omap2430 registers
+ * Header for misc. omap2/3/4 registers
*/
/*
@@ -48,29 +48,62 @@
#define OMAP3530_L4_CORE_BASE 0x48000000
#define OMAP3530_L4_CORE_SIZE 0x01000000 /* 16 MB */
-#define OMAP3530_L4_WAKEUP_BASE 0x48300000
-#define OMAP3530_L4_WAKEUP_SIZE 0x00040000 /* 256KB */
+/* OMAP3 processors */
+
+#define OMAP3530_L4_WAKEUP_BASE 0x48300000
+#define OMAP3530_L4_WAKEUP_SIZE 0x00040000 /* 256KB */
+
+#define OMAP3530_L4_PERIPHERAL_BASE 0x49000000
+#define OMAP3530_L4_PERIPHERAL_SIZE 0x00100000 /* 1MB */
+
+#define OMAP3530_L4_EMULATION_BASE 0x54000000
+#define OMAP3530_L4_EMULATION_SIZE 0x00800000 /* 8MB */
+
+/* OMAP4 processors */
+
+#define OMAP4430_L4_CORE_BASE 0x48000000
+#define OMAP4430_L4_CORE_SIZE 0x01000000 /* 16 MB */
-#define OMAP3530_L4_PERIPHERAL_BASE 0x49000000
-#define OMAP3530_L4_PERIPHERAL_SIZE 0x00100000 /* 1MB */
+#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_EMULATION_BASE 0x54000000 /* Actually L3 */
+#define OMAP4430_L4_EMULATION_SIZE 0x00800000 /* 8MB */
-#define OMAP3530_L4_EMULATION_BASE 0x54000000
-#define OMAP3530_L4_EMULATION_SIZE 0x00800000 /* 8MB */
+/* TI Sitara AM335x (OMAP like) */
+
+#define TI_AM335X_L4_WAKEUP_BASE 0x44C00000
+#define TI_AM335X_L4_WAKEUP_SIZE 0x00400000 /* 4MB */
+
+#define TI_AM335X_L4_PERIPHERAL_BASE 0x48000000
+#define TI_AM335X_L4_PERIPHERAL_SIZE 0x01000000 /* 16MB */
+
+#define TI_AM335X_L4_FAST_BASE 0x4A000000
+#define TI_AM335X_L4_FAST_SIZE 0x01000000 /* 16MB */
/*
* Clock Management registers base, offsets, and size
*/
#ifdef OMAP_2430
-#define OMAP2_CM_BASE 0x49006000
+#define OMAP2_CM_BASE 0x49006000
#endif
#ifdef OMAP_2420
-#define OMAP2_CM_BASE 0x48008000
+#define OMAP2_CM_BASE 0x48008000
#endif
#ifdef OMAP_3530
-#define OMAP2_CM_BASE 0x48004000
+#define OMAP2_CM_BASE 0x48004000
+#endif
+#ifdef OMAP_4430
+#define OMAP2_CM_BASE (OMAP4430_L4_CORE_BASE + 0x04000)
+#endif
+#ifdef TI_AM335X
+#define OMAP2_CM_BASE TI_AM335X_L4_WAKEUP_BASE
#endif
-#define OMAP2_CM_CLKSEL_MPU 0x140
+#define OMAP2_CM_CLKSEL_MPU 0x140
#define OMAP2_CM_FCLKEN1_CORE 0x200
#define OMAP2_CM_FCLKEN2_CORE 0x204
#define OMAP2_CM_ICLKEN1_CORE 0x210
@@ -236,6 +269,12 @@
#ifdef OMAP_3530
#define OMAP2_PRM_BASE 0x48306000
#endif
+#ifdef OMAP_4430
+#define OMAP2_PRM_BASE 0x4A306000
+#endif
+#ifdef TI_AM335X
+#define OMAP2_PRM_BASE 0x48306000
+#endif
#define OMAP2_PRM_SIZE 0x00002000 /* 8k */
@@ -418,7 +457,7 @@
* Interrupts
*/
#define INTC_BASE 0x480FE000
-#define INTC_BASE_3530 0x48200000
+#define INTC_BASE_3530 0x48200000 /* Also TI_AM335X */
#define INTC_REVISISON 0x0000
#define INTC_SYSCONFIG 0x0010
#define INTC_SYSSTATUS 0x0014
@@ -508,6 +547,11 @@
#define GPIO5_BASE_3530 0x49056000
#define GPIO6_BASE_3530 0x49058000
+#define GPIO0_BASE_TI_AM335X 0x44e07000
+#define GPIO1_BASE_TI_AM335X 0x4804c000
+#define GPIO2_BASE_TI_AM335X 0x481ac000
+#define GPIO3_BASE_TI_AM335X 0x481ae000
+
#define GPIO_IRQSTATUS1 0x018
#define GPIO_IRQENABLE1 0x01c
#define GPIO_WAKEUPENABLE 0x020
diff -r 697b098215af -r 221d3cadd0ec sys/arch/arm/omap/omap_nobyteacc_io.S
--- a/sys/arch/arm/omap/omap_nobyteacc_io.S Mon Aug 20 11:59:29 2012 +0000
+++ b/sys/arch/arm/omap/omap_nobyteacc_io.S Mon Aug 20 12:38:28 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: omap_nobyteacc_io.S,v 1.1 2007/01/06 00:29:52 christos Exp $ */
+/* $NetBSD: omap_nobyteacc_io.S,v 1.2 2012/08/20 12:38:29 matt Exp $ */
/*
* Redistribution and use in source and binary forms, with or without
@@ -45,5 +45,5 @@
orrne r0, r0, r3, lsl #8 /* odd: or data shifted to hi byte */
strh r0, [r1] /* store back halfword */
msr cpsr, r2 /* restore interrupts */
- mov pc, lr
-
+ RET
+END(nobyteacc_bs_w_1)
Home |
Main Index |
Thread Index |
Old Index