[Sound-open-firmware] [PATCH] Fix checkpatch warning.

yan.wang at linux.intel.com yan.wang at linux.intel.com
Wed Jan 24 10:59:37 CET 2018


From: Yan Wang <yan.wang at linux.intel.com>

Fix coding style, typo and dos file format based 
on checkpatch warning.
The checked commits are from f198ad907c5ad14cf7a99129ea8c17f40a632c29 
to f7beb51118e6e8463a864b9416c773a508930e06.

Signed-off-by: Yan Wang <yan.wang at linux.intel.com>
---
Tested on minnow max rt5651, 
SOF Master: f7beb51118e6e8463a864b9416c773a508930e06, 
SOF Tool Master: 59d81995f682876bd34f939332e8838c76f714ec, 
https://github.com/plbossart/sound/tree/topic/sof-v4.14: 5a91e6776d41b0e97828882294cdc00b5c0bafd6
---
 src/arch/xtensa/boot_entry.S                       |   2 +-
 src/arch/xtensa/boot_loader.c                      |   8 +-
 src/arch/xtensa/crt1-boards.S                      | 606 ++++++++++-----------
 src/arch/xtensa/include/arch/wait.h                |   3 +-
 src/ipc/apl-ipc.c                                  |   4 +-
 src/ipc/byt-ipc.c                                  |   8 +-
 src/ipc/cnl-ipc.c                                  |  10 +-
 src/ipc/hsw-ipc.c                                  |   8 +-
 src/lib/interrupt.c                                |   4 +-
 src/platform/apollolake/include/platform/memory.h  |   4 +-
 .../apollolake/include/platform/platform.h         |   2 +-
 src/platform/apollolake/interrupt.c                |  11 +-
 src/platform/baytrail/include/platform/platform.h  |   2 +-
 .../cannonlake/include/platform/platform.h         |   2 +-
 src/platform/cannonlake/interrupt.c                |  11 +-
 src/platform/cannonlake/platform.c                 |   4 +-
 src/platform/haswell/include/platform/platform.h   |   2 +-
 17 files changed, 343 insertions(+), 348 deletions(-)

diff --git a/src/arch/xtensa/boot_entry.S b/src/arch/xtensa/boot_entry.S
index cf793f5..5ad94bf 100644
--- a/src/arch/xtensa/boot_entry.S
+++ b/src/arch/xtensa/boot_entry.S
@@ -31,7 +31,7 @@
 /*
  * Entry point from ROM - assumes :-
  *
- * 1) C runtime environment is initalised by ROM.
+ * 1) C runtime environment is initialized by ROM.
  * 2) Stack is in first HPSRAM bank.
  */
 
diff --git a/src/arch/xtensa/boot_loader.c b/src/arch/xtensa/boot_loader.c
index 5c5939c..dfaa1a7 100644
--- a/src/arch/xtensa/boot_loader.c
+++ b/src/arch/xtensa/boot_loader.c
@@ -90,7 +90,7 @@ static void parse_module(struct sof_man_fw_header *hdr,
 			break;
 		case SOF_MAN_SEGMENT_BSS:
 			/* copy from IMR to SRAM */
-			bbzero((void*)mod->segment[i].v_base_addr,
+			bbzero((void *)mod->segment[i].v_base_addr,
 				mod->segment[i].flags.r.length * HOST_PAGE_SIZE);
 			break;
 		default:
@@ -143,9 +143,8 @@ static int32_t hp_sram_init(void)
 		idelay(delay_count);
 
 		status = io_reg_read(HSPGISTS0);
-		if (timeout-- < 0) {
+		if (timeout-- < 0)
 			return -EIO;
-		}
 	}
 
 	/* query the power status of second part of HP memory */
@@ -156,9 +155,8 @@ static int32_t hp_sram_init(void)
 		idelay(delay_count);
 
 		status = io_reg_read(HSPGISTS1);
-		if (timeout-- < 0) {
+		if (timeout-- < 0)
 			return -EIO;
-		}
 	}
 
 	/* add some delay before touch power register */
