[Sound-open-firmware] [PATCH v2] cnl: core: Add support for xcc

Liam Girdwood liam.r.girdwood at linux.intel.com
Fri Mar 30 15:45:50 CEST 2018


xcc has more strict rules than gcc:
- Add missing sections to linker scripts
- Fix compile warnings
- Extend memory enabling timeout to infinite (too small delay for xcc)

Signed-off-by: Tomasz Lauda <tomasz.lauda at linux.intel.com>

# Conflicts:
#	src/platform/apollolake/platform.c
#	src/platform/cannonlake/platform.c
---
 rimage/manifest.c                                  |  9 +-
 rimage/manifest.h                                  |  3 +
 src/arch/xtensa/boot_loader.c                      | 11 +--
 .../apollolake/include/platform/platform.h         |  2 +-
 src/platform/apollolake/platform.c                 | 98 +++++++++++-----------
 src/platform/baytrail/platform.c                   | 84 ++++++++++---------
 src/platform/cannonlake/boot_ldr.x.in              |  7 +-
 src/platform/cannonlake/cannonlake.x.in            | 49 +++++------
 .../cannonlake/include/platform/platform.h         |  2 +-
 src/platform/cannonlake/platform.c                 | 98 +++++++++++-----------
 src/platform/haswell/platform.c                    | 84 ++++++++++---------
 11 files changed, 230 insertions(+), 217 deletions(-)

diff --git a/rimage/manifest.c b/rimage/manifest.c
index 243c194f..f3f85600 100644
--- a/rimage/manifest.c
+++ b/rimage/manifest.c
@@ -211,11 +211,18 @@ static int man_get_module_manifest(struct image *image, struct module *module,
 	section = &module->section[man_section_idx];
 
 	/* load in manifest data */
-	ret = fseek(module->fd, section->sh_offset, SEEK_SET);
+	/* module built using xcc has preceding bytes */
+	if (section->sh_size > sizeof(sof_mod))
+		ret = fseek(module->fd,
+			section->sh_offset + XCC_MOD_OFFSET, SEEK_SET);
+	else
+		ret = fseek(module->fd, section->sh_offset, SEEK_SET);
+
 	if (ret < 0) {
 		fprintf(stderr, "error: can't seek to section %d\n", ret);
 		return ret;
 	}
+
 	count = fread(&sof_mod, 1, sizeof(sof_mod), module->fd);
 	if (count != sizeof(sof_mod)) {
 		fprintf(stderr, "error: can't read section %d\n", -errno);
diff --git a/rimage/manifest.h b/rimage/manifest.h
index ca951321..8d1d3d2c 100644
--- a/rimage/manifest.h
+++ b/rimage/manifest.h
@@ -22,6 +22,9 @@
 
 #define MAN_PAGE_SIZE		4096
 
+/* start offset for modules built using xcc */
+#define XCC_MOD_OFFSET		0x8
+
 /* start offset for base FW module */
 #define FILE_TEXT_OFFSET		0x8000
 
diff --git a/src/arch/xtensa/boot_loader.c b/src/arch/xtensa/boot_loader.c
index 862db458..05d6bf90 100644
--- a/src/arch/xtensa/boot_loader.c
+++ b/src/arch/xtensa/boot_loader.c
@@ -121,7 +121,7 @@ static void parse_manifest(void)
 /* power on HPSRAM */
 static int32_t hp_sram_init(void)
 {
-	int delay_count = 256, timeout = 256;
+	int delay_count = 256;
 	uint32_t status;
 
 	shim_write(SHIM_LDOCTL, SHIM_HPMEM_POWER_ON);
@@ -141,24 +141,15 @@ static int32_t hp_sram_init(void)
 	status = io_reg_read(HSPGISTS0);
 	while (status) {
 		idelay(delay_count);
-
 		status = io_reg_read(HSPGISTS0);
-		if (timeout-- < 0) {
-			return -EIO;
-		}
 	}
 
 	/* query the power status of second part of HP memory */
 	/* and do as above code                               */
-	timeout = 256;
 	status = io_reg_read(HSPGISTS1);
 	while (status) {
 		idelay(delay_count);
-
 		status = io_reg_read(HSPGISTS1);
-		if (timeout-- < 0) {
-			return -EIO;
-		}
 	}
 
 	/* add some delay before touch power register */
diff --git a/src/platform/apollolake/include/platform/platform.h b/src/platform/apollolake/include/platform/platform.h
index 86172bfa..3a2d40bc 100644
--- a/src/platform/apollolake/include/platform/platform.h
+++ b/src/platform/apollolake/include/platform/platform.h
@@ -125,7 +125,7 @@ struct reef;
 #define platform_trace_point(__x) \
 	sw_reg_write(SRAM_REG_FW_TRACEP, __x)
 
-struct timer *platform_timer;
+extern struct timer *platform_timer;
 
 /*
  * APIs declared here are defined for every platform and IPC mechanism.
diff --git a/src/platform/apollolake/platform.c b/src/platform/apollolake/platform.c
index 2b41028b..ce408da6 100644
--- a/src/platform/apollolake/platform.c
+++ b/src/platform/apollolake/platform.c
@@ -78,54 +78,56 @@ static const struct sof_ipc_window sram_window = {
 		.type	= SOF_IPC_EXT_WINDOW,
 	},
 	.num_windows	= NUM_APL_WINDOWS,
-	.window[0]	= {
-		.type	= SOF_IPC_REGION_REGS,
-		.id	= 0,	/* map to host window 0 */
-		.flags	= 0, // TODO: set later
-		.size	= MAILBOX_SW_REG_SIZE,
-		.offset	= 0,
-	},
-	.window[1]	= {
-		.type	= SOF_IPC_REGION_UPBOX,
-		.id	= 0,	/* map to host window 0 */
-		.flags	= 0, // TODO: set later
-		.size	= MAILBOX_DSPBOX_SIZE,
-		.offset	= MAILBOX_SW_REG_SIZE,
-	},
-	.window[2]	= {
-		.type	= SOF_IPC_REGION_DOWNBOX,
-		.id	= 1,	/* map to host window 1 */
-		.flags	= 0, // TODO: set later
-		.size	= MAILBOX_HOSTBOX_SIZE,
-		.offset	= 0,
-	},
-	.window[3]	= {
-		.type	= SOF_IPC_REGION_DEBUG,
-		.id	= 2,	/* map to host window 2 */
-		.flags	= 0, // TODO: set later
-		.size	= MAILBOX_DEBUG_SIZE,
-		.offset	= 0,
-	},
-	.window[4]	= {
-		.type	= SOF_IPC_REGION_EXCEPTION,
-		.id	= 2,	/* map to host window 2 */
-		.flags	= 0, // TODO: set later
-		.size	= MAILBOX_EXCEPTION_SIZE,
-		.offset	= MAILBOX_EXCEPTION_OFFSET,
-	},
-	.window[5]	= {
-		.type	= SOF_IPC_REGION_STREAM,
-		.id	= 2,	/* map to host window 2 */
-		.flags	= 0, // TODO: set later
-		.size	= MAILBOX_STREAM_SIZE,
-		.offset	= MAILBOX_STREAM_OFFSET,
-	},
-	.window[6]	= {
-		.type	= SOF_IPC_REGION_TRACE,
-		.id	= 3,	/* map to host window 3 */
-		.flags	= 0, // TODO: set later
-		.size	= MAILBOX_TRACE_SIZE,
-		.offset	= 0,
+	.window	= {
+		{
+			.type	= SOF_IPC_REGION_REGS,
+			.id	= 0,	/* map to host window 0 */
+			.flags	= 0, // TODO: set later
+			.size	= MAILBOX_SW_REG_SIZE,
+			.offset	= 0,
+		},
+		{
+			.type	= SOF_IPC_REGION_UPBOX,
+			.id	= 0,	/* map to host window 0 */
+			.flags	= 0, // TODO: set later
+			.size	= MAILBOX_DSPBOX_SIZE,
+			.offset	= MAILBOX_SW_REG_SIZE,
+		},
+		{
+			.type	= SOF_IPC_REGION_DOWNBOX,
+			.id	= 1,	/* map to host window 1 */
+			.flags	= 0, // TODO: set later
+			.size	= MAILBOX_HOSTBOX_SIZE,
+			.offset	= 0,
+		},
+		{
+			.type	= SOF_IPC_REGION_DEBUG,
+			.id	= 2,	/* map to host window 2 */
+			.flags	= 0, // TODO: set later
+			.size	= MAILBOX_EXCEPTION_SIZE + MAILBOX_DEBUG_SIZE,
+			.offset	= 0,
+		},
+		{
+			.type	= SOF_IPC_REGION_EXCEPTION,
+			.id	= 2,	/* map to host window 2 */
+			.flags	= 0, // TODO: set later
+			.size	= MAILBOX_EXCEPTION_SIZE,
+			.offset	= MAILBOX_EXCEPTION_OFFSET,
+		},
+		{
+			.type	= SOF_IPC_REGION_STREAM,
+			.id	= 2,	/* map to host window 2 */
+			.flags	= 0, // TODO: set later
+			.size	= MAILBOX_STREAM_SIZE,
+			.offset	= MAILBOX_STREAM_OFFSET,
+		},
+		{
+			.type	= SOF_IPC_REGION_TRACE,
+			.id	= 3,	/* map to host window 3 */
+			.flags	= 0, // TODO: set later
+			.size	= MAILBOX_TRACE_SIZE,
+			.offset	= 0,
+		},
 	},
 };
 
diff --git a/src/platform/baytrail/platform.c b/src/platform/baytrail/platform.c
index 8fa03a75..1917054e 100644
--- a/src/platform/baytrail/platform.c
+++ b/src/platform/baytrail/platform.c
@@ -79,47 +79,49 @@ static const struct sof_ipc_window sram_window = {
 		.type	= SOF_IPC_EXT_WINDOW,
 	},
 	.num_windows	= NUM_BYT_WINDOWS,
-	.window[0]	= {
-		.type	= SOF_IPC_REGION_UPBOX,
-		.id	= 0,	/* map to host window 0 */
-		.flags	= 0, // TODO: set later
-		.size	= MAILBOX_DSPBOX_SIZE,
-		.offset	= MAILBOX_DSPBOX_OFFSET,
-	},
-	.window[1]	= {
-		.type	= SOF_IPC_REGION_DOWNBOX,
-		.id	= 0,	/* map to host window 0 */
-		.flags	= 0, // TODO: set later
-		.size	= MAILBOX_HOSTBOX_SIZE,
-		.offset	= MAILBOX_HOSTBOX_OFFSET,
-	},
-	.window[2]	= {
-		.type	= SOF_IPC_REGION_DEBUG,
-		.id	= 0,	/* map to host window 0 */
-		.flags	= 0, // TODO: set later
-		.size	= MAILBOX_DEBUG_SIZE,
-		.offset	= MAILBOX_DEBUG_OFFSET,
-	},
-	.window[3]	= {
-		.type	= SOF_IPC_REGION_TRACE,
-		.id	= 0,	/* map to host window 0 */
-		.flags	= 0, // TODO: set later
-		.size	= MAILBOX_TRACE_SIZE,
-		.offset	= MAILBOX_TRACE_OFFSET,
-	},
-	.window[4]	= {
-		.type	= SOF_IPC_REGION_STREAM,
-		.id	= 0,	/* map to host window 0 */
-		.flags	= 0, // TODO: set later
-		.size	= MAILBOX_STREAM_SIZE,
-		.offset	= MAILBOX_STREAM_OFFSET,
-	},
-	.window[5]	= {
-		.type	= SOF_IPC_REGION_EXCEPTION,
-		.id	= 0,	/* map to host window 0 */
-		.flags	= 0, // TODO: set later
-		.size	= MAILBOX_EXCEPTION_SIZE,
-		.offset	= MAILBOX_EXCEPTION_OFFSET,
+	.window	= {
+		{
+			.type	= SOF_IPC_REGION_UPBOX,
+			.id	= 0,	/* map to host window 0 */
+			.flags	= 0, // TODO: set later
+			.size	= MAILBOX_DSPBOX_SIZE,
+			.offset	= MAILBOX_DSPBOX_OFFSET,
+		},
+		{
+			.type	= SOF_IPC_REGION_DOWNBOX,
+			.id	= 0,	/* map to host window 0 */
+			.flags	= 0, // TODO: set later
+			.size	= MAILBOX_HOSTBOX_SIZE,
+			.offset	= MAILBOX_HOSTBOX_OFFSET,
+		},
+		{
+			.type	= SOF_IPC_REGION_DEBUG,
+			.id	= 0,	/* map to host window 0 */
+			.flags	= 0, // TODO: set later
+			.size	= MAILBOX_DEBUG_SIZE,
+			.offset	= MAILBOX_DEBUG_OFFSET,
+		},
+		{
+			.type	= SOF_IPC_REGION_TRACE,
+			.id	= 0,	/* map to host window 0 */
+			.flags	= 0, // TODO: set later
+			.size	= MAILBOX_TRACE_SIZE,
+			.offset	= MAILBOX_TRACE_OFFSET,
+		},
+		{
+			.type	= SOF_IPC_REGION_STREAM,
+			.id	= 0,	/* map to host window 0 */
+			.flags	= 0, // TODO: set later
+			.size	= MAILBOX_STREAM_SIZE,
+			.offset	= MAILBOX_STREAM_OFFSET,
+		},
+		{
+			.type	= SOF_IPC_REGION_EXCEPTION,
+			.id	= 0,	/* map to host window 0 */
+			.flags	= 0, // TODO: set later
+			.size	= MAILBOX_EXCEPTION_SIZE,
+			.offset	= MAILBOX_EXCEPTION_OFFSET,
+		},
 	},
 };
 
diff --git a/src/platform/cannonlake/boot_ldr.x.in b/src/platform/cannonlake/boot_ldr.x.in
index a42fd897..b85bfab2 100644
--- a/src/platform/cannonlake/boot_ldr.x.in
+++ b/src/platform/cannonlake/boot_ldr.x.in
@@ -21,7 +21,7 @@ MEMORY
         org = IMR_BOOT_LDR_LIT_BASE,
         len = IMR_BOOT_LDR_LIT_SIZE
   reef_text :
-	org = IMR_BOOT_LDR_TEXT_BASE,
+        org = IMR_BOOT_LDR_TEXT_BASE,
         len = IMR_BOOT_LDR_TEXT_SIZE,
   vector_base_text :
         org = XCHAL_VECBASE_RESET_PADDR,
@@ -81,7 +81,7 @@ MEMORY
         org = XCHAL_DOUBLEEXC_VECTOR_PADDR,
         len = REEF_MEM_VECT_TEXT_SIZE
   reef_data :
-	org = IMR_BOOT_LDR_DATA_BASE,
+        org = IMR_BOOT_LDR_DATA_BASE,
         len = IMR_BOOT_LDR_DATA_SIZE
   reef_bss_data :
 	org = IMR_BOOT_LDR_BSS_BASE,
@@ -148,6 +148,9 @@ SECTIONS
     *(.fini.literal)
     KEEP(*(.fini))
     *(.gnu.version)
+    KEEP (*(.ResetVector.text))
+    KEEP (*(.ResetHandler.text))
+    KEEP (*(.MemoryExceptionVector.text))
     _text_end = ABSOLUTE(.);
     _etext = .;
   } >reef_text :reef_text_phdr
diff --git a/src/platform/cannonlake/cannonlake.x.in b/src/platform/cannonlake/cannonlake.x.in
index 47acd5e0..2a52d674 100644
--- a/src/platform/cannonlake/cannonlake.x.in
+++ b/src/platform/cannonlake/cannonlake.x.in
@@ -21,79 +21,79 @@ MEMORY
         org = XCHAL_RESET_VECTOR0_PADDR + REEF_MEM_RESET_TEXT_SIZE,
         len = REEF_MEM_RESET_LIT_SIZE
   vector_memory_lit :
-	org = XCHAL_MEMERROR_VECTOR_PADDR + REEF_MEM_ERROR_LIT_SIZE,
+        org = XCHAL_MEMERROR_VECTOR_PADDR + REEF_MEM_ERROR_LIT_SIZE,
         len = REEF_MEM_ERROR_LIT_SIZE
   vector_memory_text :
-	org = XCHAL_MEMERROR_VECTOR_PADDR,
+        org = XCHAL_MEMERROR_VECTOR_PADDR,
         len = REEF_MEM_ERROR_TEXT_SIZE
   vector_base_text :
-	org = XCHAL_VECBASE_RESET_PADDR,
+        org = XCHAL_VECBASE_RESET_PADDR,
         len = REEF_MEM_VECBASE_LIT_SIZE
   vector_int2_lit :
-	org = XCHAL_INTLEVEL2_VECTOR_PADDR - REEF_MEM_VECT_LIT_SIZE,
+        org = XCHAL_INTLEVEL2_VECTOR_PADDR - REEF_MEM_VECT_LIT_SIZE,
         len = REEF_MEM_VECT_LIT_SIZE
   vector_int2_text :
         org = XCHAL_INTLEVEL2_VECTOR_PADDR,
         len = REEF_MEM_VECT_TEXT_SIZE
   vector_int3_lit :
-	org = XCHAL_INTLEVEL3_VECTOR_PADDR - REEF_MEM_VECT_LIT_SIZE,
+        org = XCHAL_INTLEVEL3_VECTOR_PADDR - REEF_MEM_VECT_LIT_SIZE,
         len = REEF_MEM_VECT_LIT_SIZE
   vector_int3_text :
-	org = XCHAL_INTLEVEL3_VECTOR_PADDR,
+        org = XCHAL_INTLEVEL3_VECTOR_PADDR,
         len = REEF_MEM_VECT_TEXT_SIZE
   vector_int4_lit :
-	org = XCHAL_INTLEVEL4_VECTOR_PADDR - REEF_MEM_VECT_LIT_SIZE,
+        org = XCHAL_INTLEVEL4_VECTOR_PADDR - REEF_MEM_VECT_LIT_SIZE,
         len = REEF_MEM_VECT_LIT_SIZE
   vector_int4_text :
-	org = XCHAL_INTLEVEL4_VECTOR_PADDR,
+        org = XCHAL_INTLEVEL4_VECTOR_PADDR,
         len = REEF_MEM_VECT_TEXT_SIZE
   vector_int5_lit :
-	org = XCHAL_INTLEVEL5_VECTOR_PADDR - REEF_MEM_VECT_LIT_SIZE,
+        org = XCHAL_INTLEVEL5_VECTOR_PADDR - REEF_MEM_VECT_LIT_SIZE,
         len = REEF_MEM_VECT_LIT_SIZE
   vector_int5_text :
-	org = XCHAL_INTLEVEL5_VECTOR_PADDR,
+        org = XCHAL_INTLEVEL5_VECTOR_PADDR,
         len = REEF_MEM_VECT_TEXT_SIZE
   vector_int6_lit :
-	org = XCHAL_INTLEVEL6_VECTOR_PADDR - REEF_MEM_VECT_LIT_SIZE,
+        org = XCHAL_INTLEVEL6_VECTOR_PADDR - REEF_MEM_VECT_LIT_SIZE,
         len = REEF_MEM_VECT_LIT_SIZE
   vector_int6_text :
-	org = XCHAL_INTLEVEL6_VECTOR_PADDR,
+        org = XCHAL_INTLEVEL6_VECTOR_PADDR,
         len = REEF_MEM_VECT_TEXT_SIZE
   vector_int7_lit :
-	org = XCHAL_INTLEVEL7_VECTOR_PADDR - REEF_MEM_VECT_LIT_SIZE,
+        org = XCHAL_INTLEVEL7_VECTOR_PADDR - REEF_MEM_VECT_LIT_SIZE,
         len = REEF_MEM_VECT_LIT_SIZE
   vector_int7_text :
-	org = XCHAL_INTLEVEL7_VECTOR_PADDR,
+        org = XCHAL_INTLEVEL7_VECTOR_PADDR,
         len = REEF_MEM_VECT_TEXT_SIZE
   vector_kernel_lit :
-	org = XCHAL_KERNEL_VECTOR_PADDR - REEF_MEM_VECT_LIT_SIZE,
+        org = XCHAL_KERNEL_VECTOR_PADDR - REEF_MEM_VECT_LIT_SIZE,
         len = REEF_MEM_VECT_LIT_SIZE
   vector_kernel_text :
-	org = XCHAL_KERNEL_VECTOR_PADDR,
+        org = XCHAL_KERNEL_VECTOR_PADDR,
         len = REEF_MEM_VECT_TEXT_SIZE
   vector_user_lit :
-	org = XCHAL_USER_VECTOR_PADDR - REEF_MEM_VECT_LIT_SIZE,
+        org = XCHAL_USER_VECTOR_PADDR - REEF_MEM_VECT_LIT_SIZE,
         len = REEF_MEM_VECT_LIT_SIZE
   vector_user_text :
-	org = XCHAL_USER_VECTOR_PADDR,
+        org = XCHAL_USER_VECTOR_PADDR,
         len = REEF_MEM_VECT_TEXT_SIZE
   vector_double_lit :
-	org = XCHAL_DOUBLEEXC_VECTOR_PADDR - REEF_MEM_VECT_LIT_SIZE,
+        org = XCHAL_DOUBLEEXC_VECTOR_PADDR - REEF_MEM_VECT_LIT_SIZE,
         len = REEF_MEM_VECT_LIT_SIZE
   vector_double_text :
-	org = XCHAL_DOUBLEEXC_VECTOR_PADDR,
+        org = XCHAL_DOUBLEEXC_VECTOR_PADDR,
         len = REEF_MEM_VECT_TEXT_SIZE
   reef_text_start :
-	org = REEF_TEXT_START,
+        org = REEF_TEXT_START,
         len = REEF_TEXT_START_SIZE,
   reef_text :
-	org = REEF_TEXT_BASE,
+        org = REEF_TEXT_BASE,
         len = REEF_TEXT_SIZE,
   reef_data :
-	org = REEF_TEXT_BASE + REEF_TEXT_SIZE,
+        org = REEF_TEXT_BASE + REEF_TEXT_SIZE,
         len = REEF_DATA_SIZE
   reef_bss_data :
-	org = REEF_TEXT_BASE + REEF_TEXT_SIZE + REEF_DATA_SIZE,
+        org = REEF_TEXT_BASE + REEF_TEXT_SIZE + REEF_DATA_SIZE,
         len = REEF_BSS_DATA_SIZE
   system_heap :
         org = HEAP_SYSTEM_BASE,
@@ -350,6 +350,7 @@ SECTIONS
     *(.fini.literal)
     KEEP(*(.fini))
     *(.gnu.version)
+    KEEP (*(.ResetHandler.text))
     _text_end = ABSOLUTE(.);
     _etext = .;
   } >reef_text :reef_text_phdr
