@@ -151,11 +151,8 @@ int SPIFBlockDevice::init()
151
151
tr_error (" ERROR: init - Unable to initialize flash memory, tests failed\n " );
152
152
status = SPIF_BD_ERROR_DEVICE_ERROR;
153
153
goto exit_point;
154
- } else {
155
- tr_info (" INFO: Initialize flash memory OK\n " );
156
154
}
157
155
158
-
159
156
/* Read Manufacturer ID (1byte), and Device ID (2bytes)*/
160
157
spi_status = _spi_send_general_command (SPIF_RDID, SPI_NO_ADDRESS_COMMAND, NULL , 0 , (char *)vendor_device_ids,
161
158
data_length);
@@ -202,8 +199,6 @@ int SPIFBlockDevice::init()
202
199
_region_high_boundary[0 ] = _device_size_bytes - 1 ;
203
200
204
201
if ((sector_map_table_addr != 0 ) && (0 != sector_map_table_size)) {
205
- tr_info (" INFO: init - Parsing Sector Map Table - addr: 0x%lxh, Size: %d" , sector_map_table_addr,
206
- sector_map_table_size);
207
202
if (0 != _sfdp_parse_sector_map_table (sector_map_table_addr, sector_map_table_size)) {
208
203
tr_error (" ERROR: init - Parse Sector Map Table Failed" );
209
204
status = SPIF_BD_ERROR_PARSING_FAILED;
@@ -260,7 +255,6 @@ int SPIFBlockDevice::read(void *buffer, bd_addr_t addr, bd_size_t size)
260
255
}
261
256
262
257
int status = SPIF_BD_ERROR_OK;
263
- tr_info (" INFO Read - Inst: 0x%xh" , _read_instruction);
264
258
_mutex->lock ();
265
259
266
260
// Set Dummy Cycles for Specific Read Command Mode
@@ -286,8 +280,6 @@ int SPIFBlockDevice::program(const void *buffer, bd_addr_t addr, bd_size_t size)
286
280
uint32_t offset = 0 ;
287
281
uint32_t chunk = 0 ;
288
282
289
- tr_debug (" DEBUG: program - Buff: 0x%lxh, addr: %llu, size: %llu" , (uint32_t )buffer, addr, size);
290
-
291
283
while (size > 0 ) {
292
284
293
285
// Write on _page_size_bytes boundaries (Default 256 bytes a page)
@@ -345,8 +337,6 @@ int SPIFBlockDevice::erase(bd_addr_t addr, bd_size_t in_size)
345
337
// Erase Types of selected region
346
338
uint8_t bitfield = _region_erase_types_bitfield[region];
347
339
348
- tr_info (" DEBUG: erase - addr: %llu, in_size: %llu" , addr, in_size);
349
-
350
340
if ((addr + in_size) > _device_size_bytes) {
351
341
tr_error (" ERROR: erase exceeds flash device size" );
352
342
return SPIF_BD_ERROR_INVALID_ERASE_PARAMS;
@@ -367,11 +357,6 @@ int SPIFBlockDevice::erase(bd_addr_t addr, bd_size_t in_size)
367
357
offset = addr % _erase_type_size_arr[type];
368
358
chunk = ((offset + size) < _erase_type_size_arr[type]) ? size : (_erase_type_size_arr[type] - offset);
369
359
370
- tr_debug (" DEBUG: erase - addr: %llu, size:%d, Inst: 0x%xh, chunk: %lu , " ,
371
- addr, size, cur_erase_inst, chunk);
372
- tr_debug (" DEBUG: erase - Region: %d, Type:%d" ,
373
- region, type);
374
-
375
360
_mutex->lock ();
376
361
377
362
if (_set_write_enable () != 0 ) {
@@ -555,7 +540,6 @@ spif_bd_error SPIFBlockDevice::_spi_send_program_command(int prog_inst, const vo
555
540
556
541
spif_bd_error SPIFBlockDevice::_spi_send_erase_command (int erase_inst, bd_addr_t addr, bd_size_t size)
557
542
{
558
- tr_info (" INFO: Erase Inst: 0x%xh, addr: %llu, size: %llu" , erase_inst, addr, size);
559
543
addr = (((int )addr) & 0x00FFF000 );
560
544
_spi_send_general_command (erase_inst, addr, NULL , 0 , NULL , 0 );
561
545
return SPIF_BD_ERROR_OK;
@@ -727,14 +711,10 @@ int SPIFBlockDevice::_sfdp_parse_sfdp_headers(uint32_t &basic_table_addr, size_t
727
711
if (!(memcmp (&sfdp_header[0 ], " SFDP" , 4 ) == 0 && sfdp_header[5 ] == 1 )) {
728
712
tr_error (" ERROR: init - _verify SFDP signature and version Failed" );
729
713
return -1 ;
730
- } else {
731
- tr_info (" INFO: init - verified SFDP Signature and version Successfully" );
732
714
}
733
715
734
716
// Discover Number of Parameter Headers
735
717
int number_of_param_headers = (int )(sfdp_header[6 ]) + 1 ;
736
- tr_debug (" DEBUG: number of Param Headers: %d" , number_of_param_headers);
737
-
738
718
739
719
addr += SPIF_SFDP_HEADER_SIZE;
740
720
data_length = SPIF_PARAM_HEADER_SIZE;
@@ -757,14 +737,12 @@ int SPIFBlockDevice::_sfdp_parse_sfdp_headers(uint32_t &basic_table_addr, size_t
757
737
758
738
if ((param_header[0 ] == 0 ) && (param_header[7 ] == 0xFF )) {
759
739
// Found Basic Params Table: LSB=0x00, MSB=0xFF
760
- tr_debug (" DEBUG: Found Basic Param Table at Table: %d" , i_ind + 1 );
761
740
basic_table_addr = ((param_header[6 ] << 16 ) | (param_header[5 ] << 8 ) | (param_header[4 ]));
762
741
// Supporting up to 64 Bytes Table (16 DWORDS)
763
742
basic_table_size = ((param_header[3 ] * 4 ) < SFDP_DEFAULT_BASIC_PARAMS_TABLE_SIZE_BYTES) ? (param_header[3 ] * 4 ) : 64 ;
764
743
765
744
} else if ((param_header[0 ] == 81 ) && (param_header[7 ] == 0xFF )) {
766
745
// Found Sector Map Table: LSB=0x81, MSB=0xFF
767
- tr_debug (" DEBUG: Found Sector Map Table at Table: %d" , i_ind + 1 );
768
746
sector_map_table_addr = ((param_header[6 ] << 16 ) | (param_header[5 ] << 8 ) | (param_header[4 ]));
769
747
sector_map_table_size = param_header[3 ] * 4 ;
770
748
@@ -783,9 +761,6 @@ unsigned int SPIFBlockDevice::_sfdp_detect_page_size(uint8_t *basic_param_table_
783
761
// Page Size is specified by 4 Bits (N), calculated by 2^N
784
762
int page_to_power_size = ((int )basic_param_table_ptr[SPIF_BASIC_PARAM_TABLE_PAGE_SIZE_BYTE]) >> 4 ;
785
763
page_size = local_math_power (2 , page_to_power_size);
786
- tr_debug (" DEBUG: Detected Page Size: %d" , page_size);
787
- } else {
788
- tr_debug (" DEBUG: Using Default Page Size: %d" , page_size);
789
764
}
790
765
return page_size;
791
766
}
@@ -807,8 +782,6 @@ int SPIFBlockDevice::_sfdp_detect_erase_types_inst_and_size(uint8_t *basic_param
807
782
erase_type_inst_arr[i_ind] = 0xff ; // 0xFF default for unsupported type
808
783
erase_type_size_arr[i_ind] = local_math_power (2 ,
809
784
basic_param_table_ptr[SPIF_BASIC_PARAM_ERASE_TYPE_1_SIZE_BYTE + 2 * i_ind]); // Size given as 2^N
810
- tr_info (" DEBUG: Erase Type(A) %d - Inst: 0x%xh, Size: %d" , (i_ind + 1 ), erase_type_inst_arr[i_ind],
811
- erase_type_size_arr[i_ind]);
812
785
if (erase_type_size_arr[i_ind] > 1 ) {
813
786
// if size==1 type is not supported
814
787
erase_type_inst_arr[i_ind] = basic_param_table_ptr[SPIF_BASIC_PARAM_ERASE_TYPE_1_BYTE + 2 * i_ind];
@@ -831,8 +804,6 @@ int SPIFBlockDevice::_sfdp_detect_erase_types_inst_and_size(uint8_t *basic_param
831
804
_region_erase_types_bitfield[0 ] |= bitfield; // If there's no region map, set region "0" types bitfield as defualt;
832
805
}
833
806
834
- tr_info (" INFO: Erase Type %d - Inst: 0x%xh, Size: %d" , (i_ind + 1 ), erase_type_inst_arr[i_ind],
835
- erase_type_size_arr[i_ind]);
836
807
bitfield = bitfield << 1 ;
837
808
}
838
809
}
@@ -859,7 +830,6 @@ int SPIFBlockDevice::_sfdp_detect_best_bus_read_mode(uint8_t *basic_param_table_
859
830
read_inst = basic_param_table_ptr[SPIF_BASIC_PARAM_TABLE_222_READ_INST_BYTE];
860
831
_read_dummy_and_mode_cycles = (basic_param_table_ptr[SPIF_BASIC_PARAM_TABLE_222_READ_INST_BYTE - 1] >> 5)
861
832
+ (basic_param_table_ptr[SPIF_BASIC_PARAM_TABLE_222_READ_INST_BYTE - 1] & 0x1F);
862
- tr_info("\nDEBUG: Read Bus Mode set to 2-2-2, Instruction: 0x%xh", read_inst);
863
833
break;
864
834
}
865
835
}
@@ -869,20 +839,17 @@ int SPIFBlockDevice::_sfdp_detect_best_bus_read_mode(uint8_t *basic_param_table_
869
839
read_inst = basic_param_table_ptr[SPIF_BASIC_PARAM_TABLE_122_READ_INST_BYTE];
870
840
_read_dummy_and_mode_cycles = (basic_param_table_ptr[SPIF_BASIC_PARAM_TABLE_122_READ_INST_BYTE - 1] >> 5)
871
841
+ (basic_param_table_ptr[SPIF_BASIC_PARAM_TABLE_122_READ_INST_BYTE - 1] & 0x1F);
872
- tr_debug("\nDEBUG: Read Bus Mode set to 1-2-2, Instruction: 0x%xh", read_inst);
873
842
break;
874
843
}
875
844
if (examined_byte & 0x01) {
876
845
// Fast Read 1-1-2 Supported
877
846
read_inst = basic_param_table_ptr[SPIF_BASIC_PARAM_TABLE_112_READ_INST_BYTE];
878
847
_read_dummy_and_mode_cycles = (basic_param_table_ptr[SPIF_BASIC_PARAM_TABLE_112_READ_INST_BYTE - 1] >> 5)
879
848
+ (basic_param_table_ptr[SPIF_BASIC_PARAM_TABLE_112_READ_INST_BYTE - 1] & 0x1F);
880
- tr_debug("\nDEBUG: Read Bus Mode set to 1-1-2, Instruction: 0x%xh", _read_instruction);
881
849
break;
882
850
}
883
851
*/
884
852
_read_dummy_and_mode_cycles = 0 ;
885
- tr_debug (" \n DEBUG: Read Bus Mode set to 1-1-1, Instruction: 0x%xh" , read_inst);
886
853
} while (false );
887
854
888
855
return 0 ;
@@ -893,21 +860,17 @@ int SPIFBlockDevice::_reset_flash_mem()
893
860
// Perform Soft Reset of the Device prior to initialization
894
861
int status = 0 ;
895
862
char status_value[2 ] = {0 };
896
- tr_info (" INFO: _reset_flash_mem:\n " );
897
863
// Read the Status Register from device
898
864
if (SPIF_BD_ERROR_OK == _spi_send_general_command (SPIF_RDSR, SPI_NO_ADDRESS_COMMAND, NULL , 0 , status_value, 1 )) {
899
865
// store received values in status_value
900
- tr_debug (" DEBUG: Reading Status Register Success: value = 0x%x\n " , (int )status_value[0 ]);
901
866
} else {
902
- tr_debug (" ERROR: Reading Status Register failed\n " );
903
867
status = -1 ;
904
868
}
905
869
906
870
if (0 == status) {
907
871
// Send Reset Enable
908
872
if (SPIF_BD_ERROR_OK == _spi_send_general_command (SPIF_RSTEN, SPI_NO_ADDRESS_COMMAND, NULL , 0 , NULL , 0 )) {
909
873
// store received values in status_value
910
- tr_debug (" DEBUG: Sending RSTEN Success\n " );
911
874
} else {
912
875
tr_error (" ERROR: Sending RSTEN failed\n " );
913
876
status = -1 ;
@@ -917,7 +880,6 @@ int SPIFBlockDevice::_reset_flash_mem()
917
880
// Send Reset
918
881
if (SPIF_BD_ERROR_OK == _spi_send_general_command (SPIF_RST, SPI_NO_ADDRESS_COMMAND, NULL , 0 , NULL , 0 )) {
919
882
// store received values in status_value
920
- tr_debug (" DEBUG: Sending RST Success\n " );
921
883
} else {
922
884
tr_error (" ERROR: Sending RST failed\n " );
923
885
status = -1 ;
0 commit comments