summaryrefslogtreecommitdiffstats
path: root/sys/arm/ti/am335x/am335x_prcm.c
diff options
context:
space:
mode:
authorloos <loos@FreeBSD.org>2015-01-12 03:23:16 +0000
committerloos <loos@FreeBSD.org>2015-01-12 03:23:16 +0000
commit8e5fb35624be57a7cb25a227750de7adca8749c2 (patch)
tree0ec3429f5b8a8f2c52c272a1bf835ffe28e584a9 /sys/arm/ti/am335x/am335x_prcm.c
parent17bc7b87655a451570af2ed2287b971871cbc909 (diff)
downloadFreeBSD-src-8e5fb35624be57a7cb25a227750de7adca8749c2.zip
FreeBSD-src-8e5fb35624be57a7cb25a227750de7adca8749c2.tar.gz
Add support to turn off Beaglebone with poweroff(8) or shutdown(8) -p.
To cut off the power we need to start the shutdown sequence by writing the OFF bit on PMIC. Once the PMIC is programmed the SoC needs to toggle the PMIC_PWR_ENABLE pin when it is ready for the PMIC to cut off the power. This is done by triggering the ALARM2 interrupt on SoC RTC. The RTC driver only works in power management mode which means it won't provide any kind of time keeping functionality. It only implements a way to trigger the ALARM2 interrupt when requested. Differential Revision: https://reviews.freebsd.org/D1489 Reviewed by: rpaulo MFC after: 2 weeks
Diffstat (limited to 'sys/arm/ti/am335x/am335x_prcm.c')
-rw-r--r--sys/arm/ti/am335x/am335x_prcm.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/arm/ti/am335x/am335x_prcm.c b/sys/arm/ti/am335x/am335x_prcm.c
index 7537a33..e42d71f 100644
--- a/sys/arm/ti/am335x/am335x_prcm.c
+++ b/sys/arm/ti/am335x/am335x_prcm.c
@@ -118,6 +118,10 @@ __FBSDID("$FreeBSD$");
#define CLKSEL_TIMER6_CLK (CM_DPLL + 0x01C)
#define CLKSEL_PRUSS_OCP_CLK (CM_DPLL + 0x030)
+#define CM_RTC 0x800
+#define CM_RTC_RTC_CLKCTRL (CM_RTC + 0x000)
+#define CM_RTC_CLKSTCTRL (CM_RTC + 0x004)
+
#define PRM_PER 0xC00
#define PRM_PER_RSTCTRL (PRM_PER + 0x00)
@@ -295,7 +299,8 @@ struct ti_clock_dev ti_am335x_clk_devmap[] = {
.clk_get_source_freq = NULL,
},
-
+ /* RTC */
+ AM335X_GENERIC_CLOCK_DEV(RTC_CLK),
{ INVALID_CLK_IDENT, NULL, NULL, NULL, NULL }
};
@@ -363,6 +368,9 @@ static struct am335x_clk_details g_am335x_clk_details[] = {
_CLK_DETAIL(MAILBOX0_CLK, CM_PER_MAILBOX0_CLKCTRL, 0),
_CLK_DETAIL(SPINLOCK0_CLK, CM_PER_SPINLOCK0_CLKCTRL, 0),
+ /* RTC module */
+ _CLK_DETAIL(RTC_CLK, CM_RTC_RTC_CLKCTRL, 0),
+
{ INVALID_CLK_IDENT, 0},
};
OpenPOWER on IntegriCloud