OpenOCD
s3c6400.c
Go to the documentation of this file.
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 
3 /***************************************************************************
4  * Copyright (C) 2010 by Peter Korsgaard <jacmet@sunsite.dk> *
5  * Heavily based on s3c2412.c by Ben Dooks <ben@fluff.org> *
6  ***************************************************************************/
7 
8 #ifdef HAVE_CONFIG_H
9 #include "config.h"
10 #endif
11 
12 #include "s3c24xx.h"
13 /* s3c64xx uses another base address for the nand controller than 24xx */
14 #undef S3C2410_NFREG
15 #define S3C2410_NFREG(x) ((x) + 0x70200000)
16 
17 NAND_DEVICE_COMMAND_HANDLER(s3c6400_nand_device_command)
18 {
21 
22  /* fill in the address fields for the core device */
23  info->cmd = S3C2440_NFCMD;
24  info->addr = S3C2440_NFADDR;
25  info->data = S3C2440_NFDATA;
26  info->nfstat = S3C2412_NFSTAT;
27 
28  return ERROR_OK;
29 }
30 
31 static int s3c6400_init(struct nand_device *nand)
32 {
33  struct target *target = nand->target;
34 
38  S3C2440_NFCONF_TWRPH1(7) | 4);
39 
43 
44  return ERROR_OK;
45 }
46 
48  .name = "s3c6400",
49  .nand_device_command = &s3c6400_nand_device_command,
50  .init = &s3c6400_init,
51  .reset = &s3c24xx_reset,
52  .command = &s3c24xx_command,
53  .address = &s3c24xx_address,
54  .write_data = &s3c24xx_write_data,
55  .read_data = &s3c24xx_read_data,
56  .write_page = s3c24xx_write_page,
57  .read_page = s3c24xx_read_page,
58  .write_block_data = &s3c2440_write_block_data,
59  .read_block_data = &s3c2440_read_block_data,
60  .nand_ready = &s3c2440_nand_ready,
61 };
#define ERROR_OK
Definition: log.h:155
int s3c2440_read_block_data(struct nand_device *nand, uint8_t *data, int data_size)
Definition: s3c2440.c:75
int s3c2440_nand_ready(struct nand_device *nand, int timeout)
Definition: s3c2440.c:49
int s3c2440_write_block_data(struct nand_device *nand, uint8_t *data, int data_size)
Definition: s3c2440.c:111
int s3c24xx_write_data(struct nand_device *nand, uint16_t data)
Definition: s3c24xx.c:80
int s3c24xx_reset(struct nand_device *nand)
Definition: s3c24xx.c:37
int s3c24xx_address(struct nand_device *nand, uint8_t address)
Definition: s3c24xx.c:66
int s3c24xx_command(struct nand_device *nand, uint8_t command)
Definition: s3c24xx.c:52
int s3c24xx_read_data(struct nand_device *nand, void *data)
Definition: s3c24xx.c:94
#define CALL_S3C24XX_DEVICE_COMMAND(d, i)
Definition: s3c24xx.h:40
#define s3c24xx_read_page
Definition: s3c24xx.h:56
#define s3c24xx_write_page
Definition: s3c24xx.h:55
#define S3C2410_NFCONF
Definition: s3c24xx_regs.h:18
#define S3C2440_NFCONF_TWRPH0(x)
Definition: s3c24xx_regs.h:65
#define S3C2440_NFCONT
Definition: s3c24xx_regs.h:25
#define S3C2440_NFCMD
Definition: s3c24xx_regs.h:26
#define S3C2412_NFCONT_INIT_MAIN_ECC
Definition: s3c24xx_regs.h:95
#define S3C2440_NFDATA
Definition: s3c24xx_regs.h:28
#define S3C2440_NFCONT_ENABLE
Definition: s3c24xx_regs.h:77
#define S3C2412_NFSTAT
Definition: s3c24xx_regs.h:43
#define S3C2440_NFADDR
Definition: s3c24xx_regs.h:27
#define S3C2440_NFCONF_TACLS(x)
Definition: s3c24xx_regs.h:64
#define S3C2440_NFCONF_TWRPH1(x)
Definition: s3c24xx_regs.h:66
static int s3c6400_init(struct nand_device *nand)
Definition: s3c6400.c:31
struct nand_flash_controller s3c6400_nand_controller
Definition: s3c6400.c:47
NAND_DEVICE_COMMAND_HANDLER(s3c6400_nand_device_command)
Definition: s3c6400.c:17
struct target * target
Definition: nand/core.h:49
Interface for NAND flash controllers.
Definition: nand/driver.h:23
const char * name
Driver name that is used to select it from configuration files.
Definition: nand/driver.h:25
Definition: target.h:120
int target_write_u32(struct target *target, target_addr_t address, uint32_t value)
Definition: target.c:2707
static struct ublast_lowlevel_priv info