Prechádzať zdrojové kódy

Move include and source files to logical locations

Move almost all system include files to a logical sub-directory
under ./include. The only remaining system include directories
not under ./include are specific to the platform. Move the
corresponding source files to match the include directory
structure.

Also remove pm.h as it is no longer used.

Change-Id: Ie5ea6368ec5fad459f3e8a802ad129135527f0b3
Dan Handley 10 rokov pred
rodič
commit
4ecca33988
61 zmenil súbory, kde vykonal 64 pridanie a 129 odobranie
  1. 12 6
      Makefile
  2. 3 6
      bl1/bl1.mk
  3. 2 4
      bl2/bl2.mk
  4. 5 7
      bl31/bl31.mk
  5. 0 0
      bl31/runtime_svc.c
  6. 2 4
      bl32/tsp/tsp.mk
  7. 4 2
      drivers/arm/cci400/cci400.c
  8. 0 0
      drivers/arm/gic/aarch64/gic_v3_sysregs.S
  9. 0 0
      drivers/arm/gic/gic_v2.c
  10. 0 0
      drivers/arm/gic/gic_v3.c
  11. 0 0
      drivers/arm/pl011/pl011.c
  12. 0 0
      drivers/arm/pl011/pl011_console.c
  13. 0 0
      drivers/arm/tzc400/tzc400.c
  14. 0 0
      include/bl1/bl1.h
  15. 0 0
      include/bl2/bl2.h
  16. 0 0
      include/bl31/bl31.h
  17. 0 0
      include/bl31/cm_macros.S
  18. 0 0
      include/bl31/context.h
  19. 0 0
      include/bl31/context_mgmt.h
  20. 0 0
      include/bl31/runtime_svc.h
  21. 0 0
      include/bl31/services/psci.h
  22. 0 0
      include/bl31/services/std_svc.h
  23. 0 0
      include/bl32/bl32.h
  24. 0 0
      include/bl32/payloads/tsp.h
  25. 0 0
      include/common/asm_macros.S
  26. 13 10
      include/common/bl_common.h
  27. 0 0
      include/common/debug.h
  28. 0 0
      include/common/firmware_image_package.h
  29. 0 0
      include/drivers/arm/cci400.h
  30. 0 0
      include/drivers/arm/gic.h
  31. 0 0
      include/drivers/arm/gic_v2.h
  32. 0 0
      include/drivers/arm/gic_v3.h
  33. 0 0
      include/drivers/arm/pl011.h
  34. 0 0
      include/drivers/arm/tzc400.h
  35. 0 0
      include/drivers/console.h
  36. 0 0
      include/drivers/fvp_pwrc.h
  37. 0 0
      include/drivers/io_driver.h
  38. 0 0
      include/drivers/io_fip.h
  39. 0 0
      include/drivers/io_memmap.h
  40. 0 0
      include/drivers/io_semihosting.h
  41. 0 0
      include/lib/aarch64/arch.h
  42. 0 0
      include/lib/aarch64/arch_helpers.h
  43. 0 0
      include/lib/aarch64/xlat_tables.h
  44. 4 4
      include/lib/bakery_lock.h
  45. 0 0
      include/lib/io_storage.h
  46. 0 0
      include/lib/mmio.h
  47. 0 0
      include/lib/semihosting.h
  48. 0 0
      include/lib/spinlock.h
  49. 0 66
      include/pm.h
  50. 0 0
      lib/aarch64/cache_helpers.S
  51. 0 0
      lib/aarch64/cpu_helpers.S
  52. 0 0
      lib/aarch64/misc_helpers.S
  53. 0 0
      lib/aarch64/sysreg_helpers.S
  54. 0 0
      lib/aarch64/tlb_helpers.S
  55. 0 0
      lib/aarch64/xlat_helpers.c
  56. 0 0
      lib/aarch64/xlat_tables.c
  57. 3 3
      lib/locks/bakery/bakery_lock.c
  58. 0 0
      lib/locks/exclusive/spinlock.S
  59. 14 15
      plat/fvp/platform.mk
  60. 1 1
      services/spd/tspd/tspd.mk
  61. 1 1
      tools/fip_create/firmware_image_package.h

+ 12 - 6
Makefile

@@ -132,14 +132,20 @@ endif
 .SUFFIXES:
 
 