diff --git a/src/platform/cannonlake/include/platform/platform.h b/src/platform/cannonlake/include/platform/platform.h
index 764ef76a..44345bc3 100644
--- a/src/platform/cannonlake/include/platform/platform.h
+++ b/src/platform/cannonlake/include/platform/platform.h
@@ -120,7 +120,7 @@ struct reef;
 #define platform_trace_point(__x) \
 	sw_reg_write(SRAM_REG_FW_TRACEP, __x)
 
-struct timer *platform_timer;
+extern struct timer *platform_timer;
 
 /*
  * APIs declared here are defined for every platform and IPC mechanism.
diff --git a/src/platform/cannonlake/platform.c b/src/platform/cannonlake/platform.c
index 1f1fd2fc..a0198e5b 100644
--- a/src/platform/cannonlake/platform.c
+++ b/src/platform/cannonlake/platform.c
@@ -80,54 +80,56 @@ static const struct sof_ipc_window sram_window = {
 		.type	= SOF_IPC_EXT_WINDOW,
 	},
 	.num_windows	= NUM_CNL_WINDOWS,
-	.window[0]	= {
-		.type	= SOF_IPC_REGION_REGS,
-		.id	= 0,	/* map to host window 0 */
-		.flags	= 0, // TODO: set later
-		.size	= MAILBOX_SW_REG_SIZE,
-		.offset	= 0,
-	},
-	.window[1]	= {
-		.type	= SOF_IPC_REGION_UPBOX,
-		.id	= 0,	/* map to host window 0 */
-		.flags	= 0, // TODO: set later
-		.size	= MAILBOX_DSPBOX_SIZE,
-		.offset	= MAILBOX_SW_REG_SIZE,
-	},
-	.window[2]	= {
-		.type	= SOF_IPC_REGION_DOWNBOX,
-		.id	= 1,	/* map to host window 1 */
-		.flags	= 0, // TODO: set later
-		.size	= MAILBOX_HOSTBOX_SIZE,
-		.offset	= 0,
-	},
-	.window[3]	= {
-		.type	= SOF_IPC_REGION_DEBUG,
-		.id	= 2,	/* map to host window 2 */
-		.flags	= 0, // TODO: set later
-		.size	= MAILBOX_DEBUG_SIZE,
-		.offset	= 0,
-	},
-	.window[4]	= {
-		.type	= SOF_IPC_REGION_EXCEPTION,
-		.id	= 2,	/* map to host window 2 */
-		.flags	= 0, // TODO: set later
-		.size	= MAILBOX_EXCEPTION_SIZE,
-		.offset	= MAILBOX_EXCEPTION_OFFSET,
-	},
-	.window[5]	= {
-		.type	= SOF_IPC_REGION_STREAM,
-		.id	= 2,	/* map to host window 2 */
-		.flags	= 0, // TODO: set later
-		.size	= MAILBOX_STREAM_SIZE,
-		.offset	= MAILBOX_STREAM_OFFSET,
-	},
-	.window[6]	= {
-		.type	= SOF_IPC_REGION_TRACE,
-		.id	= 3,	/* map to host window 3 */
-		.flags	= 0, // TODO: set later
-		.size	= MAILBOX_TRACE_SIZE,
-		.offset	= 0,
+	.window	= {
+		{
+			.type	= SOF_IPC_REGION_REGS,
+			.id	= 0,	/* map to host window 0 */
+			.flags	= 0, // TODO: set later
+			.size	= MAILBOX_SW_REG_SIZE,
+			.offset	= 0,
+		},
+		{
+			.type	= SOF_IPC_REGION_UPBOX,
+			.id	= 0,	/* map to host window 0 */
+			.flags	= 0, // TODO: set later
+			.size	= MAILBOX_DSPBOX_SIZE,
+			.offset	= MAILBOX_SW_REG_SIZE,
+		},
+		{
+			.type	= SOF_IPC_REGION_DOWNBOX,
+			.id	= 1,	/* map to host window 1 */
+			.flags	= 0, // TODO: set later
+			.size	= MAILBOX_HOSTBOX_SIZE,
+			.offset	= 0,
+		},
+		{
+			.type	= SOF_IPC_REGION_DEBUG,
+			.id	= 2,	/* map to host window 2 */
+			.flags	= 0, // TODO: set later
+			.size	= MAILBOX_EXCEPTION_SIZE + MAILBOX_DEBUG_SIZE,
+			.offset	= 0,
+		},
+		{
+			.type	= SOF_IPC_REGION_EXCEPTION,
+			.id	= 2,	/* map to host window 2 */
+			.flags	= 0, // TODO: set later
+			.size	= MAILBOX_EXCEPTION_SIZE,
+			.offset	= MAILBOX_EXCEPTION_OFFSET,
+		},
+		{
+			.type	= SOF_IPC_REGION_STREAM,
+			.id	= 2,	/* map to host window 2 */
+			.flags	= 0, // TODO: set later
+			.size	= MAILBOX_STREAM_SIZE,
+			.offset	= MAILBOX_STREAM_OFFSET,
+		},
+		{
+			.type	= SOF_IPC_REGION_TRACE,
+			.id	= 3,	/* map to host window 3 */
+			.flags	= 0, // TODO: set later
+			.size	= MAILBOX_TRACE_SIZE,
+			.offset	= 0,
+		},
 	},
 };
 