diff --git a/src/arch/xtensa/crt1-boards.S b/src/arch/xtensa/crt1-boards.S
index ff24bfd..7239f4f 100644
--- a/src/arch/xtensa/crt1-boards.S
+++ b/src/arch/xtensa/crt1-boards.S
@@ -1,303 +1,303 @@
-// crt1-boards.S
-//
-// For most hardware / boards, this code sets up the C calling context
-// (setting up stack, PS, and clearing BSS) and jumps to __clibrary_start
-// which sets up the C library, calls constructors and registers destructors,
-// and calls main().
-//
-// Control arrives here at _start from the reset vector or from crt0-app.S.
-
-// Copyright (c) 1998-2010 Tensilica Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#include <xtensa/coreasm.h>
-// DF #include "xtos-internal.h"
-//#include <xtensa/../../src/xtos/xtos-internal.h>
-
-//.global	_ResetVector
-#if 0
-/*
- * Reset vector.
- * Only a trampoline to jump to _start
- * (Note that we have to mark the section writable as the section contains
- *  a relocatable literal)
- */
-
-	.section .ResetVector.text, "awx"
-	.global _ResetVector
-_ResetVector:
-
-	j	1f
-	.align 4
-2:	.long	_start
-1:	l32r	a2, 2b
-	jx	a2
-#endif
-
-// Exports
-.global _start
-
-// Imports
-//   __clibrary_init		from C library (eg. newlib or uclibc)
-//   exit			from C library
-//   main			from user application
-//   board_init			board-specific (uart/mingloss/tinygloss.c)
-//   xthal_dcache_all_writeback	from HAL library
-//   __stack			from linker script (see LSP Ref Manual)
-//   _bss_table_start		from linker script (see LSP Ref Manual)
-//   _bss_table_end		from linker script (see LSP Ref Manual)
-
-.type	main, @function
-
-// Macros to abstract away ABI differences
-
-#if __XTENSA_CALL0_ABI__
-# define CALL	call0
-# define ARG1	a2	/* 1st outgoing call argument */
-# define ARG2	a3	/* 2nd outgoing call argument */
-# define ARG3	a4	/* 3rd outgoing call argument */
-# define ARG4	a5	/* 4th outgoing call argument */
-# define ARG5	a6	/* 5th outgoing call argument */
-#else
-# define CALL	call4
-# define CALLX  callx4
-# define ARG1	a6	/* 1st outgoing call argument */
-# define ARG2	a7	/* 2nd outgoing call argument */
-# define ARG3	a8	/* 3rd outgoing call argument */
-# define ARG4	a9	/* 4th outgoing call argument */
-# define ARG5	a10	/* 5th outgoing call argument */
-#endif
-
-
-/**************************************************************************/
-
-	.text
-	.align 4
-	.literal_position
-_start:
-	//  _start is typically NOT at the beginning of the text segment --
-	//  it is always called from either the reset vector or other code
-	//  that does equivalent initialization (such as crt0-app.S).
-	//
-	//  Assumptions on entry to _start:
-	//	- low (level-one) and medium priority interrupts are disabled
-	//	  via PS.INTLEVEL and/or INTENABLE (PS.INTLEVEL is expected to
-	//	  be zeroed, to potentially enable them, before calling main)
-	//	- C calling context not initialized:
-	//	  - PS not initialized
-	//	  - SP not initialized
-	//	- the following are initialized:
-	//	  - LITBASE, cache attributes, WindowBase, WindowStart,
-	//	    CPENABLE, FP's FCR and FSR, EXCSAVE[n]
-
-	// Keep a0 zero.  It is used to initialize a few things.
-	// It is also the return address, where zero indicates
-	// that the frame used by _start is the bottommost frame.
-	//
-#if !XCHAL_HAVE_HALT || !XCHAL_HAVE_BOOTLOADER		// not needed for Xtensa TX
-	movi	a0, 0		// keep this register zero.
-#endif
-
-#if XTOS_RESET_UNNEEDED && !XCHAL_HAVE_HALT
-#include "reset-unneeded.S"
-#endif
-
-#if XCHAL_HAVE_BOOTLOADER
-	.weak	_Level2FromVector
-	.weak	_Level3FromVector
-	.weak	_Level4FromVector
-	.weak	_Level5FromVector
-
-	movi	a4, _Level2FromVector
-	wsr	a4, EXCSAVE+2
-	movi	a4, _Level3FromVector
-	wsr	a4, EXCSAVE+3
-	movi	a4, _Level4FromVector
-	wsr	a4, EXCSAVE+4
-	movi	a4, _Level5FromVector
-	wsr	a4, EXCSAVE+5
-#endif
-
-	// Initialize the stack pointer.
-	// See the "ABI and Software Conventions" chapter in the
-	// Xtensa ISA Reference manual for details.
-
-	// NOTE: Because the _start routine does not use any memory in its
-	// stack frame, and because all of its CALL instructions use a
-	// window size of 4 (or zero), the stack frame for _start can be empty.
-
-	movi	sp, __stack
-
-	/*
-	 *  Now that sp (a1) is set, we can set PS as per the application
-	 *  (user vector mode, enable interrupts, enable window exceptions if applicable).
-	 */
-#if XCHAL_HAVE_EXCEPTIONS
-# ifdef __XTENSA_CALL0_ABI__
-	movi	a3, PS_UM		// PS.WOE = 0, PS.UM = 1, PS.EXCM = 0, PS.INTLEVEL = 0
-# else  
-	movi	a3, PS_UM|PS_WOE	// PS.WOE = 1, PS.UM = 1, PS.EXCM = 0, PS.INTLEVEL = 0
-# endif
-	wsr	a3, PS
-	rsync
-#endif
-
-/*
-	 *  Do any initialization that affects the memory map, such as
-	 *  setting up TLB entries, that needs to be done before we can
-	 *  successfully clear BSS (e.g. if some BSS segments are in
-	 *  remapped areas).
-	 *
-	 *  NOTE:  This hook works where the reset vector does not unpack
-	 *  segments (see "ROM packing" in the LSP manual), or where
-	 *  unpacking of segments is not affected by memory remapping.
-	 *  If ROM unpacking is affected, TLB setup must be done in
-	 *  assembler from the reset vector.
-	 *
-	 *  The __memmap_init() routine can be a C function, however it
-	 *  does not have BSS initialized!  In particular, __memmap_init()
-	 *  cannot set BSS variables, i.e. uninitialized global variables
-	 *  (they'll be wiped out by the following BSS clear), nor can it
-	 *  assume they are yet initialized to zero.
-	 *
-	 *  The __memmap_init() function is optional.  It is marked as a
-	 *  weak symbol, so that it gets valued zero if not defined.
-	 */
-
-	.weak	__memmap_init
-	movi	a4, __memmap_init
-	beqz	a4, 1f
-	CALLX	a4
-1:
-
-#if !XCHAL_HAVE_BOOTLOADER	/* boot loader takes care of zeroing BSS */
-	/*
-	 *  Clear the BSS (uninitialized data) segments.
-	 *  This code supports multiple zeroed sections (*.bss).
-	 *
-	 *  Register allocation:
-	 *	a0 = 0
-	 *	a6 = pointer to start of table, and through table
-	 *	a7 = pointer to end of table
-	 *	a8 = start address of bytes to be zeroed
-	 *	a9 = end address of bytes to be zeroed
-	 *	a10 = length of bytes to be zeroed
-	 */
-	movi	a0, 0
-	movi 	a6, _bss_table_start
-	movi 	a7, _bss_table_end
-	bgeu  	a6, a7, .L3zte
-
-.L0zte:	l32i 	a8, a6, 0	// get start address, assumed multiple of 4
-	l32i 	a9, a6, 4	// get end address, assumed multiple of 4
-	addi   	a6, a6, 8	// next entry
-	sub	a10, a9, a8	// a10 = length, assumed a multiple of 4
-	bbci.l	a10, 2, .L1zte
-	s32i	a0, a8, 0	// clear 4 bytes to make length multiple of 8
-	addi	a8, a8, 4
-.L1zte:	bbci.l	a10, 3, .L2zte
-	s32i	a0, a8, 0	// clear 8 bytes to make length multiple of 16
-	s32i	a0, a8, 4
-	addi	a8, a8, 8
-.L2zte:	srli	a10, a10, 4	// length is now multiple of 16, divide by 16
-	floopnez	a10, clearzte
-	s32i	a0, a8,	 0	// clear 16 bytes at a time...
-	s32i	a0, a8,	 4
-	s32i	a0, a8,	 8
-	s32i	a0, a8, 12
-	addi	a8, a8, 16
-	floopend	a10, clearzte
-
-	bltu  	a6, a7, .L0zte	// loop until end of table of *.bss sections
-.L3zte:
-#endif
-
-
-	//  We can now call C code, the C calling environment has been initialized.
-	//
-	//  From this point on, we use ABI-specific macros to refer to registers a0 .. a15
-	//  (ARG#).
-
-
-#if XCHAL_HAVE_HALT
-	//  Assume minimalist environment for memory-constrained TX cores.
-	//  No C library or board initialization, no parameters passed to main
-	//  (assume declared as "void main(void)") and no call to exit().
-
-	CALL	main
-	halt
-
-#else /* !HALT */
-
-	.type	board_init, @function
-	.type	__clibrary_init, @function
-	.type	exit, @function
-
-
-	//  Initialize the board (eg. the UART on the XT2000).
-	//CALL	board_init
-
-	/* 
-	 *  Call __clibrary_init to initialize the C library:
-	 *
-	 *  void __clibrary_init(int argc, char ** argv, char ** environ, 
-	 *		void(*init_func)(void), void(*fini_func)(void));
-	 */	
-
-	//  Pass an empty argv array, with an empty string as the program name.
-#if 0
-	movi	ARG1, _start_argc	// argc address
-	movi	ARG2, _start_argv	// argv = ["", 0]
-	movi	ARG3, _start_envp	// envp = [0]
-//	movi 	ARG4, _init		// function that calls constructors
-//  	movi	ARG5, _fini		// function that calls destructors
-	l32i	ARG1, ARG1, 0		// argc = 1
-	CALL	__clibrary_init
-#endif
-	//  Call:   int main(int argc, char ** argv, char ** environ);
-	movi	ARG1, _start_argc	// argc address
-	movi	ARG2, _start_argv	// argv = ["", 0]
-	movi	ARG3, _start_envp	// envp = [0]
-	l32i	ARG1, ARG1, 0		// argc = 1
-	CALL	main
-	//  The return value is the same register as the first outgoing argument.
-//	CALL	exit			// exit with main's return value
-	// Does not return here.
-
-	.data
-	//  Mark argc/argv/envp parameters as weak so that an external
-	//  object file can override them.
-	.weak	_start_argc, _start_argv, _start_envp
-	.align	4
-_start_argv:
-	.word	_start_null	// empty program name
-_start_null:
-_start_envp:
-	.word	0		// end of argv array, empty string, empty environ
-_start_argc:
-	.word	1		// one argument (program name)
-	.text
-
-#endif /* !HALT */
-
-	.size	_start, . - _start
-
-//#endif 
+// crt1-boards.S
+//
+// For most hardware / boards, this code sets up the C calling context
+// (setting up stack, PS, and clearing BSS) and jumps to __clibrary_start
+// which sets up the C library, calls constructors and registers destructors,
+// and calls main().
+//
+// Control arrives here at _start from the reset vector or from crt0-app.S.
+
+// Copyright (c) 1998-2010 Tensilica Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+#include <xtensa/coreasm.h>
+// DF #include "xtos-internal.h"
+//#include <xtensa/../../src/xtos/xtos-internal.h>
+
+//.global	_ResetVector
+#if 0
+/*
+ * Reset vector.
+ * Only a trampoline to jump to _start
+ * (Note that we have to mark the section writable as the section contains
+ *  a relocatable literal)
+ */
+
+	.section .ResetVector.text, "awx"
+	.global _ResetVector
+_ResetVector:
+
+	j	1f
+	.align 4
+2:	.long	_start
+1:	l32r	a2, 2b
+	jx	a2
+#endif
+
+// Exports
+.global _start
+
+// Imports
+//   __clibrary_init		from C library (eg. newlib or uclibc)
+//   exit			from C library
+//   main			from user application
+//   board_init			board-specific (uart/mingloss/tinygloss.c)
+//   xthal_dcache_all_writeback	from HAL library
+//   __stack			from linker script (see LSP Ref Manual)
+//   _bss_table_start		from linker script (see LSP Ref Manual)
+//   _bss_table_end		from linker script (see LSP Ref Manual)
+
+.type	main, @function
+
+// Macros to abstract away ABI differences
+
+#if __XTENSA_CALL0_ABI__
+# define CALL	call0
+# define ARG1	a2	/* 1st outgoing call argument */
+# define ARG2	a3	/* 2nd outgoing call argument */
+# define ARG3	a4	/* 3rd outgoing call argument */
+# define ARG4	a5	/* 4th outgoing call argument */
+# define ARG5	a6	/* 5th outgoing call argument */
+#else
+# define CALL	call4
+# define CALLX  callx4
+# define ARG1	a6	/* 1st outgoing call argument */
+# define ARG2	a7	/* 2nd outgoing call argument */
+# define ARG3	a8	/* 3rd outgoing call argument */
+# define ARG4	a9	/* 4th outgoing call argument */
+# define ARG5	a10	/* 5th outgoing call argument */
+#endif
+
+
+/**************************************************************************/
+
+	.text
+	.align 4
+	.literal_position
+_start:
+	//  _start is typically NOT at the beginning of the text segment --
+	//  it is always called from either the reset vector or other code
+	//  that does equivalent initialization (such as crt0-app.S).
+	//
+	//  Assumptions on entry to _start:
+	//	- low (level-one) and medium priority interrupts are disabled
+	//	  via PS.INTLEVEL and/or INTENABLE (PS.INTLEVEL is expected to
+	//	  be zeroed, to potentially enable them, before calling main)
+	//	- C calling context not initialized:
+	//	  - PS not initialized
+	//	  - SP not initialized
+	//	- the following are initialized:
+	//	  - LITBASE, cache attributes, WindowBase, WindowStart,
+	//	    CPENABLE, FP's FCR and FSR, EXCSAVE[n]
+
+	// Keep a0 zero.  It is used to initialize a few things.
+	// It is also the return address, where zero indicates
+	// that the frame used by _start is the bottommost frame.
+	//
+#if !XCHAL_HAVE_HALT || !XCHAL_HAVE_BOOTLOADER		// not needed for Xtensa TX
+	movi	a0, 0		// keep this register zero.
+#endif
+
+#if XTOS_RESET_UNNEEDED && !XCHAL_HAVE_HALT
+#include "reset-unneeded.S"
+#endif
+
+#if XCHAL_HAVE_BOOTLOADER
+	.weak	_Level2FromVector
+	.weak	_Level3FromVector
+	.weak	_Level4FromVector
+	.weak	_Level5FromVector
+
+	movi	a4, _Level2FromVector
+	wsr	a4, EXCSAVE+2
+	movi	a4, _Level3FromVector
+	wsr	a4, EXCSAVE+3
+	movi	a4, _Level4FromVector
+	wsr	a4, EXCSAVE+4
+	movi	a4, _Level5FromVector
+	wsr	a4, EXCSAVE+5
+#endif
+
+	// Initialize the stack pointer.
+	// See the "ABI and Software Conventions" chapter in the
+	// Xtensa ISA Reference manual for details.
+
+	// NOTE: Because the _start routine does not use any memory in its
+	// stack frame, and because all of its CALL instructions use a
+	// window size of 4 (or zero), the stack frame for _start can be empty.
+
+	movi	sp, __stack
+
+	/*
+	 *  Now that sp (a1) is set, we can set PS as per the application
+	 *  (user vector mode, enable interrupts, enable window exceptions if applicable).
+	 */
+#if XCHAL_HAVE_EXCEPTIONS
+# ifdef __XTENSA_CALL0_ABI__
+	movi	a3, PS_UM		// PS.WOE = 0, PS.UM = 1, PS.EXCM = 0, PS.INTLEVEL = 0
+# else
+	movi	a3, PS_UM|PS_WOE	// PS.WOE = 1, PS.UM = 1, PS.EXCM = 0, PS.INTLEVEL = 0
+# endif
+	wsr	a3, PS
+	rsync
+#endif
+
+/*
+	 *  Do any initialization that affects the memory map, such as
+	 *  setting up TLB entries, that needs to be done before we can
+	 *  successfully clear BSS (e.g. if some BSS segments are in
+	 *  remapped areas).
+	 *
+	 *  NOTE:  This hook works where the reset vector does not unpack
+	 *  segments (see "ROM packing" in the LSP manual), or where
+	 *  unpacking of segments is not affected by memory remapping.
+	 *  If ROM unpacking is affected, TLB setup must be done in
+	 *  assembler from the reset vector.
+	 *
+	 *  The __memmap_init() routine can be a C function, however it
+	 *  does not have BSS initialized!  In particular, __memmap_init()
+	 *  cannot set BSS variables, i.e. uninitialized global variables
+	 *  (they'll be wiped out by the following BSS clear), nor can it
+	 *  assume they are yet initialized to zero.
+	 *
+	 *  The __memmap_init() function is optional.  It is marked as a
+	 *  weak symbol, so that it gets valued zero if not defined.
+	 */
+
+	.weak	__memmap_init
+	movi	a4, __memmap_init
+	beqz	a4, 1f
+	CALLX	a4
+1:
+
+#if !XCHAL_HAVE_BOOTLOADER	/* boot loader takes care of zeroing BSS */
+	/*
+	 *  Clear the BSS (uninitialized data) segments.
+	 *  This code supports multiple zeroed sections (*.bss).
+	 *
+	 *  Register allocation:
+	 *	a0 = 0
+	 *	a6 = pointer to start of table, and through table
+	 *	a7 = pointer to end of table
+	 *	a8 = start address of bytes to be zeroed
+	 *	a9 = end address of bytes to be zeroed
+	 *	a10 = length of bytes to be zeroed
+	 */
+	movi	a0, 0
+	movi 	a6, _bss_table_start
+	movi 	a7, _bss_table_end
+	bgeu  	a6, a7, .L3zte
+
+.L0zte:	l32i 	a8, a6, 0	// get start address, assumed multiple of 4
+	l32i 	a9, a6, 4	// get end address, assumed multiple of 4
+	addi   	a6, a6, 8	// next entry
+	sub	a10, a9, a8	// a10 = length, assumed a multiple of 4
+	bbci.l	a10, 2, .L1zte
+	s32i	a0, a8, 0	// clear 4 bytes to make length multiple of 8
+	addi	a8, a8, 4
+.L1zte:	bbci.l	a10, 3, .L2zte
+	s32i	a0, a8, 0	// clear 8 bytes to make length multiple of 16
+	s32i	a0, a8, 4
+	addi	a8, a8, 8
+.L2zte:	srli	a10, a10, 4	// length is now multiple of 16, divide by 16
+	floopnez	a10, clearzte
+	s32i	a0, a8,	 0	// clear 16 bytes at a time...
+	s32i	a0, a8,	 4
+	s32i	a0, a8,	 8
+	s32i	a0, a8, 12
+	addi	a8, a8, 16
+	floopend	a10, clearzte
+
+	bltu  	a6, a7, .L0zte	// loop until end of table of *.bss sections
+.L3zte:
+#endif
+
+
+	//  We can now call C code, the C calling environment has been initialized.
+	//
+	//  From this point on, we use ABI-specific macros to refer to registers a0 .. a15
+	//  (ARG#).
+
+
+#if XCHAL_HAVE_HALT
+	//  Assume minimalist environment for memory-constrained TX cores.
+	//  No C library or board initialization, no parameters passed to main
+	//  (assume declared as "void main(void)") and no call to exit().
+
+	CALL	main
+	halt
+
+#else /* !HALT */
+
+	.type	board_init, @function
+	.type	__clibrary_init, @function
+	.type	exit, @function
+
+
+	//  Initialize the board (eg. the UART on the XT2000).
+	//CALL	board_init
+
+	/*
+	 *  Call __clibrary_init to initialize the C library:
+	 *
+	 *  void __clibrary_init(int argc, char ** argv, char ** environ,
+	 *		void(*init_func)(void), void(*fini_func)(void));
+	 */
+
+	//  Pass an empty argv array, with an empty string as the program name.
+#if 0
+	movi	ARG1, _start_argc	// argc address
+	movi	ARG2, _start_argv	// argv = ["", 0]
+	movi	ARG3, _start_envp	// envp = [0]
+//	movi 	ARG4, _init		// function that calls constructors
+//  	movi	ARG5, _fini		// function that calls destructors
+	l32i	ARG1, ARG1, 0		// argc = 1
+	CALL	__clibrary_init
+#endif
+	//  Call:   int main(int argc, char ** argv, char ** environ);
+	movi	ARG1, _start_argc	// argc address
+	movi	ARG2, _start_argv	// argv = ["", 0]
+	movi	ARG3, _start_envp	// envp = [0]
+	l32i	ARG1, ARG1, 0		// argc = 1
+	CALL	main
+	//  The return value is the same register as the first outgoing argument.
+//	CALL	exit			// exit with main's return value
+	// Does not return here.
+
+	.data
+	//  Mark argc/argv/envp parameters as weak so that an external
+	//  object file can override them.
+	.weak	_start_argc, _start_argv, _start_envp
+	.align	4
+_start_argv:
+	.word	_start_null	// empty program name
+_start_null:
+_start_envp:
+	.word	0		// end of argv array, empty string, empty environ
+_start_argc:
+	.word	1		// one argument (program name)
+	.text
+
+#endif /* !HALT */
+
+	.size	_start, . - _start
+
+//#endif
diff --git a/src/arch/xtensa/include/arch/wait.h b/src/arch/xtensa/include/arch/wait.h
index 2f6e4f5..2527324 100644
--- a/src/arch/xtensa/include/arch/wait.h
+++ b/src/arch/xtensa/include/arch/wait.h
@@ -62,8 +62,7 @@ static inline void arch_wait_for_interrupt(int level)
 
 static inline void idelay(int n)
 {
-	while (n--) {
+	while (n--)
 		asm volatile("nop");
-	}
 }
 
