All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/3] armv8: fsl-layerscape: SPL size reduction
@ 2017-08-29  7:01 Sumit Garg
  2017-08-29  7:01 ` [U-Boot] [PATCH 2/3] armv8: ls1088a: " Sumit Garg
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Sumit Garg @ 2017-08-29  7:01 UTC (permalink / raw)
  To: u-boot

Using changes in this patch we were able to reduce approx 4k
size of u-boot-spl.bin image. Following is breif description of
changes to reduce SPL size:
1. Compile-off mp.c and libfdt.c in case of SPL build.
2. Keep MMU and DCACHE specific variable and functions under
   CONFIG_SYS_DCACHE_OFF macro.
3. Compile-off IFC specific funtion call "init_early_memctl_regs"
   in case of SPL build.

Signed-off-by: Sumit Garg <sumit.garg@nxp.com>
---

Dependent on ls1088 base SD boot target. Also dependent on ls1088
QPSI secure boot target.

 arch/arm/cpu/armv8/fsl-layerscape/Makefile | 2 ++
 arch/arm/cpu/armv8/fsl-layerscape/cpu.c    | 6 ++++++
 arch/arm/cpu/armv8/fsl-layerscape/soc.c    | 2 ++
 3 files changed, 10 insertions(+)

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/Makefile b/arch/arm/cpu/armv8/fsl-layerscape/Makefile
index 115c3fc..0cb6d4e 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/Makefile
+++ b/arch/arm/cpu/armv8/fsl-layerscape/Makefile
@@ -7,8 +7,10 @@
 obj-y += cpu.o
 obj-y += lowlevel.o
 obj-y += soc.o
+ifndef CONFIG_SPL_BUILD
 obj-$(CONFIG_MP) += mp.o
 obj-$(CONFIG_OF_LIBFDT) += fdt.o
+endif
 obj-$(CONFIG_SPL) += spl.o
 obj-$(CONFIG_$(SPL_)FSL_LS_PPA) += ppa.o
 
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
index 3c9a5ed..3ce51af 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
@@ -32,7 +32,9 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#ifndef CONFIG_SYS_DCACHE_OFF
 struct mm_region *mem_map = early_map;
+#endif
 
 void cpu_name(char *name)
 {
@@ -824,6 +826,7 @@ void efi_add_known_memory(void)
 }
 #endif
 
+#ifndef CONFIG_SYS_DCACHE_OFF
 /*
  * Before DDR size is known, early MMU table have DDR mapped as device memory
  * to avoid speculative access. To relocate U-Boot to DDR, "normal memory"
@@ -888,14 +891,17 @@ void update_early_mmu_table(void)
 		}
 	}
 }
+#endif
 
 __weak int dram_init(void)
 {
 	fsl_initdram();
+#ifndef CONFIG_SYS_DCACHE_OFF
 #if !defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD)
 	/* This will break-before-make MMU for DDR */
 	update_early_mmu_table();
 #endif
+#endif
 
 	return 0;
 }
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/soc.c b/arch/arm/cpu/armv8/fsl-layerscape/soc.c
index 2075c96..7c26953 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/soc.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/soc.c
@@ -329,7 +329,9 @@ void bypass_smmu(void)
 void fsl_lsch3_early_init_f(void)
 {
 	erratum_rcw_src();
+#ifndef CONFIG_SPL_BUILD
 	init_early_memctl_regs();	/* tighten IFC timing */
+#endif
 #ifdef CONFIG_SYS_FSL_ERRATUM_A009203
 	erratum_a009203();
 #endif
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2018-01-05 16:24 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-29  7:01 [U-Boot] [PATCH 1/3] armv8: fsl-layerscape: SPL size reduction Sumit Garg
2017-08-29  7:01 ` [U-Boot] [PATCH 2/3] armv8: ls1088a: " Sumit Garg
2017-08-29 15:55   ` [U-Boot] [u-boot-release] " York Sun
2017-08-29 17:36     ` Sumit Garg
2017-08-29 17:49       ` York Sun
2017-08-30  8:53         ` Sumit Garg
2018-01-05 15:56           ` York Sun
2018-01-05 16:07             ` Sumit Garg
2018-01-05 16:09               ` York Sun
2018-01-05 16:22                 ` Sumit Garg
2018-01-05 16:24                   ` York Sun
2017-08-29  7:01 ` [U-Boot] [PATCH 3/3] ls1088ardb: Add SD Secure boot target support Sumit Garg
2017-09-14 20:38 ` [U-Boot] [PATCH 1/3] armv8: fsl-layerscape: SPL size reduction York Sun
2017-10-03 10:51   ` Sumit Garg
2017-10-04 18:41     ` York Sun
2017-10-05  7:55       ` Sumit Garg
2017-11-29 18:36         ` York Sun
2017-11-30 15:55           ` Sumit Garg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.