@@ -95,11 +95,13 @@ endif
# PRCM
omap-prcm-4-5-common = prcm.o cminst44xx.o cm44xx.o \
prcm_mpu44xx.o prminst44xx.o \
- vc44xx_data.o vp44xx_data.o
+ vc44xx_data.o vp44xx_data.o \
+ abb44xx_data.o
obj-y += prm_common.o
obj-$(CONFIG_ARCH_OMAP2) += prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o
obj-$(CONFIG_ARCH_OMAP3) += prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o
-obj-$(CONFIG_ARCH_OMAP3) += vc3xxx_data.o vp3xxx_data.o
+obj-$(CONFIG_ARCH_OMAP3) += vc3xxx_data.o vp3xxx_data.o \
+ abb36xx_data.o
obj-$(CONFIG_SOC_AM33XX) += prcm.o prm33xx.o cm33xx.o
obj-$(CONFIG_ARCH_OMAP4) += $(omap-prcm-4-5-common) prm44xx.o
obj-$(CONFIG_SOC_OMAP5) += $(omap-prcm-4-5-common)
new file mode 100644
@@ -0,0 +1,85 @@
+/*
+ * OMAP Adaptive Body-Bias structure and macro definitions
+ *
+ * Copyright (C) 2011 Texas Instruments, Inc.
+ * Mike Turquette <mturquette@ti.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __ARCH_ARM_MACH_OMAP2_ABB_H
+#define __ARCH_ARM_MACH_OMAP2_ABB_H
+
+#include <linux/kernel.h>
+
+#include "voltage.h"
+
+/* NOMINAL_OPP bypasses the ABB ldo, FAST_OPP sets it to Forward Body-Bias */
+#define OMAP_ABB_NOMINAL_OPP 0
+#define OMAP_ABB_FAST_OPP 1
+#define OMAP_ABB_NO_LDO (~0)
+
+/* Time for the ABB ldo to settle after transition (in micro-seconds) */
+#define ABB_TRANXDONE_TIMEOUT 50
+
+/*
+ * struct omap_abb_ops - per-OMAP operations needed for ABB transition
+ *
+ * @check_tranxdone: return status of ldo transition from PRM_IRQSTATUS
+ * @clear_tranxdone: clear ABB transition status bit from PRM_IRQSTATUS
+ */
+struct omap_abb_ops {
+ u32 (*check_tranxdone)(u8 irq_id);
+ void (*clear_tranxdone)(u8 irq_id);
+};
+
+/*
+ * struct omap_abb_common - ABB data common to an OMAP family
+ *
+ * @opp_sel_mask: CTRL reg uses this to program next state of ldo
+ * @opp_change_mask: CTRL reg uses this to initiate ldo state change
+ * @sr2_wtcnt_value_mask: SETUP reg uses this to program ldo settling time
+ * @sr2en_mask: SETUP reg uses this to enable/disable ldo
+ * @active_fbb_sel_mask: SETUP reg uses this to enable/disable FBB operation
+ * @settling_time: number of micro-seconds it takes for ldo to transition
+ * @clock_cycles: settling_time is counted in multiples of clock cycles
+ * @ops: pointer to common ops for manipulating PRM_IRQSTATUS bits
+ */
+struct omap_abb_common {
+ u32 opp_sel_mask;
+ u32 opp_change_mask;
+ u32 sr2_wtcnt_value_mask;
+ u32 sr2en_mask;
+ u32 active_fbb_sel_mask;
+ unsigned long settling_time;
+ unsigned long clock_cycles;
+ const struct omap_abb_ops *ops;
+};
+
+/*
+ * struct omap_abb_instance - data for each instance of ABB ldo
+ *
+ * @setup_offs: PRM register offset for initial configuration of ABB ldo
+ * @ctrl_offs: PRM register offset for active programming of ABB ldo
+ * @prm_irq_id: IRQ handle used to resolve IRQSTATUS offset & masks
+ * @enabled: track whether ABB ldo is enabled or disabled
+ * @common: pointer to common data for all ABB ldo's
+ * @_opp_sel: internally track last programmed state of ABB ldo. DO NOT USE
+ */
+struct omap_abb_instance {
+ u8 setup_offs;
+ u8 ctrl_offs;
+ u8 prm_irq_id;
+ bool enabled;
+ const struct omap_abb_common *common;
+ u8 _opp_sel;
+};
+
+extern struct omap_abb_instance omap36xx_abb_mpu;
+
+extern struct omap_abb_instance omap4_abb_mpu;
+extern struct omap_abb_instance omap4_abb_iva;
+
+#endif
new file mode 100644
@@ -0,0 +1,39 @@
+/*
+ * OMAP36xx Adaptive Body-Bias (ABB) data
+ *
+ * Copyright (C) 2011 Texas Instruments, Inc.
+ * Mike Turquette <mturquette@ti.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include "abb.h"
+#include "vp.h"
+#include "prm2xxx_3xxx.h"
+#include "prm-regbits-34xx.h"
+
+static const struct omap_abb_ops omap36xx_abb_ops = {
+ .check_tranxdone = &omap3_prm_abb_check_txdone,
+ .clear_tranxdone = &omap3_prm_abb_clear_txdone,
+};
+
+static const struct omap_abb_common omap36xx_abb_common = {
+ .opp_sel_mask = OMAP3630_OPP_SEL_MASK,
+ .opp_change_mask = OMAP3630_OPP_CHANGE_MASK,
+ .sr2en_mask = OMAP3630_SR2EN_MASK,
+ .active_fbb_sel_mask = OMAP3630_ACTIVE_FBB_SEL_MASK,
+ .sr2_wtcnt_value_mask = OMAP3630_SR2_WTCNT_VALUE_MASK,
+ .settling_time = 30,
+ .clock_cycles = 8,
+ .ops = &omap36xx_abb_ops,
+};
+
+/* SETUP & CTRL registers swapped names in OMAP4; thus 36xx looks strange */
+struct omap_abb_instance omap36xx_abb_mpu = {
+ .setup_offs = OMAP3_PRM_LDO_ABB_CTRL_OFFSET,
+ .ctrl_offs = OMAP3_PRM_LDO_ABB_SETUP_OFFSET,
+ .prm_irq_id = OMAP3_VP_VDD_MPU_ID,
+ .common = &omap36xx_abb_common,
+};
new file mode 100644
@@ -0,0 +1,45 @@
+/*
+ * OMAP44xx Adaptive Body-Bias (ABB) data
+ *
+ * Copyright (C) 2011 Texas Instruments, Inc.
+ * Mike Turquette <mturquette@ti.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include "abb.h"
+#include "vp.h"
+#include "prm44xx.h"
+#include "prm-regbits-44xx.h"
+
+static const struct omap_abb_ops omap4_abb_ops = {
+ .check_tranxdone = &omap4_prm_abb_check_txdone,
+ .clear_tranxdone = &omap4_prm_abb_clear_txdone,
+};
+
+static const struct omap_abb_common omap4_abb_common = {
+ .opp_sel_mask = OMAP4430_OPP_SEL_MASK,
+ .opp_change_mask = OMAP4430_OPP_CHANGE_MASK,
+ .sr2en_mask = OMAP4430_SR2EN_MASK,
+ .active_fbb_sel_mask = OMAP4430_ACTIVE_FBB_SEL_MASK,
+ .sr2_wtcnt_value_mask = OMAP4430_SR2_WTCNT_VALUE_MASK,
+ .settling_time = 50,
+ .clock_cycles = 16,
+ .ops = &omap4_abb_ops,
+};
+
+struct omap_abb_instance omap4_abb_mpu = {
+ .setup_offs = OMAP4_PRM_LDO_ABB_MPU_SETUP_OFFSET,
+ .ctrl_offs = OMAP4_PRM_LDO_ABB_MPU_CTRL_OFFSET,
+ .prm_irq_id = OMAP4_VP_VDD_MPU_ID,
+ .common = &omap4_abb_common,
+};
+
+struct omap_abb_instance omap4_abb_iva = {
+ .setup_offs = OMAP4_PRM_LDO_ABB_IVA_SETUP_OFFSET,
+ .ctrl_offs = OMAP4_PRM_LDO_ABB_IVA_CTRL_OFFSET,
+ .prm_irq_id = OMAP4_VP_VDD_IVA_ID,
+ .common = &omap4_abb_common,
+};