diff --git a/src/ipc/apl-ipc.c b/src/ipc/apl-ipc.c
index c779062..8597c27 100644
--- a/src/ipc/apl-ipc.c
+++ b/src/ipc/apl-ipc.c
@@ -204,8 +204,8 @@ int platform_ipc_init(struct ipc *ipc)
 	iipc->pm_prepare_D3 = 0;
 
 	/* configure interrupt */
-	interrupt_register(PLATFORM_IPC_INTERUPT, irq_handler, NULL);
-	interrupt_enable(PLATFORM_IPC_INTERUPT);
+	interrupt_register(PLATFORM_IPC_INTERRUPT, irq_handler, NULL);
+	interrupt_enable(PLATFORM_IPC_INTERRUPT);
 
 	/* enable IPC interrupts from host */
 	ipc_write(IPC_DIPCCTL, IPC_DIPCCTL_IPCIDIE | IPC_DIPCCTL_IPCTBIE);
diff --git a/src/ipc/byt-ipc.c b/src/ipc/byt-ipc.c
index 8897bb9..8760121 100644
--- a/src/ipc/byt-ipc.c
+++ b/src/ipc/byt-ipc.c
@@ -100,7 +100,7 @@ static void irq_handler(void *arg)
 
 		/* Mask Done interrupt before return */
 		shim_write(SHIM_IMRD, shim_read(SHIM_IMRD) | SHIM_IMRD_DONE);