-INCLUDES		+=	-Ilib/include/			\
-				-Idrivers/io			\
-				-Iinclude/${ARCH}/		\
-				-Iinclude/			\
-				-Iarch/system/gic		\
-				-Iservices/std_svc/psci		\
+INCLUDES		+=	-Iinclude/bl1			\
+				-Iinclude/bl2			\
+				-Iinclude/bl31			\
+				-Iinclude/bl31/services		\
+				-Iinclude/bl32			\
+				-Iinclude/bl32/payloads		\
+				-Iinclude/common		\
+				-Iinclude/drivers		\
+				-Iinclude/drivers/arm		\
+				-Iinclude/lib			\
+				-Iinclude/lib/aarch64		\
 				-Iinclude/stdlib		\
 				-Iinclude/stdlib/sys		\
+				-Iservices/std_svc/psci		\
 				-Iplat/${PLAT}			\
 				${PLAT_INCLUDES}		\
 				${SPD_INCLUDES}

+ 3 - 6
bl1/bl1.mk

@@ -32,15 +32,12 @@ vpath			%.c	plat/${PLAT}		\
 				plat/${PLAT}/${ARCH}	\
 				common			\
 				lib			\
-				arch/${ARCH}		\
-				lib/arch/${ARCH}	\
+				lib/${ARCH}		\
 				${PLAT_BL1_C_VPATH}
 
-vpath			%.S	arch/${ARCH}/cpu	\
-				plat/common/${ARCH}	\
+vpath			%.S	plat/common/${ARCH}	\
 				plat/${PLAT}/${ARCH}	\
-				include			\
-				lib/arch/${ARCH}	\
+				lib/${ARCH}		\
 				${PLAT_BL1_S_VPATH}
 
 BL1_SOURCES		+=	bl1_arch_setup.c	\

+ 2 - 4
bl2/bl2.mk

@@ -32,12 +32,10 @@ vpath			%.c	common				\
 				lib				\
 				plat/${PLAT}			\
 				plat/${PLAT}/${ARCH}		\
-				arch/${ARCH}			\
 				${PLAT_BL2_C_VPATH}
 
-vpath			%.S	lib/arch/${ARCH}		\
-				include				\
-				lib/sync/locks/exclusive	\
+vpath			%.S	lib/${ARCH}			\
+				lib/locks/exclusive		\
 				common/${ARCH}			\
 				${PLAT_BL2_S_VPATH}
 

+ 5 - 7
bl31/bl31.mk

@@ -30,23 +30,21 @@
 
 vpath			%.c	common					\
 				lib					\
-				arch/system/gic				\
+				drivers/arm/gic				\
 				plat/${PLAT}				\
-				arch/${ARCH}				\
 				services/std_svc			\
 				services/std_svc/psci			\
-				lib/sync/locks/bakery			\
+				lib/locks/bakery			\
 				plat/${PLAT}/${ARCH}			\
 				${PLAT_BL31_C_VPATH}
 
-vpath			%.S	lib/arch/${ARCH}			\
+vpath			%.S	lib/${ARCH}				\
 				services/std_svc			\
 				services/std_svc/psci			\
-				include					\
 				plat/${PLAT}/${ARCH}			\
-				lib/sync/locks/exclusive		\
+				lib/locks/exclusive			\
 				plat/common/${ARCH}			\
-				arch/system/gic/${ARCH}			\
+				drivers/arm/gic/${ARCH}			\
 				common/${ARCH}				\
 				${PLAT_BL31_S_VPATH}
 

+ 0 - 0
common/runtime_svc.c → bl31/runtime_svc.c


+ 2 - 4
bl32/tsp/tsp.mk

@@ -32,11 +32,9 @@ vpath			%.c	common				\
 				lib				\
 				plat/${PLAT}			\
 				plat/${PLAT}/${ARCH}		\
-				arch/${ARCH}
 
-vpath			%.S	lib/arch/${ARCH}		\
-				include				\
-				lib/sync/locks/exclusive	\
+vpath			%.S	lib/${ARCH}			\
+				lib/locks/exclusive		\
 				common/${ARCH}
 
 BL32_SOURCES		+=	tsp_entrypoint.S		\

+ 4 - 2
drivers/arm/interconnect/cci-400/cci400.c → drivers/arm/cci400/cci400.c

@@ -44,7 +44,8 @@ void cci_enable_coherency(unsigned long mpidr)
 		      DVM_EN_BIT | SNOOP_EN_BIT);
 
 	/* Wait for the dust to settle down */
