Skip to content

Commit bdca32d

Browse files
bogdanovskartben
authored andcommitted
drivers: flash: Remove VIMS calls for cc23x0
Remove VIMS calls for flash operations, since they are not needed. Signed-off-by: Stoyan Bogdanov <[email protected]>
1 parent c96356d commit bdca32d

File tree

1 file changed

+0
-44
lines changed

1 file changed

+0
-44
lines changed

drivers/flash/soc_flash_cc23x0.c

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include <string.h>
1313

1414
#include <driverlib/flash.h>
15-
#include <driverlib/vims.h>
1615

1716
#define DT_DRV_COMPAT ti_cc23x0_flash_controller
1817
#define SOC_NV_FLASH_NODE DT_INST(0, soc_nv_flash)
@@ -40,44 +39,9 @@ static int flash_cc23x0_init(const struct device *dev)
4039
return 0;
4140
}
4241

43-
static void flash_cc23x0_cache_restore(uint32_t vims_mode)
44-
{
45-
while (VIMSModeGet(VIMS_BASE) == VIMS_MODE_CHANGING) {
46-
;
47-
}
48-
49-
/* Restore VIMS mode and line buffers */
50-
if (vims_mode != VIMS_MODE_DISABLED) {
51-
VIMSModeSafeSet(VIMS_BASE, vims_mode, true);
52-
}
53-
54-
VIMSLineBufEnable(VIMS_BASE);
55-
}
56-
57-
static uint32_t flash_cc23x0_cache_disable(void)
58-
{
59-
uint32_t vims_mode;
60-
61-
/* VIMS and both line buffers should be off during flash update */
62-
VIMSLineBufDisable(VIMS_BASE);
63-
64-
while (VIMSModeGet(VIMS_BASE) == VIMS_MODE_CHANGING) {
65-
;
66-
}
67-
68-
/* Save current VIMS mode for restoring it later */
69-
vims_mode = VIMSModeGet(VIMS_BASE);
70-
if (vims_mode != VIMS_MODE_DISABLED) {
71-
VIMSModeSafeSet(VIMS_BASE, VIMS_MODE_DISABLED, true);
72-
}
73-
74-
return vims_mode;
75-
}
76-
7742
static int flash_cc23x0_erase(const struct device *dev, off_t offs, size_t size)
7843
{
7944
struct flash_cc23x0_data *data = dev->data;
80-
uint32_t vims_mode;
8145
unsigned int key;
8246
int i;
8347
int rc = 0;
@@ -96,7 +60,6 @@ static int flash_cc23x0_erase(const struct device *dev, off_t offs, size_t size)
9660
return -EACCES;
9761
}
9862

99-
vims_mode = flash_cc23x0_cache_disable();
10063
/*
10164
* Disable all interrupts to prevent flash read, from TI's TRF:
10265
*
@@ -121,16 +84,13 @@ static int flash_cc23x0_erase(const struct device *dev, off_t offs, size_t size)
12184

12285
irq_unlock(key);
12386

124-
flash_cc23x0_cache_restore(vims_mode);
125-
12687
k_sem_give(&data->mutex);
12788
return rc;
12889
}
12990

13091
static int flash_cc23x0_write(const struct device *dev, off_t offs, const void *data, size_t size)
13192
{
13293
struct flash_cc23x0_data *flash_data = dev->data;
133-
uint32_t vims_mode;
13494
unsigned int key;
13595
int rc = 0;
13696

@@ -159,8 +119,6 @@ static int flash_cc23x0_write(const struct device *dev, off_t offs, const void *
159119
return -EACCES;
160120
}
161121

162-
vims_mode = flash_cc23x0_cache_disable();
163-
164122
key = irq_lock();
165123

166124
while (FlashCheckFsmForReady() != FAPI_STATUS_FSM_READY) {
@@ -174,8 +132,6 @@ static int flash_cc23x0_write(const struct device *dev, off_t offs, const void *
174132

175133
irq_unlock(key);
176134

177-
flash_cc23x0_cache_restore(vims_mode);
178-
179135
k_sem_give(&flash_data->mutex);
180136

181137
return rc;

0 commit comments

Comments
 (0)