-		interrupt_clear(PLATFORM_IPC_INTERUPT);
+		interrupt_clear(PLATFORM_IPC_INTERRUPT);
 		do_notify();
 	}
 
@@ -108,7 +108,7 @@ static void irq_handler(void *arg)
 
 		/* Mask Busy interrupt before return */
 		shim_write(SHIM_IMRD, shim_read(SHIM_IMRD) | SHIM_IMRD_BUSY);
-		interrupt_clear(PLATFORM_IPC_INTERUPT);
+		interrupt_clear(PLATFORM_IPC_INTERRUPT);
 
 		/* TODO: place message in Q and process later */
 		/* It's not Q ATM, may overwrite */
@@ -230,8 +230,8 @@ int platform_ipc_init(struct ipc *ipc)
 	iipc->pm_prepare_D3 = 0;
 
 	/* configure interrupt */
-	interrupt_register(PLATFORM_IPC_INTERUPT, irq_handler, NULL);
-	interrupt_enable(PLATFORM_IPC_INTERUPT);
+	interrupt_register(PLATFORM_IPC_INTERRUPT, irq_handler, NULL);
+	interrupt_enable(PLATFORM_IPC_INTERRUPT);
 
 	/* Unmask Busy and Done interrupts */
 	imrd = shim_read(SHIM_IMRD);
