/* * MTD utility functions * * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * $Id: mtd.h 271787 2011-07-13 20:53:53Z $ */ #ifndef _mtd_h_ #define _mtd_h_ /* * Open an MTD device * @param mtd path to or partition name of MTD device * @param flags open() flags * @return return value of open() */ extern int mtd_open(const char *mtd, int flags); /* * Erase an MTD device * @param mtd path to or partition name of MTD device * @return 0 on success and errno on failure */ extern int mtd_erase(const char *mtd); /* * Write a file or a URL to an MTD device * @param path file to write or a URL * @param mtd path to or partition name of MTD device * @return 0 on success and errno on failure */ extern int mtd_write(const char *path, const char *mtd); /* * Write a CFE image to a MTD device * @param path file to write or a URL * @param mtd path to or partition name of MTD device * @return 0 on success and errno on failure */ extern int mtd_write_cfe(const char *path, const char *mtd); #endif /* _mtd_h_ */