Linux preempt-rt

Check our new training course

Real-Time Linux with PREEMPT_RT

Check our new training course
with Creative Commons CC-BY-SA
lecture and lab materials

Bootlin logo

Elixir Cross Referencer

 * Copyright (c) 2017 Linaro Limited
 * Copyright (c) 2017 BayLibre, SAS.
 * SPDX-License-Identifier: Apache-2.0


#include <flash_registers.h>

#include <flash_map.h>

#include <clock_control.h>
#include <clock_control/stm32_clock_control.h>

struct flash_stm32_priv {
	struct stm32f4x_flash *regs;
#elif defined(CONFIG_SOC_SERIES_STM32L4X)
	struct stm32l4x_flash *regs;
	/* clock subsystem driving this peripheral */
	struct stm32_pclken pclken;
	struct k_sem sem;

bool flash_stm32_valid_range(off_t offset, u32_t len, bool write);

int flash_stm32_write_range(unsigned int offset, const void *data,
			    unsigned int len, struct flash_stm32_priv *p);

int flash_stm32_block_erase_loop(unsigned int offset, unsigned int len,
				 struct flash_stm32_priv *p);

void flash_stm32_flush_caches(struct flash_stm32_priv *p);

int flash_stm32_wait_flash_idle(struct flash_stm32_priv *p);

int flash_stm32_check_status(struct flash_stm32_priv *p);

int flash_stm32_erase(struct device *dev, off_t offset, size_t len);

int flash_stm32_write(struct device *dev, off_t offset,
		      const void *data, size_t len);

#endif /* DRIVERS_FLASH_STM32_H */