diff --git a/src/ipc/cnl-ipc.c b/src/ipc/cnl-ipc.c
index cd5e825..3522d67 100644
--- a/src/ipc/cnl-ipc.c
+++ b/src/ipc/cnl-ipc.c
@@ -91,7 +91,7 @@ static void irq_handler(void *arg)
 		ipc_write(IPC_DIPCCTL, ipc_read(IPC_DIPCCTL) & ~IPC_DIPCCTL_IPCIDIE);
 
 		/* clear DONE bit - tell host we have completed the operation */
-		ipc_write(IPC_DIPCIDA, ipc_read(IPC_DIPCIDA) |IPC_DIPCIDA_DONE);
+		ipc_write(IPC_DIPCIDA, ipc_read(IPC_DIPCIDA) | IPC_DIPCIDA_DONE);
 
 		/* unmask Done interrupt */
 		ipc_write(IPC_DIPCCTL, ipc_read(IPC_DIPCCTL) | IPC_DIPCCTL_IPCIDIE);
@@ -128,8 +128,8 @@ done:
 	ipc->host_pending = 0;
 
 	/* write 1 to clear busy, and trigger interrupt to host*/
-	ipc_write(IPC_DIPCTDR, ipc_read(IPC_DIPCTDR) |IPC_DIPCTDR_BUSY);
-	ipc_write(IPC_DIPCTDA, ipc_read(IPC_DIPCTDA) |IPC_DIPCTDA_BUSY );
+	ipc_write(IPC_DIPCTDR, ipc_read(IPC_DIPCTDR) | IPC_DIPCTDR_BUSY);
+	ipc_write(IPC_DIPCTDA, ipc_read(IPC_DIPCTDA) | IPC_DIPCTDA_BUSY);
 
 	/* unmask Busy interrupt */
 	ipc_write(IPC_DIPCCTL, ipc_read(IPC_DIPCCTL) | IPC_DIPCCTL_IPCTBIE);
