Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 292917
b: refs/heads/master
c: e5cc6aa
h: refs/heads/master
i:
  292915: 10187c8
v: v3
  • Loading branch information
Marcin Tomczak authored and James Bottomley committed Feb 19, 2012
1 parent e04f5fe commit 1cd42de
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 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: e3d338a536330b5ffc9f28d7c6a4cdf6ba51867a
refs/heads/master: e5cc6aa4b6ef34c3f054af8c61a4f73c157589c3
9 changes: 9 additions & 0 deletions trunk/drivers/scsi/isci/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -1491,6 +1491,15 @@ sci_controller_set_interrupt_coalescence(struct isci_host *ihost,
static void sci_controller_ready_state_enter(struct sci_base_state_machine *sm)
{
struct isci_host *ihost = container_of(sm, typeof(*ihost), sm);
u32 val;

/* enable clock gating for power control of the scu unit */
val = readl(&ihost->smu_registers->clock_gating_control);
val &= ~(SMU_CGUCR_GEN_BIT(REGCLK_ENABLE) |
SMU_CGUCR_GEN_BIT(TXCLK_ENABLE) |
SMU_CGUCR_GEN_BIT(XCLK_ENABLE));
val |= SMU_CGUCR_GEN_BIT(IDLE_ENABLE);
writel(val, &ihost->smu_registers->clock_gating_control);

/* set the default interrupt coalescence number and timeout value. */
sci_controller_set_interrupt_coalescence(ihost, 0, 0);
Expand Down
27 changes: 25 additions & 2 deletions trunk/drivers/scsi/isci/registers.h
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,27 @@ struct scu_iit_entry {
>> SMU_DEVICE_CONTEXT_CAPACITY_MAX_RNC_SHIFT \
)

/* ***************************************************************************** */
#define SMU_CLOCK_GATING_CONTROL_IDLE_ENABLE_SHIFT (0)
#define SMU_CLOCK_GATING_CONTROL_IDLE_ENABLE_MASK (0x00000001)
#define SMU_CLOCK_GATING_CONTROL_XCLK_ENABLE_SHIFT (1)
#define SMU_CLOCK_GATING_CONTROL_XCLK_ENABLE_MASK (0x00000002)
#define SMU_CLOCK_GATING_CONTROL_TXCLK_ENABLE_SHIFT (2)
#define SMU_CLOCK_GATING_CONTROL_TXCLK_ENABLE_MASK (0x00000004)
#define SMU_CLOCK_GATING_CONTROL_REGCLK_ENABLE_SHIFT (3)
#define SMU_CLOCK_GATING_CONTROL_REGCLK_ENABLE_MASK (0x00000008)
#define SMU_CLOCK_GATING_CONTROL_IDLE_TIMEOUT_SHIFT (16)
#define SMU_CLOCK_GATING_CONTROL_IDLE_TIMEOUT_MASK (0x000F0000)
#define SMU_CLOCK_GATING_CONTROL_FORCE_IDLE_SHIFT (31)
#define SMU_CLOCK_GATING_CONTROL_FORCE_IDLE_MASK (0x80000000)
#define SMU_CLOCK_GATING_CONTROL_RESERVED_MASK (0x7FF0FFF0)

#define SMU_CGUCR_GEN_VAL(name, value) \
SCU_GEN_VALUE(SMU_CLOCK_GATING_CONTROL_##name, value)

#define SMU_CGUCR_GEN_BIT(name) \
SCU_GEN_BIT(SMU_CLOCK_GATING_CONTROL_##name)

/* -------------------------------------------------------------------------- */

#define SMU_CONTROL_STATUS_TASK_CONTEXT_RANGE_ENABLE_SHIFT (0)
Expand Down Expand Up @@ -992,8 +1013,10 @@ struct smu_registers {
u32 mmr_address_window;
/* 0x00A4 SMDW */
u32 mmr_data_window;
u32 reserved_A8;
u32 reserved_AC;
/* 0x00A8 CGUCR */
u32 clock_gating_control;
/* 0x00AC CGUPC */
u32 clock_gating_performance;
/* A whole bunch of reserved space */
u32 reserved_Bx[4];
u32 reserved_Cx[4];
Expand Down

0 comments on commit 1cd42de

Please sign in to comment.