dae5a32c05
To prepare for handling TCL return values consistently, all calls to command_print/command_print_sameline should be ready to switch to CMD as first parameter. Change prototype of nand_fileio_start() to pass CMD instead of CMD_CTX. This change was part of http://openocd.zylin.com/1815 from Paul Fertser and has been extracted and rebased to simplify the review. Change-Id: I7993f6aba997a2d2917949563651c8d0c213730d Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5052 Tested-by: jenkins
57 lines
2.2 KiB
C
57 lines
2.2 KiB
C
/***************************************************************************
|
|
* Copyright (C) 2009 Zachary T Welch <zw@superlucidity.net> *
|
|
* *
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
* it under the terms of the GNU General Public License as published by *
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
* (at your option) any later version. *
|
|
* *
|
|
* This program is distributed in the hope that it will be useful, *
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
* GNU General Public License for more details. *
|
|
* *
|
|
* You should have received a copy of the GNU General Public License *
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
|
***************************************************************************/
|
|
|
|
#ifndef OPENOCD_FLASH_NAND_FILEIO_H
|
|
#define OPENOCD_FLASH_NAND_FILEIO_H
|
|
|
|
#include <helper/time_support.h>
|
|
#include <helper/fileio.h>
|
|
|
|
struct nand_fileio_state {
|
|
uint32_t address;
|
|
uint32_t size;
|
|
|
|
uint8_t *page;
|
|
uint32_t page_size;
|
|
|
|
enum oob_formats oob_format;
|
|
uint8_t *oob;
|
|
uint32_t oob_size;
|
|
|
|
const int *eccpos;
|
|
|
|
bool file_opened;
|
|
struct fileio *fileio;
|
|
|
|
struct duration bench;
|
|
};
|
|
|
|
void nand_fileio_init(struct nand_fileio_state *state);
|
|
int nand_fileio_start(struct command_invocation *cmd,
|
|
struct nand_device *nand, const char *filename, int filemode,
|
|
struct nand_fileio_state *state);
|
|
int nand_fileio_cleanup(struct nand_fileio_state *state);
|
|
int nand_fileio_finish(struct nand_fileio_state *state);
|
|
|
|
COMMAND_HELPER(nand_fileio_parse_args, struct nand_fileio_state *state,
|
|
struct nand_device **dev, enum fileio_access filemode,
|
|
bool need_size, bool sw_ecc);
|
|
|
|
int nand_fileio_read(struct nand_device *nand, struct nand_fileio_state *s);
|
|
|
|
#endif /* OPENOCD_FLASH_NAND_FILEIO_H */
|