-	while (mmio_read_32(CCI400_BASE + STATUS_REG) & CHANGE_PENDING_BIT);
+	while (mmio_read_32(CCI400_BASE + STATUS_REG) & CHANGE_PENDING_BIT)
+		;
 }
 
 void cci_disable_coherency(unsigned long mpidr)
@@ -54,6 +55,7 @@ void cci_disable_coherency(unsigned long mpidr)
 		      ~(DVM_EN_BIT | SNOOP_EN_BIT));
 
 	/* Wait for the dust to settle down */
-	while (mmio_read_32(CCI400_BASE + STATUS_REG) & CHANGE_PENDING_BIT);
+	while (mmio_read_32(CCI400_BASE + STATUS_REG) & CHANGE_PENDING_BIT)
+		;
 }
 

+ 0 - 0
arch/system/gic/aarch64/gic_v3_sysregs.S → drivers/arm/gic/aarch64/gic_v3_sysregs.S


+ 0 - 0
arch/system/gic/gic_v2.c → drivers/arm/gic/gic_v2.c


+ 0 - 0
arch/system/gic/gic_v3.c → drivers/arm/gic/gic_v3.c


+ 0 - 0
drivers/arm/peripherals/pl011/pl011.c → drivers/arm/pl011/pl011.c


+ 0 - 0
drivers/arm/peripherals/pl011/pl011_console.c → drivers/arm/pl011/pl011_console.c


+ 0 - 0
drivers/arm/interconnect/tzc-400/tzc400.c → drivers/arm/tzc400/tzc400.c


+ 0 - 0
include/bl1.h → include/bl1/bl1.h


+ 0 - 0
include/bl2.h → include/bl2/bl2.h


+ 0 - 0
include/bl31.h → include/bl31/bl31.h


+ 0 - 0
include/cm_macros.S → include/bl31/cm_macros.S


+ 0 - 0
include/context.h → include/bl31/context.h


+ 0 - 0
include/context_mgmt.h → include/bl31/context_mgmt.h


+ 0 - 0
include/runtime_svc.h → include/bl31/runtime_svc.h


+ 0 - 0
include/psci.h → include/bl31/services/psci.h


+ 0 - 0
include/std_svc.h → include/bl31/services/std_svc.h


+ 0 - 0
include/bl32.h → include/bl32/bl32.h


+ 0 - 0
include/tsp.h → include/bl32/payloads/tsp.h


+ 0 - 0
include/asm_macros.S → include/common/asm_macros.S


+ 13 - 10
include/bl_common.h → include/common/bl_common.h

@@ -127,19 +127,22 @@ extern void __dead2 raise_el(aapcs64_params *);
 extern void __dead2 change_el(el_change_info *);
 extern unsigned long make_spsr(unsigned long, unsigned long, unsigned long);
 extern void init_bl2_mem_layout(meminfo *,
-			        meminfo *,
-			        unsigned int,
-			        unsigned long) __attribute__((weak));
+				meminfo *,
+				unsigned int,
+				unsigned long) __attribute__((weak));
 extern void init_bl31_mem_layout(const meminfo *,
-				 meminfo *,
-				 unsigned int) __attribute__((weak));
+				meminfo *,
+				unsigned int) __attribute__((weak));
 extern unsigned long image_size(const char *);
-extern unsigned long load_image(meminfo *, const char *, unsigned int, unsigned long);
+extern unsigned long load_image(meminfo *,
+				const char *,
+				unsigned int,
+				unsigned long);
 extern void __dead2 run_image(unsigned long entrypoint,
-			      unsigned long spsr,
-			      unsigned long security_state,
-			      void *first_arg,
-			      void *second_arg);
+				unsigned long spsr,
+				unsigned long security_state,
+				void *first_arg,
+				void *second_arg);
 extern unsigned long *get_el_change_mem_ptr(void);
 extern const char build_message[];
 

+ 0 - 0
include/debug.h → include/common/debug.h


+ 0 - 0
include/firmware_image_package.h → include/common/firmware_image_package.h


+ 0 - 0
drivers/arm/interconnect/cci-400/cci400.h → include/drivers/arm/cci400.h


+ 0 - 0
arch/system/gic/gic.h → include/drivers/arm/gic.h


+ 0 - 0
arch/system/gic/gic_v2.h → include/drivers/arm/gic_v2.h


