drivers: flash: rv32m1: Fix DT_DRV_COMPAT setting
For a flash driver DT_DRV_COMPAT should be the compatible for the flash controller and not the soc-nv-flash. Change to driver to use the flash controllers compatible and get the soc-nv-flash properties as a child of that controller. Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
7ca6a05159
commit
3fa974cab0
1 changed files with 5 additions and 4 deletions
|
@ -4,7 +4,8 @@
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define DT_DRV_COMPAT soc_nv_flash
|
#define DT_DRV_COMPAT openisa_rv32m1_ftfe
|
||||||
|
#define SOC_NV_FLASH_NODE DT_INST(0, soc_nv_flash)
|
||||||
|
|
||||||
#include <kernel.h>
|
#include <kernel.h>
|
||||||
#include <device.h>
|
#include <device.h>
|
||||||
|
@ -115,9 +116,9 @@ static int flash_mcux_write_protection(struct device *dev, bool enable)
|
||||||
|
|
||||||
#if defined(CONFIG_FLASH_PAGE_LAYOUT)
|
#if defined(CONFIG_FLASH_PAGE_LAYOUT)
|
||||||
static const struct flash_pages_layout dev_layout = {
|
static const struct flash_pages_layout dev_layout = {
|
||||||
.pages_count = DT_INST_REG_SIZE(0) /
|
.pages_count = DT_REG_SIZE(SOC_NV_FLASH_NODE) /
|
||||||
DT_INST_PROP(0, erase_block_size),
|
DT_PROP(SOC_NV_FLASH_NODE, erase_block_size),
|
||||||
.pages_size = DT_INST_PROP(0, erase_block_size),
|
.pages_size = DT_PROP(SOC_NV_FLASH_NODE, erase_block_size),
|
||||||
};
|
};
|
||||||
|
|
||||||
static void flash_mcux_pages_layout(
|
static void flash_mcux_pages_layout(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue