fix: ddr4: always build main DDR libraries for DDR4

General:
DDR4 (only) include 2 DDR libraries:
1. ddr[3/4]_training_a38x.lib	: a38x: built by default with each compilation
                                  a39x: using pre-built ddr library.
2. ddr4_training_a38xsub.lib	: pre-compiled and supplied in the release,
				  linked in each compilation

Issue: the 1st library should be compiled for both DDR3 & DDR4.
DDR4 compilation failed since the the 1st library was compiled only for DDR3.

Fix:
1. set the 1st library to be compiled by default, also for DDR4 with A38x.
(A39x is still using pre-built libraries for both)
2. Updates 2nd lib file (DDR4 A38x sub-lib), which is required for each new build of library 1.

Change-Id: Ied3c94954482a8c8c3cce603160b1a8ac3fedb79
Signed-off-by: Omri Itach <omrii@marvell.com>
Reviewed-on: http://vgitil04.il.marvell.com:8080/24519
diff --git a/build.pl b/build.pl
index 01f97bd..0c64c3f 100755
--- a/build.pl
+++ b/build.pl
@@ -21,7 +21,6 @@
 	print "\t-o\tOutput dir/file. The image will be copied into this dir/file\n";
 	print "\t-e\tBig Endian. If not specified Little endian is used\n";
  	print "\t-m\tDDR type(default: DDR4 for A39x, DDR3 for the rest). Accepts: 3 for DDR3, 4 for DDR4\n";
-+	print "\t-d\tRebuild training lib, use '-d 2' to rebuild ddr3libv2 source\n";
 	print "\t-i\tSupported interfaces, seperated by \":\" -  Accepts [spi:nor:nand]\n";
 	print "\t-v\tSW version (in file name: u-boot-alp-X.X.X-spi.bin, else using date by default)\n";
 	print "\t\tinterfaces. Supports spi, nor, nand. the boot \n";
@@ -358,7 +357,7 @@
 }
 
 #by default -d 2 will be enabled for new TIP SoCs
-if( ($ddr3LibBuild eq "yes") and !($opt_m eq 4))
+if(($ddr3LibBuild eq "yes") && !((substr $board,7 , 3) eq "39x"))
 {
 	$opt_d = 2;
 }
diff --git a/tools/marvell/bin_hdr/src_ddr/lib/ddr4_training_a38xsub.lib b/tools/marvell/bin_hdr/src_ddr/lib/ddr4_training_a38xsub.lib
index e02c087..3e86ab7 100644
--- a/tools/marvell/bin_hdr/src_ddr/lib/ddr4_training_a38xsub.lib
+++ b/tools/marvell/bin_hdr/src_ddr/lib/ddr4_training_a38xsub.lib
Binary files differ