@@ -202,8 +202,8 @@ int platform_ipc_init(struct ipc *ipc)
 	iipc->pm_prepare_D3 = 0;
 
 	/* configure interrupt */
-	interrupt_register(PLATFORM_IPC_INTERUPT, irq_handler, NULL);
-	interrupt_enable(PLATFORM_IPC_INTERUPT);
+	interrupt_register(PLATFORM_IPC_INTERRUPT, irq_handler, NULL);
+	interrupt_enable(PLATFORM_IPC_INTERRUPT);
 
 	/* enable IPC interrupts from host */
 	ipc_write(IPC_DIPCCTL, IPC_DIPCCTL_IPCIDIE | IPC_DIPCCTL_IPCTBIE);
diff --git a/src/ipc/hsw-ipc.c b/src/ipc/hsw-ipc.c
index 4a16f41..653c215 100644
--- a/src/ipc/hsw-ipc.c
+++ b/src/ipc/hsw-ipc.c
@@ -99,7 +99,7 @@ static void irq_handler(void *arg)
 
 		/* Mask Done interrupt before return */
 		shim_write(SHIM_IMRD, shim_read(SHIM_IMRD) | SHIM_IMRD_DONE);
-		interrupt_clear(PLATFORM_IPC_INTERUPT);
+		interrupt_clear(PLATFORM_IPC_INTERRUPT);
 		do_notify();
 	}
 
@@ -107,7 +107,7 @@ static void irq_handler(void *arg)
 
 		/* Mask Busy interrupt before return */
 		shim_write(SHIM_IMRD, shim_read(SHIM_IMRD) | SHIM_IMRD_BUSY);
-		interrupt_clear(PLATFORM_IPC_INTERUPT);
+		interrupt_clear(PLATFORM_IPC_INTERRUPT);
 
 		/* place message in Q and process later */
 		_ipc->host_msg = shim_read(SHIM_IPCX);
