Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 226618
b: refs/heads/master
c: 596efe4
h: refs/heads/master
v: v3
  • Loading branch information
Paul Walmsley committed Dec 22, 2010
1 parent c0ec459 commit 4a74ef4
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 72e06d087204f3bc9acf281717b90ebf0b9731f7
refs/heads/master: 596efe4792c50163578578bd4fe470f97652aad7
31 changes: 31 additions & 0 deletions trunk/arch/arm/mach-omap2/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
#include "pm.h"
#include "control.h"

/* Used by omap3_ctrl_save_padconf() */
#define START_PADCONF_SAVE 0x2
#define PADCONF_SAVE_DONE 0x1

static void __iomem *omap2_ctrl_base;
static void __iomem *omap4_ctrl_pad_base;

Expand Down Expand Up @@ -530,4 +534,31 @@ void omap3630_ctrl_disable_rta(void)
omap_ctrl_writel(OMAP36XX_RTA_DISABLE, OMAP36XX_CONTROL_MEM_RTA_CTRL);
}

/**
* omap3_ctrl_save_padconf - save padconf registers to scratchpad RAM
*
* Tell the SCM to start saving the padconf registers, then wait for
* the process to complete. Returns 0 unconditionally, although it
* should also eventually be able to return -ETIMEDOUT, if the save
* does not complete.
*
* XXX This function is missing a timeout. What should it be?
*/
int omap3_ctrl_save_padconf(void)
{
u32 cpo;

/* Save the padconf registers */
cpo = omap_ctrl_readl(OMAP343X_CONTROL_PADCONF_OFF);
cpo |= START_PADCONF_SAVE;
omap_ctrl_writel(cpo, OMAP343X_CONTROL_PADCONF_OFF);

/* wait for the save to complete */
while (!(omap_ctrl_readl(OMAP343X_CONTROL_GENERAL_PURPOSE_STATUS)
& PADCONF_SAVE_DONE))
udelay(1);

return 0;
}

#endif /* CONFIG_ARCH_OMAP3 && CONFIG_PM */
1 change: 1 addition & 0 deletions trunk/arch/arm/mach-omap2/control.h
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ extern void omap3_control_save_context(void);
extern void omap3_control_restore_context(void);
extern void omap3_ctrl_write_boot_mode(u8 bootmode);
extern void omap3630_ctrl_disable_rta(void);
extern int omap3_ctrl_save_padconf(void);
#else
#define omap_ctrl_base_get() 0
#define omap_ctrl_readb(x) 0
Expand Down
11 changes: 1 addition & 10 deletions trunk/arch/arm/mach-omap2/pm34xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,16 +133,7 @@ static void omap3_disable_io_chain(void)

static void omap3_core_save_context(void)
{
u32 control_padconf_off;

/* Save the padconf registers */
control_padconf_off = omap_ctrl_readl(OMAP343X_CONTROL_PADCONF_OFF);
control_padconf_off |= START_PADCONF_SAVE;
omap_ctrl_writel(control_padconf_off, OMAP343X_CONTROL_PADCONF_OFF);
/* wait for the save to complete */
while (!(omap_ctrl_readl(OMAP343X_CONTROL_GENERAL_PURPOSE_STATUS)
& PADCONF_SAVE_DONE))
udelay(1);
omap3_ctrl_save_padconf();

/*
* Force write last pad into memory, as this can fail in some
Expand Down
3 changes: 0 additions & 3 deletions trunk/arch/arm/plat-omap/include/plat/prcm.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ void omap_prcm_arch_reset(char mode, const char *cmd);
int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, u8 idlest,
const char *name);

#define START_PADCONF_SAVE 0x2
#define PADCONF_SAVE_DONE 0x1

#endif


Expand Down

0 comments on commit 4a74ef4

Please sign in to comment.