Skip to content

Commit 1933de9

Browse files
tlaudaslawblauciak
authored andcommitted
apl: platform: set ownership to DSP
Sets ownership of LPGPDMA, DMIC, I2S and some other generic registers to DSP. Normally it's set by ROM, but on some older APL steppings last two I2S ports were omitted, so FW got exception on boot. Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
1 parent 3845c03 commit 1933de9

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

src/platform/apollolake/include/platform/shim.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,19 @@
158158

159159
#define SHIM_L2_MECS (SHIM_BASE + 0xd0)
160160

161+
#define SHIM_LPGPDMAC(x) (0x1110 + (2 * x))
162+
#define SHIM_LPGPDMAC_CTLOSEL (1 << 15)
163+
#define SHIM_LPGPDMAC_CHOSEL (0xFF)
164+
165+
#define SHIM_DSPIOPO 0x1118
166+
#define SHIM_DSPIOPO_DMICOSEL (1 << 0)
167+
#define SHIM_DSPIOPO_I2SOSEL (0x3F << 8)
168+
169+
#define SHIM_GENO 0x111C
170+
#define SHIM_GENO_SHIMOSEL (1 << 0)
171+
#define SHIM_GENO_MDIVOSEL (1 << 1)
172+
#define SHIM_GENO_DIOPTOSEL (1 << 2)
173+
161174
#define SHIM_L2_CACHE_CTRL (SHIM_BASE + 0x500)
162175
#define SHIM_L2_PREF_CFG (SHIM_BASE + 0x508)
163176
#define SHIM_L2_CACHE_PREF (SHIM_BASE + 0x510)

src/platform/apollolake/platform.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,30 @@ static void platform_memory_windows_init(void)
194194
dcache_writeback_region((void *)HP_SRAM_WIN3_BASE, HP_SRAM_WIN3_SIZE);
195195
}
196196

197+
/* init HW */
198+
static void platform_init_hw(void)
199+
{
200+
io_reg_write(SHIM_GENO, SHIM_GENO_SHIMOSEL |
201+
SHIM_GENO_MDIVOSEL | SHIM_GENO_DIOPTOSEL);
202+
203+
io_reg_write(SHIM_DSPIOPO,
204+
SHIM_DSPIOPO_DMICOSEL | SHIM_DSPIOPO_I2SOSEL);
205+
206+
io_reg_write(SHIM_LPGPDMAC(0),
207+
SHIM_LPGPDMAC_CHOSEL | SHIM_LPGPDMAC_CTLOSEL);
208+
io_reg_write(SHIM_LPGPDMAC(1),
209+
SHIM_LPGPDMAC_CHOSEL | SHIM_LPGPDMAC_CTLOSEL);
210+
}
211+
197212
int platform_init(struct sof *sof)
198213
{
199214
struct dai *ssp;
200215
struct dai *dmic0;
201216
int i, ret;
202217

218+
trace_point(TRACE_BOOT_PLATFORM_ENTRY);
219+
platform_init_hw();
220+
203221
platform_interrupt_init();
204222

205223
trace_point(TRACE_BOOT_PLATFORM_MBOX);

0 commit comments

Comments
 (0)