@@ -219,8 +219,8 @@ int platform_ipc_init(struct ipc *ipc)
 	iipc->pm_prepare_D3 = 0;
 
 	/* configure interrupt */
-	interrupt_register(PLATFORM_IPC_INTERUPT, irq_handler, NULL);
-	interrupt_enable(PLATFORM_IPC_INTERUPT);
+	interrupt_register(PLATFORM_IPC_INTERRUPT, irq_handler, NULL);
+	interrupt_enable(PLATFORM_IPC_INTERRUPT);
 
 	/* Unmask Busy and Done interrupts */
 	imrd = shim_read(SHIM_IMRD);
diff --git a/src/lib/interrupt.c b/src/lib/interrupt.c
index 4516cf3..60c0a31 100644
--- a/src/lib/interrupt.c
+++ b/src/lib/interrupt.c
@@ -106,7 +106,7 @@ uint32_t irq_enable_child(struct irq_parent *parent, int irq)
 
 	spin_lock(&parent->lock);
 
-	child =parent->child[REEF_IRQ_BIT(irq)];
+	child = parent->child[REEF_IRQ_BIT(irq)];
 
 	/* already enabled ? */
 	if (child->enabled)
@@ -133,7 +133,7 @@ uint32_t irq_disable_child(struct irq_parent *parent, int irq)
 
 	spin_lock(&parent->lock);
 
-	child =parent->child[REEF_IRQ_BIT(irq)];
+	child = parent->child[REEF_IRQ_BIT(irq)];
 
 	/* already disabled ? */
 	if (!child->enabled)
diff --git a/src/platform/apollolake/include/platform/memory.h b/src/platform/apollolake/include/platform/memory.h
index eca9a53..d84ec40 100644
--- a/src/platform/apollolake/include/platform/memory.h
+++ b/src/platform/apollolake/include/platform/memory.h
@@ -191,8 +191,8 @@
 
 #define HEAP_BUFFER_BASE		(HEAP_RUNTIME_BASE + HEAP_RUNTIME_SIZE)
 #define HEAP_BUFFER_SIZE	\
-    (L2_SRAM_SIZE - L2_VECTOR_SIZE - REEF_TEXT_SIZE - REEF_DATA_SIZE - \
-     REEF_BSS_DATA_SIZE - HEAP_RUNTIME_SIZE - REEF_STACK_SIZE - HEAP_SYSTEM_SIZE)
+	(L2_SRAM_SIZE - L2_VECTOR_SIZE - REEF_TEXT_SIZE - REEF_DATA_SIZE - \
+	REEF_BSS_DATA_SIZE - HEAP_RUNTIME_SIZE - REEF_STACK_SIZE - HEAP_SYSTEM_SIZE)
 
 #define HEAP_BUFFER_BLOCK_SIZE		0x180
 #define HEAP_BUFFER_COUNT	(HEAP_BUFFER_SIZE / HEAP_BUFFER_BLOCK_SIZE)
diff --git a/src/platform/apollolake/include/platform/platform.h b/src/platform/apollolake/include/platform/platform.h
index 4165b95..6609f33 100644
--- a/src/platform/apollolake/include/platform/platform.h
+++ b/src/platform/apollolake/include/platform/platform.h
@@ -43,7 +43,7 @@ struct reef;
 #define PLATFORM_PAGE_TABLE_SIZE	256
 
 /* IPC Interrupt */
-#define PLATFORM_IPC_INTERUPT	IRQ_EXT_IPC_LVL2(0)
+#define PLATFORM_IPC_INTERRUPT	IRQ_EXT_IPC_LVL2(0)
 
 /* pipeline IRQ */
 #define PLATFORM_SCHEDULE_IRQ	IRQ_NUM_SOFTWARE5
