Skip to content

Commit

Permalink
Merge tag 'for-v4.7/omap-hwmod-a' of git://git.kernel.org/pub/scm/lin…
Browse files Browse the repository at this point in the history
…ux/kernel/git/pjw/omap-pending into omap-for-v4.7/soc

ARM: OMAP2+: first set of hwmod changes for v4.7

For the DRA7xx platform, add IP block data for the McASP, PWMSS,
and GPTimer12 IP blocks.  Add lock and unlock functions for the
RTC IP blocks on the DRA7xx, AM33xx, and AM43xx devices.  And add
a fix for the hwmod core for device driver unbind operations for
IP blocks with hardreset lines.

Basic build, boot, and PM test results are available here:

http://www.pwsan.com/omap/testlogs/omap-hwmod-a-for-v4.7/20160410132119/

Note that the testbed here does not have the DRA7xx board included yet.
  • Loading branch information
Tony Lindgren committed Apr 22, 2016
2 parents 814a958 + c20c8f7 commit 22292b9
Show file tree
Hide file tree
Showing 6 changed files with 442 additions and 13 deletions.
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/clockdomains7xx_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ static struct clockdomain ipu_7xx_clkdm = {
.cm_inst = DRA7XX_CM_CORE_AON_IPU_INST,
.clkdm_offs = DRA7XX_CM_CORE_AON_IPU_IPU_CDOFFS,
.dep_bit = DRA7XX_IPU_STATDEP_SHIFT,
.flags = CLKDM_CAN_HWSUP_SWSUP,
.flags = CLKDM_CAN_SWSUP,
};

static struct clockdomain mpu1_7xx_clkdm = {
Expand Down
20 changes: 10 additions & 10 deletions arch/arm/mach-omap2/omap_hwmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -1416,9 +1416,7 @@ static void _enable_sysc(struct omap_hwmod *oh)
(sf & SYSC_HAS_CLOCKACTIVITY))
_set_clockactivity(oh, oh->class->sysc->clockact, &v);

/* If the cached value is the same as the new value, skip the write */
if (oh->_sysc_cache != v)
_write_sysconfig(v, oh);
_write_sysconfig(v, oh);

/*
* Set the autoidle bit only after setting the smartidle bit
Expand Down Expand Up @@ -1481,7 +1479,9 @@ static void _idle_sysc(struct omap_hwmod *oh)
_set_master_standbymode(oh, idlemode, &v);
}

_write_sysconfig(v, oh);
/* If the cached value is the same as the new value, skip the write */
if (oh->_sysc_cache != v)
_write_sysconfig(v, oh);
}

/**
Expand Down Expand Up @@ -2207,15 +2207,15 @@ static int _idle(struct omap_hwmod *oh)

pr_debug("omap_hwmod: %s: idling\n", oh->name);

if (_are_all_hardreset_lines_asserted(oh))
return 0;

if (oh->_state != _HWMOD_STATE_ENABLED) {
WARN(1, "omap_hwmod: %s: idle state can only be entered from enabled state\n",
oh->name);
return -EINVAL;
}

if (_are_all_hardreset_lines_asserted(oh))
return 0;

if (oh->class->sysc)
_idle_sysc(oh);
_del_initiator_dep(oh, mpu_oh);
Expand Down Expand Up @@ -2262,16 +2262,16 @@ static int _shutdown(struct omap_hwmod *oh)
int ret, i;
u8 prev_state;

if (_are_all_hardreset_lines_asserted(oh))
return 0;

if (oh->_state != _HWMOD_STATE_IDLE &&
oh->_state != _HWMOD_STATE_ENABLED) {
WARN(1, "omap_hwmod: %s: disabled state can only be entered from idle, or enabled state\n",
oh->name);
return -EINVAL;
}

if (_are_all_hardreset_lines_asserted(oh))
return 0;

pr_debug("omap_hwmod: %s: disabling\n", oh->name);

if (oh->class->pre_shutdown) {
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-omap2/omap_hwmod.h
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,8 @@ const char *omap_hwmod_get_main_clk(struct omap_hwmod *oh);
*/

extern int omap_hwmod_aess_preprogram(struct omap_hwmod *oh);
void omap_hwmod_rtc_unlock(struct omap_hwmod *oh);
void omap_hwmod_rtc_lock(struct omap_hwmod *oh);

/*
* Chip variant-specific hwmod init routines - XXX should be converted
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,8 @@ static struct omap_hwmod_class_sysconfig am33xx_rtc_sysc = {
static struct omap_hwmod_class am33xx_rtc_hwmod_class = {
.name = "rtc",
.sysc = &am33xx_rtc_sysc,
.unlock = &omap_hwmod_rtc_unlock,
.lock = &omap_hwmod_rtc_lock,
};

struct omap_hwmod am33xx_rtc_hwmod = {
Expand Down
Loading

0 comments on commit 22292b9

Please sign in to comment.