Skip to content

Commit 0db7fba

Browse files
authored
Merge pull request #322 from RanderWang/pmc-1.2
byt: remove waiti on byt
2 parents f0adccb + bbf1afe commit 0db7fba

2 files changed

Lines changed: 14 additions & 10 deletions

File tree

src/ipc/pmc-ipc.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ static void irq_handler(void *arg)
126126
int ipc_pmc_send_msg(uint32_t message)
127127
{
128128
uint32_t ipclpesch;
129-
uint32_t irq_mask;
129+
int try = 0;
130130

131131
trace_ipc("SMs");
132132

@@ -138,22 +138,23 @@ int ipc_pmc_send_msg(uint32_t message)
138138
return -EAGAIN;
139139
}
140140

141-
/* disable all interrupts except for SCU */
142-
irq_mask = arch_interrupt_disable_mask(~(1 << IRQ_NUM_EXT_PMC));
143-
144141
/* send the new message */
145142
shim_write(SHIM_IPCLPESCL, 0);
146143
shim_write(SHIM_IPCLPESCH, SHIM_IPCLPESCH_BUSY | message);
147144

148-
/* now wait for clock change */
149-
wait_for_interrupt(0);
150-
151-
/* enable other IRQs */
152-
arch_interrupt_enable_mask(irq_mask);
153-
154145
/* check status */
155146
ipclpesch = shim_read(SHIM_IPCLPESCH);
156147

148+
while (ipclpesch & SHIM_IPCLPESCH_BUSY) {
149+
/* now wait for clock change */
150+
idelay(PLATFORM_LPE_DELAY);
151+
ipclpesch = shim_read(SHIM_IPCLPESCH);
152+
153+
try++;
154+
if (try > 10)
155+
break;
156+
}
157+
157158
/* did command succeed */
158159
if (ipclpesch & SHIM_IPCLPESCH_BUSY) {
159160
trace_ipc_error("ePf");

src/platform/baytrail/include/platform/platform.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ struct sof;
102102
/* DSP default delay in cycles */
103103
#define PLATFORM_DEFAULT_DELAY 12
104104

105+
/* DSP LPE delay in cycles */
106+
#define PLATFORM_LPE_DELAY 2000
107+
105108
/* Platform defined panic code */
106109
static inline void platform_panic(uint32_t p)
107110
{

0 commit comments

Comments
 (0)