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 Don't rely on uboot to enable am335x gpio ...
details: https://anonhg.NetBSD.org/src/rev/cfc408c5d4ba
branches: trunk
changeset: 342139:cfc408c5d4ba
user: skrll <skrll%NetBSD.org@localhost>
date: Tue Dec 08 14:42:24 2015 +0000
description:
Don't rely on uboot to enable am335x gpio clocks
>From jmcneill@
diffstat:
sys/arch/arm/omap/am335x_gpio.c | 32 ++++++++++++++++++++++++++++++--
1 files changed, 30 insertions(+), 2 deletions(-)
diffs (65 lines):
diff -r 922ad4c0c21b -r cfc408c5d4ba sys/arch/arm/omap/am335x_gpio.c
--- a/sys/arch/arm/omap/am335x_gpio.c Tue Dec 08 12:57:16 2015 +0000
+++ b/sys/arch/arm/omap/am335x_gpio.c Tue Dec 08 14:42:24 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: am335x_gpio.c,v 1.1 2015/11/02 00:48:45 jmcneill Exp $ */
+/* $NetBSD: am335x_gpio.c,v 1.2 2015/12/08 14:42:24 skrll 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: am335x_gpio.c,v 1.1 2015/11/02 00:48:45 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: am335x_gpio.c,v 1.2 2015/12/08 14:42:24 skrll Exp $");
#define _INTR_PRIVATE
@@ -54,11 +54,23 @@
#include <arm/omap/omap2_obiovar.h>
#include <arm/omap/omap2_gpio.h>
+#include <arm/omap/am335x_prcm.h>
+#include <arm/omap/omap2_prcm.h>
+#include <arm/omap/sitara_cm.h>
+#include <arm/omap/sitara_cmreg.h>
+
#if NGPIO > 0
#include <sys/gpio.h>
#include <dev/gpio/gpiovar.h>
#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 },
+};
+
#define AM335X_GPIO_REVISION 0x000
#define AM335X_GPIO_SYSCONFIG 0x010
#define AM335X_GPIO_EIO 0x020
@@ -232,6 +244,22 @@
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
gpio_attach1(self);
#endif
Home |
Main Index |
Thread Index |
Old Index