summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphael Graf <rapha@cvs.openbsd.org>2013-10-28 11:11:51 +0000
committerRaphael Graf <rapha@cvs.openbsd.org>2013-10-28 11:11:51 +0000
commit8ca4c62d71a8dc35c0912c14fc3ed0a41ed0d1ba (patch)
treee7cc643be1d968b9defefeb8ae691c54a72a3384
parentf122098dddae38c9e2be8ee3c6238d5cbe2ee855 (diff)
Make prcm(4) aware of the GPIO modules.
ok aalm@, jasper@
-rw-r--r--sys/arch/armv7/omap/omap3_prcmreg.h4
-rw-r--r--sys/arch/armv7/omap/prcm.c40
-rw-r--r--sys/arch/armv7/omap/prcmvar.h8
3 files changed, 49 insertions, 3 deletions
diff --git a/sys/arch/armv7/omap/omap3_prcmreg.h b/sys/arch/armv7/omap/omap3_prcmreg.h
index f9f3f71cf2b..02f5e7ea73f 100644
--- a/sys/arch/armv7/omap/omap3_prcmreg.h
+++ b/sys/arch/armv7/omap/omap3_prcmreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: omap3_prcmreg.h,v 1.2 2013/10/23 11:11:31 rapha Exp $ */
+/* $OpenBSD: omap3_prcmreg.h,v 1.3 2013/10/28 11:11:50 rapha Exp $ */
/*
* Copyright (c) 2007, 2009, 2012 Dale Rahn <drahn@dalerahn.com>
*
@@ -97,7 +97,9 @@
#define CM_CLKSEL4_PLL 0x0d4C
#define CM_CLKSEL5_PLL 0x0d50
#define CM_FCLKEN_PER 0x1000
+#define CM_FCLKEN_PER_MSK 0x0003ffff
#define CM_ICLKEN_PER 0x1010
+#define CM_ICLKEN_PER_MSK 0x0003ffff
#define CM_IDLEST_PER 0x1020
#define CM_AUTOIDLE_PER 0x1030
#define CM_CLKSEL_PER 0x1040
diff --git a/sys/arch/armv7/omap/prcm.c b/sys/arch/armv7/omap/prcm.c
index 23e17b18831..8dfa6ab2988 100644
--- a/sys/arch/armv7/omap/prcm.c
+++ b/sys/arch/armv7/omap/prcm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: prcm.c,v 1.5 2013/10/25 15:43:12 syl Exp $ */
+/* $OpenBSD: prcm.c,v 1.6 2013/10/28 11:11:50 rapha Exp $ */
/*
* Copyright (c) 2007,2009 Dale Rahn <drahn@openbsd.org>
*
@@ -186,6 +186,16 @@ prcm_v3_setup(struct prcm_softc *sc)
prcm_fmask_addr[PRCM_REG_CORE_CLK3] = PRCM_REG_CORE_CLK3_FADDR;
prcm_imask_addr[PRCM_REG_CORE_CLK3] = PRCM_REG_CORE_CLK3_IADDR;
+ prcm_fmask_mask[PRCM_REG_WKUP] = PRCM_REG_WKUP_FMASK;
+ prcm_imask_mask[PRCM_REG_WKUP] = PRCM_REG_WKUP_IMASK;
+ prcm_fmask_addr[PRCM_REG_WKUP] = PRCM_REG_WKUP_FADDR;
+ prcm_imask_addr[PRCM_REG_WKUP] = PRCM_REG_WKUP_IADDR;
+
+ prcm_fmask_mask[PRCM_REG_PER] = PRCM_REG_PER_FMASK;
+ prcm_imask_mask[PRCM_REG_PER] = PRCM_REG_PER_IMASK;
+ prcm_fmask_addr[PRCM_REG_PER] = PRCM_REG_PER_FADDR;
+ prcm_imask_addr[PRCM_REG_PER] = PRCM_REG_PER_IADDR;
+
prcm_fmask_mask[PRCM_REG_USBHOST] = PRCM_REG_USBHOST_FMASK;
prcm_imask_mask[PRCM_REG_USBHOST] = PRCM_REG_USBHOST_IMASK;
prcm_fmask_addr[PRCM_REG_USBHOST] = PRCM_REG_USBHOST_FADDR;
@@ -260,6 +270,18 @@ prcm_v3_bit(int mod)
return PRCM_CLK_EN_MMC3;
case PRCM_USB:
return PRCM_CLK_EN_USB;
+ case PRCM_GPIO0:
+ return PRCM_CLK_EN_GPIO1;
+ case PRCM_GPIO1:
+ return PRCM_CLK_EN_GPIO2;
+ case PRCM_GPIO2:
+ return PRCM_CLK_EN_GPIO3;
+ case PRCM_GPIO3:
+ return PRCM_CLK_EN_GPIO4;
+ case PRCM_GPIO4:
+ return PRCM_CLK_EN_GPIO5;
+ case PRCM_GPIO5:
+ return PRCM_CLK_EN_GPIO6;
default:
panic("%s: module not found\n", __func__);
}
@@ -281,6 +303,14 @@ prcm_am335x_clkctrl(int mod)
return PRCM_AM335X_MMC2_CLKCTRL;
case PRCM_USB:
return PRCM_AM335X_USB0_CLKCTRL;
+ case PRCM_GPIO0:
+ return PRCM_AM335X_GPIO0_CLKCTRL;
+ case PRCM_GPIO1:
+ return PRCM_AM335X_GPIO1_CLKCTRL;
+ case PRCM_GPIO2:
+ return PRCM_AM335X_GPIO2_CLKCTRL;
+ case PRCM_GPIO3:
+ return PRCM_AM335X_GPIO3_CLKCTRL;
case PRCM_TPCC:
return PRCM_AM335X_TPCC_CLKCTRL;
case PRCM_TPTC0:
@@ -367,6 +397,14 @@ prcm_v4_enablemodule(struct prcm_softc *sc, int mod)
case PRCM_USBP2_HSIC:
prcm_v4_hsusbhost_activate(mod);
return;
+ case PRCM_GPIO0:
+ case PRCM_GPIO1:
+ case PRCM_GPIO2:
+ case PRCM_GPIO3:
+ case PRCM_GPIO4:
+ case PRCM_GPIO5:
+ /* XXX */
+ break;
default:
panic("%s: module not found\n", __func__);
}
diff --git a/sys/arch/armv7/omap/prcmvar.h b/sys/arch/armv7/omap/prcmvar.h
index 61ecd6fa842..8f4ce1fa327 100644
--- a/sys/arch/armv7/omap/prcmvar.h
+++ b/sys/arch/armv7/omap/prcmvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: prcmvar.h,v 1.3 2013/10/24 19:39:46 syl Exp $ */
+/* $OpenBSD: prcmvar.h,v 1.4 2013/10/28 11:11:50 rapha Exp $ */
/*
* Copyright (c) 2007,2009 Dale Rahn <drahn@openbsd.org>
*
@@ -27,6 +27,12 @@ enum PRCM_MODULES {
PRCM_TIMER1,
PRCM_TIMER2,
PRCM_TIMER3,
+ PRCM_GPIO0,
+ PRCM_GPIO1,
+ PRCM_GPIO2,
+ PRCM_GPIO3,
+ PRCM_GPIO4,
+ PRCM_GPIO5,
PRCM_TPCC,
PRCM_TPTC0,
PRCM_TPTC1,