@@ -63,13 +63,13 @@ using namespace mbed;
63
63
#define SPINAND_BLOCK_PROT_BIT_SP 0x01
64
64
#define SPINAND_BLOCK_PROT_BIT_COMPLE 0x02
65
65
#define SPINAND_BLOCK_PROT_BIT_INVERT 0x04
66
- #define SPINAND_BLOCK_PROT_BIT_BP0 0x08
67
- #define SPINAND_BLOCK_PROT_BIT_BP1 0x10
68
- #define SPINAND_BLOCK_PROT_BIT_BP2 0x20
66
+ #define SPINAND_BLOCK_PROT_BIT_BP0 0x08
67
+ #define SPINAND_BLOCK_PROT_BIT_BP1 0x10
68
+ #define SPINAND_BLOCK_PROT_BIT_BP2 0x20
69
69
#define SPINAND_BLOCK_PROT_BIT_BPRWD 0x80
70
70
#define SPINAND_BLOCK_PROT_BIT_BP_MASK 0x38
71
71
72
- #define SPINAND_BLOCK_PROT_BP_OFFSET 3
72
+ #define SPINAND_BLOCK_PROT_BP_OFFSET 3
73
73
#define SPINAND_BLOCK_PROT_COMPLE_OFFSET 1
74
74
75
75
#define IS_MEM_READY_MAX_RETRIES 10000
@@ -286,7 +286,7 @@ int SPINANDBlockDevice::read(void *buffer, bd_addr_t addr, bd_size_t size)
286
286
buffer = static_cast < uint8_t *>(buffer) + chunk;
287
287
addr += SPINAND_PAGE_OFFSET;
288
288
size -= chunk;
289
-
289
+
290
290
_mutex.unlock ();
291
291
}
292
292
@@ -518,18 +518,18 @@ int SPINANDBlockDevice::_set_quad_enable()
518
518
}
519
519
520
520
if (QSPI_STATUS_OK != _qspi_send_general_command (SPINAND_INST_GET_FEATURE, FEATURES_ADDR_SECURE_OTP,
521
- NULL , 0 , (char *) &secur_reg, 1 )) {
521
+ NULL , 0 , (char *) &secur_reg, 1 )) {
522
522
tr_error (" Reading Security Register failed" );
523
523
}
524
524
525
525
secur_reg |= SPINAND_SECURE_BIT_QE;
526
526
527
527
if (QSPI_STATUS_OK != _qspi_send_general_command (SPINAND_INST_SET_FEATURE, FEATURES_ADDR_SECURE_OTP,
528
- (char *) &secur_reg, 1 , NULL , 0 )) {
528
+ (char *) &secur_reg, 1 , NULL , 0 )) {
529
529
tr_error (" Writing Security Register failed" );
530
530
}
531
531
if (QSPI_STATUS_OK != _qspi_send_general_command (SPINAND_INST_GET_FEATURE, FEATURES_ADDR_SECURE_OTP,
532
- NULL , 0 , (char *) &secur_reg, 1 )) {
532
+ NULL , 0 , (char *) &secur_reg, 1 )) {
533
533
tr_error (" Reading Security Register failed" );
534
534
}
535
535
if (false == _is_mem_ready ()) {
@@ -550,18 +550,18 @@ int SPINANDBlockDevice::_clear_block_protection()
550
550
}
551
551
552
552
if (QSPI_STATUS_OK != _qspi_send_general_command (SPINAND_INST_GET_FEATURE, FEATURES_ADDR_BLOCK_PROTECTION,
553
- NULL , 0 , (char *) &block_protection_reg, 1 )) {
553
+ NULL , 0 , (char *) &block_protection_reg, 1 )) {
554
554
tr_error (" Reading Block Protection Register failed" );
555
555
}
556
556
557
557
block_protection_reg &= ~SPINAND_BLOCK_PROT_BIT_BP_MASK;
558
558
559
559
if (QSPI_STATUS_OK != _qspi_send_general_command (SPINAND_INST_SET_FEATURE, FEATURES_ADDR_BLOCK_PROTECTION,
560
- (char *) &block_protection_reg, 1 , NULL , 0 )) {
560
+ (char *) &block_protection_reg, 1 , NULL , 0 )) {
561
561
tr_error (" Writing Block Protection Register failed" );
562
562
}
563
563
if (QSPI_STATUS_OK != _qspi_send_general_command (SPINAND_INST_GET_FEATURE, FEATURES_ADDR_BLOCK_PROTECTION,
564
- NULL , 0 , (char *) &block_protection_reg, 1 )) {
564
+ NULL , 0 , (char *) &block_protection_reg, 1 )) {
565
565
tr_error (" Reading Block Protection Register failed" );
566
566
}
567
567
if (false == _is_mem_ready ()) {
@@ -729,7 +729,7 @@ qspi_status_t SPINANDBlockDevice::_qspi_send_program_command(qspi_inst_t prog_in
729
729
if (QSPI_STATUS_OK != _qspi_send_general_command (SPINAND_INST_PROGRAM_EXEC, addr >> 12 , NULL , 0 , NULL , 0 )) {
730
730
tr_error (" Read page from array failed" );
731
731
}
732
-
732
+
733
733
status = _qspi.configure_format (_inst_width, _address_width, _address_size, _address_width, // Alt width should be the same as address width
734
734
_alt_size, _data_width, 0 );
735
735
if (QSPI_STATUS_OK != status) {
@@ -763,7 +763,7 @@ qspi_status_t SPINANDBlockDevice::_qspi_send_erase_command(qspi_inst_t erase_ins
763
763
tr_error (" QSPI Erase failed" );
764
764
return status;
765
765
}
766
-
766
+
767
767
status = _qspi.configure_format (_inst_width, _address_width, _address_size, _address_width, // Alt width should be the same as address width
768
768
_alt_size, _data_width, 0 );
769
769
if (QSPI_STATUS_OK != status) {
0 commit comments