Files
rtems/bsps/include/dev/flash/xnandpsu_flashdev.h
Kinsey Moore ff52b009b5 bsps/shared: Add XNandPsu flashdev backend
Add a flashdev backend supporting the XNandPsu peripheral on ZynqMP
systems.
2025-12-03 08:25:50 -06:00

64 lines
2.1 KiB
C

/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup Flash
*
* @brief Flashdev backend XNandPsu peripheral
*/
/*
* Copyright (C) 2025 On-Line Applications Research (OAR) Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef XNANDPSU_FLASHDEV_H
#define XNANDPSU_FLASHDEV_H
#include <dev/flash/flashdev.h>
#include <dev/nand/xnandpsu.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Initializes a flash device using Xilinx's xnandpsu flash driver.
*
* The flash device is not registered in this call. The returned object must be
* destroyed with rtems_flashdev_destroy if it has not been registered.
*
* @param[in] nandpsu A pointer to a configured XNandPsu device.
*
* @retval A pointer to the rtems_flashdev.
* @retval NULL on failure.
*/
rtems_flashdev* xnandpsu_flashdev_init( XNandPsu *nandpsu );
#ifdef __cplusplus
}
#endif
#endif /* XNANDPSU_FLASHDEV_H */