Skip to content

Commit 0aba1a8

Browse files
danieldegrassecarlescufi
authored andcommitted
drivers: memc: rename flexspi-hyperram driver to flexspi-s27ks0641
Rename flexspi-hyperram driver to flexspi-s27ks0641, and update function names. This driver is only capable of supporting the s27ks0641 HyperRAM chip, as the lookup table given in this driver is specific to the s27ks0641. Rename the flexspi-hyperram binding to reflect this, to prevent confusion from users. Signed-off-by: Daniel DeGrasse <[email protected]>
1 parent 7d410c5 commit 0aba1a8

File tree

5 files changed

+37
-36
lines changed

5 files changed

+37
-36
lines changed

drivers/memc/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ zephyr_linker_sources_ifdef(CONFIG_MEMC_STM32_SDRAM SECTIONS memc_stm32_sdram.ld
88
zephyr_library_sources_ifdef(CONFIG_MEMC_STM32_NOR_PSRAM memc_stm32_nor_psram.c)
99

1010
zephyr_library_sources_ifdef(CONFIG_MEMC_MCUX_FLEXSPI memc_mcux_flexspi.c)
11-
zephyr_library_sources_ifdef(CONFIG_MEMC_MCUX_FLEXSPI_HYPERRAM memc_mcux_flexspi_hyperram.c)
11+
zephyr_library_sources_ifdef(CONFIG_MEMC_MCUX_FLEXSPI_S27KS0641 memc_mcux_flexspi_s27ks0641.c)
1212

1313
zephyr_library_sources_ifdef(CONFIG_MEMC_SAM_SMC memc_sam_smc.c)
1414

drivers/memc/Kconfig.mcux

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# Copyright (c) 2020 NXP
1+
# Copyright (c) 2020-2022 NXP
22
# Copyright (c) 2021 Basalte bv
33
# SPDX-License-Identifier: Apache-2.0
44

55
if DT_HAS_NXP_IMX_FLEXSPI_ENABLED
66

7-
config MEMC_MCUX_FLEXSPI_HYPERRAM
8-
bool "MCUX FlexSPI HyperRAM driver"
7+
config MEMC_MCUX_FLEXSPI_S27KS0641
8+
bool "MCUX FlexSPI Cypress S27KS0641 HyperRAM driver"
99
default y
10-
depends on DT_HAS_NXP_IMX_FLEXSPI_HYPERRAM_ENABLED
10+
depends on DT_HAS_NXP_IMX_FLEXSPI_S27KS0641_ENABLED
1111
select MEMC_MCUX_FLEXSPI
1212

1313
config MEMC_MCUX_FLEXSPI

drivers/memc/memc_mcux_flexspi_hyperram.c renamed to drivers/memc/memc_mcux_flexspi_s27ks0641.c

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
#define DT_DRV_COMPAT nxp_imx_flexspi_hyperram
7+
#define DT_DRV_COMPAT nxp_imx_flexspi_s27ks0641
88

99
#include <zephyr/logging/log.h>
1010
#include <zephyr/sys/util.h>
@@ -23,7 +23,7 @@
2323
read-while-write hazards. This configuration is not recommended."
2424
#endif
2525

26-
LOG_MODULE_REGISTER(memc_flexspi_hyperram, CONFIG_MEMC_LOG_LEVEL);
26+
LOG_MODULE_REGISTER(memc_flexspi_s27ks0641, CONFIG_MEMC_LOG_LEVEL);
2727

2828
enum {
2929
READ_DATA,
@@ -32,17 +32,17 @@ enum {
3232
WRITE_REG,
3333
};
3434

35-
struct memc_flexspi_hyperram_config {
35+
struct memc_flexspi_s27ks0641_config {
3636
flexspi_port_t port;
3737
flexspi_device_config_t config;
3838
};
3939

4040
/* Device variables used in critical sections should be in this structure */
41-
struct memc_flexspi_hyperram_data {
41+
struct memc_flexspi_s27ks0641_data {
4242
const struct device *controller;
4343
};
4444

45-
static const uint32_t memc_flexspi_hyperram_lut[][4] = {
45+
static const uint32_t memc_flexspi_s27ks0641_lut[][4] = {
4646
/* Read Data */
4747
[READ_DATA] = {
4848
FLEXSPI_LUT_SEQ(kFLEXSPI_Command_DDR, kFLEXSPI_8PAD, 0xA0,
@@ -84,11 +84,11 @@ static const uint32_t memc_flexspi_hyperram_lut[][4] = {
8484
},
8585
};
8686

87-
static int memc_flexspi_hyperram_get_vendor_id(const struct device *dev,
87+
static int memc_flexspi_s27ks0641_get_vendor_id(const struct device *dev,
8888
uint16_t *vendor_id)
8989
{
90-
const struct memc_flexspi_hyperram_config *config = dev->config;
91-
struct memc_flexspi_hyperram_data *data = dev->data;
90+
const struct memc_flexspi_s27ks0641_config *config = dev->config;
91+
struct memc_flexspi_s27ks0641_data *data = dev->data;
9292
uint32_t buffer = 0;
9393
int ret;
9494

@@ -110,10 +110,10 @@ static int memc_flexspi_hyperram_get_vendor_id(const struct device *dev,
110110
return ret;
111111
}
112112

113-
static int memc_flexspi_hyperram_init(const struct device *dev)
113+
static int memc_flexspi_s27ks0641_init(const struct device *dev)
114114
{
115-
const struct memc_flexspi_hyperram_config *config = dev->config;
116-
struct memc_flexspi_hyperram_data *data = dev->data;
115+
const struct memc_flexspi_s27ks0641_config *config = dev->config;
116+
struct memc_flexspi_s27ks0641_data *data = dev->data;
117117
uint16_t vendor_id;
118118

119119
if (!device_is_ready(data->controller)) {
@@ -128,15 +128,15 @@ static int memc_flexspi_hyperram_init(const struct device *dev)
128128
}
129129

130130
if (memc_flexspi_update_lut(data->controller, 0,
131-
(const uint32_t *) memc_flexspi_hyperram_lut,
132-
sizeof(memc_flexspi_hyperram_lut) / 4)) {
131+
(const uint32_t *) memc_flexspi_s27ks0641_lut,
132+
sizeof(memc_flexspi_s27ks0641_lut) / 4)) {
133133
LOG_ERR("Could not update lut");
134134
return -EINVAL;
135135
}
136136

137137
memc_flexspi_reset(data->controller);
138138

139-
if (memc_flexspi_hyperram_get_vendor_id(dev, &vendor_id)) {
139+
if (memc_flexspi_s27ks0641_get_vendor_id(dev, &vendor_id)) {
140140
LOG_ERR("Could not read vendor id");
141141
return -EIO;
142142
}
@@ -179,25 +179,25 @@ static int memc_flexspi_hyperram_init(const struct device *dev)
179179
.enableWriteMask = true, \
180180
} \
181181

182-
#define MEMC_FLEXSPI_HYPERRAM(n) \
183-
static const struct memc_flexspi_hyperram_config \
184-
memc_flexspi_hyperram_config_##n = { \
182+
#define MEMC_FLEXSPI_S27KS0641(n) \
183+
static const struct memc_flexspi_s27ks0641_config \
184+
memc_flexspi_s27ks0641_config_##n = { \
185185
.port = DT_INST_REG_ADDR(n), \
186186
.config = MEMC_FLEXSPI_DEVICE_CONFIG(n), \
187187
}; \
188188
\
189-
static struct memc_flexspi_hyperram_data \
190-
memc_flexspi_hyperram_data_##n = { \
189+
static struct memc_flexspi_s27ks0641_data \
190+
memc_flexspi_s27ks0641_data_##n = { \
191191
.controller = DEVICE_DT_GET(DT_INST_BUS(n)), \
192192
}; \
193193
\
194194
DEVICE_DT_INST_DEFINE(n, \
195-
memc_flexspi_hyperram_init, \
195+
memc_flexspi_s27ks0641_init, \
196196
NULL, \
197-
&memc_flexspi_hyperram_data_##n, \
198-
&memc_flexspi_hyperram_config_##n, \
197+
&memc_flexspi_s27ks0641_data_##n, \
198+
&memc_flexspi_s27ks0641_config_##n, \
199199
POST_KERNEL, \
200200
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \
201201
NULL);
202202

203-
DT_INST_FOREACH_STATUS_OKAY(MEMC_FLEXSPI_HYPERRAM)
203+
DT_INST_FOREACH_STATUS_OKAY(MEMC_FLEXSPI_S27KS0641)

dts/bindings/mtd/nxp,imx-flexspi-hyperram.yaml

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Copyright 2021 Basalte bv
2+
# Copyright 2022 NXP
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
description: Cypress S27KS0641 HyperRAM on NXP FlexSPI bus
6+
7+
compatible: "nxp,imx-flexspi-s27ks0641"
8+
9+
include: nxp,imx-flexspi-device.yaml

0 commit comments

Comments
 (0)