1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2009 by Michael Sparmann
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 #ifndef __NAND_TARGET_H__
23 #define __NAND_TARGET_H__
29 struct nand_device_info_type
34 uint16_t pagesperblock
;
35 uint8_t blocksizeexponent
;
40 } __attribute__((packed
));
42 uint32_t nand_read_page(uint32_t bank
, uint32_t page
, void* databuffer
,
43 void* sparebuffer
, uint32_t doecc
,
45 uint32_t nand_write_page(uint32_t bank
, uint32_t page
, void* databuffer
,
46 void* sparebuffer
, uint32_t doecc
);
47 uint32_t nand_block_erase(uint32_t bank
, uint32_t page
);
49 const struct nand_device_info_type
* nand_get_device_type(uint32_t bank
);
50 uint32_t nand_reset(uint32_t bank
);
51 uint32_t nand_device_init(void);
52 void nand_set_active(void);
53 long nand_last_activity(void);
54 void nand_power_up(void);
55 void nand_power_down(void);