+ 0 - 0
arch/system/gic/gic_v3.h → include/drivers/arm/gic_v3.h


+ 0 - 0
drivers/arm/peripherals/pl011/pl011.h → include/drivers/arm/pl011.h


+ 0 - 0
drivers/arm/interconnect/tzc-400/tzc400.h → include/drivers/arm/tzc400.h


+ 0 - 0
drivers/console/console.h → include/drivers/console.h


+ 0 - 0
drivers/power/fvp_pwrc.h → include/drivers/fvp_pwrc.h


+ 0 - 0
drivers/io/io_driver.h → include/drivers/io_driver.h


+ 0 - 0
drivers/io/io_fip.h → include/drivers/io_fip.h


+ 0 - 0
drivers/io/io_memmap.h → include/drivers/io_memmap.h


+ 0 - 0
drivers/io/io_semihosting.h → include/drivers/io_semihosting.h


+ 0 - 0
include/aarch64/arch.h → include/lib/aarch64/arch.h


+ 0 - 0
include/aarch64/arch_helpers.h → include/lib/aarch64/arch_helpers.h


+ 0 - 0
include/aarch64/xlat_tables.h → include/lib/aarch64/xlat_tables.h


+ 4 - 4
include/bakery_lock.h → include/lib/bakery_lock.h

@@ -44,10 +44,10 @@ typedef struct {
 
 #define NO_OWNER (-1)
 
-void bakery_lock_init(bakery_lock* bakery);
-void bakery_lock_get(unsigned long mpidr, bakery_lock* bakery);
-void bakery_lock_release(unsigned long mpidr, bakery_lock* bakery);
-int bakery_lock_try(unsigned long mpidr, bakery_lock* bakery);
+void bakery_lock_init(bakery_lock *bakery);
+void bakery_lock_get(unsigned long mpidr, bakery_lock *bakery);
+void bakery_lock_release(unsigned long mpidr, bakery_lock *bakery);
+int bakery_lock_try(unsigned long mpidr, bakery_lock *bakery);
 #endif /*__ASSEMBLY__*/
 
 #endif /* __BAKERY_LOCK_H__ */

+ 0 - 0
include/io_storage.h → include/lib/io_storage.h


+ 0 - 0
include/mmio.h → include/lib/mmio.h


+ 0 - 0
include/semihosting.h → include/lib/semihosting.h


+ 0 - 0
include/spinlock.h → include/lib/spinlock.h


+ 0 - 66
include/pm.h

@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2013-2014, ARM Limited and Contributors. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * Neither the name of ARM nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef __PM_H__
-#define __PM_H__
-
-#ifndef __ASSEMBLY__
-
-/*******************************************************************************
- * Structure populated by platform specific code to export routines which
- * perform common low level pm functions
- ******************************************************************************/
-typedef struct {
-	int (*cpu_on)(unsigned long);
-	int (*cpu_off)(unsigned long);
-	int (*cpu_suspend)(unsigned long);
-	int (*affinity_info)(unsigned long, unsigned int);
-} pm_frontend_ops;
-
-/*******************************************************************************
- * Structure populated by a generic power management api implementation e.g.
- * psci to perform api specific bits after a cpu has been turned on.
- ******************************************************************************/
-typedef struct {
-	unsigned long (*cpu_off_finisher)(unsigned long);
-	unsigned long (*cpu_suspend_finisher)(unsigned long);
-} pm_backend_ops;
-
-/*******************************************************************************
- * Function & variable prototypes
- ******************************************************************************/
-extern pm_frontend_ops *get_pm_frontend_ops(void);
-extern pm_backend_ops *get_pm_backend_ops(void);
-extern void set_pm_frontend_ops(pm_frontend_ops *);
-extern void set_pm_backend_ops(pm_backend_ops *);
-
-#endif /*__ASSEMBLY__*/
-
-#endif /* __PM_H__ */

+ 0 - 0
lib/arch/aarch64/cache_helpers.S → lib/aarch64/cache_helpers.S


+ 0 - 0
arch/aarch64/cpu/cpu_helpers.S → lib/aarch64/cpu_helpers.S


+ 0 - 0
lib/arch/aarch64/misc_helpers.S → lib/aarch64/misc_helpers.S


+ 0 - 0
lib/arch/aarch64/sysreg_helpers.S → lib/aarch64/sysreg_helpers.S


+ 0 - 0
lib/arch/aarch64/tlb_helpers.S → lib/aarch64/tlb_helpers.S


+ 0 - 0
lib/arch/aarch64/xlat_helpers.c → lib/aarch64/xlat_helpers.c


+ 0 - 0
lib/arch/aarch64/xlat_tables.c → lib/aarch64/xlat_tables.c


+ 3 - 3
lib/sync/locks/bakery/bakery_lock.c → lib/locks/bakery/bakery_lock.c

@@ -59,14 +59,14 @@
 #define assert_bakery_entry_valid(entry, bakery) do {	\
 	assert(bakery);					\
 	assert(entry < BAKERY_LOCK_MAX_CPUS);		\
-} while(0)
+} while (0)
 
 /* Convert a ticket to priority */
 #define PRIORITY(t, pos)	(((t) << 8) | (pos))
 
 
 /* Initialize Bakery Lock to reset ownership and all ticket values */