diff --git a/src/platform/haswell/platform.c b/src/platform/haswell/platform.c
index e9270ac1..30e8e5d7 100644
--- a/src/platform/haswell/platform.c
+++ b/src/platform/haswell/platform.c
@@ -78,47 +78,49 @@ static const struct sof_ipc_window sram_window = {
 		.type	= SOF_IPC_EXT_WINDOW,
 	},
 	.num_windows	= NUM_HSW_WINDOWS,
-	.window[0]	= {
-		.type	= SOF_IPC_REGION_UPBOX,
-		.id	= 0,	/* map to host window 0 */
-		.flags	= 0, // TODO: set later
-		.size	= MAILBOX_DSPBOX_SIZE,
-		.offset	= MAILBOX_DSPBOX_OFFSET,
-	},
-	.window[1]	= {
-		.type	= SOF_IPC_REGION_DOWNBOX,
-		.id	= 0,	/* map to host window 0 */
-		.flags	= 0, // TODO: set later
-		.size	= MAILBOX_HOSTBOX_SIZE,
-		.offset	= MAILBOX_HOSTBOX_OFFSET,
-	},
-	.window[2]	= {
-		.type	= SOF_IPC_REGION_DEBUG,
-		.id	= 0,	/* map to host window 0 */
-		.flags	= 0, // TODO: set later
-		.size	= MAILBOX_DEBUG_SIZE,
-		.offset	= MAILBOX_DEBUG_OFFSET,
-	},
-	.window[3]	= {
-		.type	= SOF_IPC_REGION_TRACE,
-		.id	= 0,	/* map to host window 0 */
-		.flags	= 0, // TODO: set later
-		.size	= MAILBOX_TRACE_SIZE,
-		.offset	= MAILBOX_TRACE_OFFSET,
-	},
-	.window[4]	= {
-		.type	= SOF_IPC_REGION_STREAM,
-		.id	= 0,	/* map to host window 0 */
-		.flags	= 0, // TODO: set later
-		.size	= MAILBOX_STREAM_SIZE,
-		.offset	= MAILBOX_STREAM_OFFSET,
-	},
-	.window[5]	= {
-		.type	= SOF_IPC_REGION_EXCEPTION,
-		.id	= 0,	/* map to host window 0 */
-		.flags	= 0, // TODO: set later
-		.size	= MAILBOX_EXCEPTION_SIZE,
-		.offset	= MAILBOX_EXCEPTION_OFFSET,
+	.window	= {
+		{
+			.type	= SOF_IPC_REGION_UPBOX,
+			.id	= 0,	/* map to host window 0 */
+			.flags	= 0, // TODO: set later
+			.size	= MAILBOX_DSPBOX_SIZE,
+			.offset	= MAILBOX_DSPBOX_OFFSET,
+		},
+		{
+			.type	= SOF_IPC_REGION_DOWNBOX,
+			.id	= 0,	/* map to host window 0 */
+			.flags	= 0, // TODO: set later
+			.size	= MAILBOX_HOSTBOX_SIZE,
+			.offset	= MAILBOX_HOSTBOX_OFFSET,
+		},
+		{
+			.type	= SOF_IPC_REGION_DEBUG,
+			.id	= 0,	/* map to host window 0 */
+			.flags	= 0, // TODO: set later
+			.size	= MAILBOX_DEBUG_SIZE,
+			.offset	= MAILBOX_DEBUG_OFFSET,
+		},
+		{
+			.type	= SOF_IPC_REGION_TRACE,
+			.id	= 0,	/* map to host window 0 */
+			.flags	= 0, // TODO: set later
+			.size	= MAILBOX_TRACE_SIZE,
+			.offset	= MAILBOX_TRACE_OFFSET,
+		},
+		{
+			.type	= SOF_IPC_REGION_STREAM,
+			.id	= 0,	/* map to host window 0 */
+			.flags	= 0, // TODO: set later
+			.size	= MAILBOX_STREAM_SIZE,
+			.offset	= MAILBOX_STREAM_OFFSET,
+		},
+		{
+			.type	= SOF_IPC_REGION_EXCEPTION,
+			.id	= 0,	/* map to host window 0 */
+			.flags	= 0, // TODO: set later
+			.size	= MAILBOX_EXCEPTION_SIZE,
+			.offset	= MAILBOX_EXCEPTION_OFFSET,
+		},
 	},
 };
 
-- 
2.14.1



More information about the Sound-open-firmware mailing list