1 /* src/flash/s3c24xx_nand.h
3 * S3C24XX Series OpenOCD NAND Flash controller support.
5 * Copyright 2007,2008 Ben Dooks <ben@fluff.org>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * Many thanks to Simtec Electronics for sponsoring this work.
16 #include "s3c24xx_regs_nand.h"
18 typedef struct s3c24xx_nand_controller_s
20 struct target_s *target;
22 /* register addresses */
27 } s3c24xx_nand_controller_t;
29 /* Default to using the un-translated NAND register based address */
31 #define S3C2410_NFREG(x) ((x) + 0x4e000000)
33 extern s3c24xx_nand_controller_t *s3c24xx_nand_device_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct nand_device_s *device);
35 extern int s3c24xx_register_commands(struct command_context_s *cmd_ctx);
36 extern int s3c24xx_reset(struct nand_device_s *device);
37 extern int s3c24xx_command(struct nand_device_s *device, u8 command);
38 extern int s3c24xx_address(struct nand_device_s *device, u8 address);
39 extern int s3c24xx_write_data(struct nand_device_s *device, u16 data);
40 extern int s3c24xx_read_data(struct nand_device_s *device, void *data);
41 extern int s3c24xx_controller_ready(struct nand_device_s *device, int tout);
43 #define s3c24xx_write_page NULL
44 #define s3c24xx_read_page NULL
46 /* code shared between different controllers */
48 extern int s3c2440_nand_ready(struct nand_device_s *device, int timeout);
50 extern int s3c2440_read_block_data(struct nand_device_s *, u8 *data, int data_size);
51 extern int s3c2440_write_block_data(struct nand_device_s *, u8 *data, int data_size);