-void bakery_lock_init(bakery_lock * bakery)
+void bakery_lock_init(bakery_lock *bakery)
 {
 	assert(bakery);
 
@@ -176,7 +176,7 @@ void bakery_lock_get(unsigned long mpidr, bakery_lock *bakery)
 
 
 /* Release the lock and signal contenders */
-void bakery_lock_release(unsigned long mpidr, bakery_lock * bakery)
+void bakery_lock_release(unsigned long mpidr, bakery_lock *bakery)
 {
 	unsigned int me = platform_get_core_pos(mpidr);
 

+ 0 - 0
lib/sync/locks/exclusive/spinlock.S → lib/locks/exclusive/spinlock.S


+ 14 - 15
plat/fvp/platform.mk

@@ -28,34 +28,33 @@
 # POSSIBILITY OF SUCH DAMAGE.
 #
 
-PLAT_INCLUDES		:=	-Idrivers/arm/interconnect/cci-400	\
-				-Idrivers/arm/interconnect/tzc-400	\
-				-Idrivers/console			\
-				-Idrivers/arm/peripherals/pl011		\
-				-Idrivers/power
+#
+# No additional platform system include directories required
+#
+# PLAT_INCLUDES		:=
 
-PLAT_BL1_C_VPATH	:=	drivers/arm/interconnect/cci-400	\
-				drivers/arm/peripherals/pl011		\
-				lib/arch/${ARCH}			\
+PLAT_BL1_C_VPATH	:=	drivers/arm/cci400			\
+				drivers/arm/pl011			\
+				lib/${ARCH}				\
 				lib/semihosting				\
 				lib/stdlib				\
 				drivers/io
 
 PLAT_BL1_S_VPATH	:=	lib/semihosting/${ARCH}
 
-PLAT_BL2_C_VPATH	:=	drivers/arm/interconnect/cci-400	\
-				drivers/arm/interconnect/tzc-400	\
-				drivers/arm/peripherals/pl011		\
-				lib/arch/${ARCH}			\
+PLAT_BL2_C_VPATH	:=	drivers/arm/cci400			\
+				drivers/arm/pl011			\
+				drivers/arm/tzc400			\
+				lib/${ARCH}				\
 				lib/stdlib				\
 				lib/semihosting				\
 				drivers/io
 
 PLAT_BL2_S_VPATH	:=	lib/semihosting/${ARCH}
 
-PLAT_BL31_C_VPATH	:=	drivers/arm/interconnect/cci-400	\
-				drivers/arm/peripherals/pl011		\
-				lib/arch/${ARCH}			\
+PLAT_BL31_C_VPATH	:=	drivers/arm/cci-400			\
+				drivers/arm/pl011			\
+				lib/${ARCH}				\
 				lib/semihosting				\
 				lib/stdlib				\
 				drivers/power				\

+ 1 - 1
services/spd/tspd/tspd.mk

@@ -29,7 +29,7 @@
 #
 
 TSPD_DIR		:=	services/spd/tspd
-SPD_INCLUDES		:=	-Iinclude/spd/tspd	\
+SPD_INCLUDES		:=	-Iinclude/bl32/payloads	\
 				-I${TSPD_DIR}
 
 SPD_SOURCES		:=	tspd_common.c		\

+ 1 - 1
tools/fip_create/firmware_image_package.h

@@ -1 +1 @@
-../../include/firmware_image_package.h
+../../include/common/firmware_image_package.h