program_evm: added ability to parse config file if diverging from default
authorIvan Pang <i-pang@ti.com>
Thu, 2 Jun 2016 23:06:26 +0000 (18:06 -0500)
committerIvan Pang <i-pang@ti.com>
Thu, 2 Jun 2016 23:06:26 +0000 (18:06 -0500)
Signed-off-by: Ivan Pang <i-pang@ti.com>
program_evm/program_evm.js
program_evm/program_evm_config [new file with mode: 0644]

index a128fee2d7482e88640324ade27e4a4cd6ebfcdf..479064edacc294e51ba3364a121e8e3687a1f86a 100644 (file)
@@ -231,6 +231,23 @@ var eeprom51 = board_binaries + "eeprom51.bin";
 var nand = board_binaries + "nand.bin";
 var nor = board_binaries + "nor.bin";
 
 var nand = board_binaries + "nand.bin";
 var nor = board_binaries + "nor.bin";
 
+var custom_config = script_configs+targetFlag+"/program_evm_config";
+if (isFile(custom_config))
+{
+       file = new java.io.BufferedReader(new java.io.FileReader(custom_config))
+       while((line = file.readLine()) != null) {
+               params = line.split("\\s+");
+               if (params[1] == undefined) continue;
+               if ("board_binaries" == params[0]) board_binaries = params[1];
+               else if ("norwriterbinary" == params[0]) norwriterbinary = board_binaries + params[1];
+               else if ("nandwriterbinary" == params[0]) nandwriterbinary = board_binaries + params[1];
+               else if ("i2cwriterbinary" == params[0]) i2cwriterbinary = board_binaries + params[1];
+               else if ("nand" == params[0]) nand = board_binaries + params[1];
+               else if ("nor" == params[0]) nor = board_binaries + params[1];
+       }
+       file.close();
+}
+
 // Note: nAddress is the load address for using eepromwriter.
 //       nandNorAddress is the address used for nandwriter and norwriter.
 switch (targetFlag)
 // Note: nAddress is the load address for using eepromwriter.
 //       nandNorAddress is the address used for nandwriter and norwriter.
 switch (targetFlag)
diff --git a/program_evm/program_evm_config b/program_evm/program_evm_config
new file mode 100644 (file)
index 0000000..8d0b90c
--- /dev/null
@@ -0,0 +1,2 @@
+norwriterbinary spi_flash_writer.out
+nor MLO
\ No newline at end of file