diff --git a/src/platform/apollolake/interrupt.c b/src/platform/apollolake/interrupt.c
index 3f799b7..86f8d84 100644
--- a/src/platform/apollolake/interrupt.c
+++ b/src/platform/apollolake/interrupt.c
@@ -42,7 +42,7 @@
 static void parent_level2_handler(void *data)
 {
 	struct irq_parent *parent = (struct irq_parent *)data;
-	struct irq_child * child = NULL;
+	struct irq_child *child = NULL;
 	uint32_t status;
 	uint32_t i = 0;
 
@@ -85,7 +85,7 @@ next:
 static void parent_level3_handler(void *data)
 {
 	struct irq_parent *parent = (struct irq_parent *)data;
-	struct irq_child * child = NULL;
+	struct irq_child *child = NULL;
 	uint32_t status;
 	uint32_t i = 0;
 
@@ -128,7 +128,7 @@ next:
 static void parent_level4_handler(void *data)
 {
 	struct irq_parent *parent = (struct irq_parent *)data;
-	struct irq_child * child = NULL;
+	struct irq_child *child = NULL;
 	uint32_t status;
 	uint32_t i = 0;
 
@@ -171,7 +171,7 @@ next:
 static void parent_level5_handler(void *data)
 {
 	struct irq_parent *parent = (struct irq_parent *)data;
-	struct irq_child * child = NULL;
+	struct irq_child *child = NULL;
 	uint32_t status;
 	uint32_t i = 0;
 
@@ -298,7 +298,6 @@ void platform_interrupt_init(void)
 	irq_write(REG_IRQ_IL4MSD(0), REG_IRQ_IL4MD_ALL);
 	irq_write(REG_IRQ_IL5MSD(0), REG_IRQ_IL5MD_ALL);
 
-	for (i = 0; i < ARRAY_SIZE(dsp_irq); i++) {
+	for (i = 0; i < ARRAY_SIZE(dsp_irq); i++)
 		spinlock_init(&dsp_irq[i].lock);
-	}
 }
diff --git a/src/platform/baytrail/include/platform/platform.h b/src/platform/baytrail/include/platform/platform.h
index 8b713df..59b940b 100644
--- a/src/platform/baytrail/include/platform/platform.h
+++ b/src/platform/baytrail/include/platform/platform.h
@@ -39,7 +39,7 @@
 struct reef;
 
 /* IPC Interrupt */
-#define PLATFORM_IPC_INTERUPT	IRQ_NUM_EXT_IA
+#define PLATFORM_IPC_INTERRUPT	IRQ_NUM_EXT_IA
 
 /* Host page size */
 #define HOST_PAGE_SIZE		4096
diff --git a/src/platform/cannonlake/include/platform/platform.h b/src/platform/cannonlake/include/platform/platform.h
index 00e0069..60b0518 100644
--- a/src/platform/cannonlake/include/platform/platform.h
+++ b/src/platform/cannonlake/include/platform/platform.h
@@ -46,7 +46,7 @@ struct reef;
 #define PLATFORM_PAGE_TABLE_SIZE	256
 
 /* IPC Interrupt */
-#define PLATFORM_IPC_INTERUPT	IRQ_EXT_IPC_LVL2(0)
+#define PLATFORM_IPC_INTERRUPT	IRQ_EXT_IPC_LVL2(0)
 
 /* pipeline IRQ */
 #define PLATFORM_SCHEDULE_IRQ	IRQ_NUM_SOFTWARE5
diff --git a/src/platform/cannonlake/interrupt.c b/src/platform/cannonlake/interrupt.c
index 3268362..381030a 100644
--- a/src/platform/cannonlake/interrupt.c
+++ b/src/platform/cannonlake/interrupt.c
@@ -42,7 +42,7 @@
 static void parent_level2_handler(void *data)
 {
 	struct irq_parent *parent = (struct irq_parent *)data;
-	struct irq_child * child = NULL;
+	struct irq_child *child = NULL;
 	uint32_t status;
 	uint32_t i = 0;
 
@@ -85,7 +85,7 @@ next:
 static void parent_level3_handler(void *data)
 {
 	struct irq_parent *parent = (struct irq_parent *)data;
-	struct irq_child * child = NULL;
+	struct irq_child *child = NULL;
 	uint32_t status;
 	uint32_t i = 0;
 
@@ -128,7 +128,7 @@ next:
 static void parent_level4_handler(void *data)
 {
 	struct irq_parent *parent = (struct irq_parent *)data;
-	struct irq_child * child = NULL;
+	struct irq_child *child = NULL;
 	uint32_t status;
 	uint32_t i = 0;
 
@@ -171,7 +171,7 @@ next:
 static void parent_level5_handler(void *data)
 {
 	struct irq_parent *parent = (struct irq_parent *)data;
-	struct irq_child * child = NULL;
+	struct irq_child *child = NULL;
 	uint32_t status;
 	uint32_t i = 0;
 
@@ -298,7 +298,6 @@ void platform_interrupt_init(void)
 	irq_write(REG_IRQ_IL4MSD(0), REG_IRQ_IL4MD_ALL);
 	irq_write(REG_IRQ_IL5MSD(0), REG_IRQ_IL5MD_ALL);
 
-	for (i = 0; i < ARRAY_SIZE(dsp_irq); i++) {
+	for (i = 0; i < ARRAY_SIZE(dsp_irq); i++)
 		spinlock_init(&dsp_irq[i].lock);
-	}
 }
diff --git a/src/platform/cannonlake/platform.c b/src/platform/cannonlake/platform.c
index 729364f..89aa2c3 100644
--- a/src/platform/cannonlake/platform.c
+++ b/src/platform/cannonlake/platform.c
@@ -178,7 +178,7 @@ static void platform_init_hw(void)
 		GENO_MDIVOSEL | GENO_DIOPTOSEL);
 
 	io_reg_write(DSP_INIT_IOPO,
-		IOPO_DMIC_FLAG |IOPO_I2S_FLAG);
+		IOPO_DMIC_FLAG | IOPO_I2S_FLAG);
 
 	io_reg_write(DSP_INIT_ALHO,
 		ALHO_ASO_FLAG | ALHO_CSO_FLAG | ALHO_CFO_FLAG);
@@ -261,7 +261,7 @@ int platform_init(struct reef *reef)
 
 	/* init SSP ports */
 	trace_point(TRACE_BOOT_PLATFORM_SSP);
-	for(i = 0; i < PLATFORM_SSP_COUNT; i++) {
+	for (i = 0; i < PLATFORM_SSP_COUNT; i++) {
 		ssp = dai_get(SOF_DAI_INTEL_SSP, i);
 		if (ssp == NULL)
 			return -ENODEV;
diff --git a/src/platform/haswell/include/platform/platform.h b/src/platform/haswell/include/platform/platform.h
index 8475e31..01a3646 100644
--- a/src/platform/haswell/include/platform/platform.h
+++ b/src/platform/haswell/include/platform/platform.h
@@ -38,7 +38,7 @@
 struct reef;
 
 /* IPC Interrupt */
-#define PLATFORM_IPC_INTERUPT	IRQ_NUM_EXT_IA
+#define PLATFORM_IPC_INTERRUPT	IRQ_NUM_EXT_IA
 
 /* Host page size */
 #define HOST_PAGE_SIZE			4096
-- 
2.14.3



More information about the Sound-open-firmware mailing list