static int s3c2410_init(struct nand_device *nand)
{
- struct s3c24xx_nand_controller *s3c24xx_info = nand->controller_priv;
- struct target *target = s3c24xx_info->target;
+ struct target *target = nand->target;
target_write_u32(target, S3C2410_NFCONF,
S3C2410_NFCONF_EN | S3C2410_NFCONF_TACLS(3) |
static int s3c2410_write_data(struct nand_device *nand, uint16_t data)
{
- struct s3c24xx_nand_controller *s3c24xx_info = nand->controller_priv;
- struct target *target = s3c24xx_info->target;
+ struct target *target = nand->target;
if (target->state != TARGET_HALTED) {
LOG_ERROR("target must be halted to use S3C24XX NAND flash controller");
static int s3c2410_read_data(struct nand_device *nand, void *data)
{
- struct s3c24xx_nand_controller *s3c24xx_info = nand->controller_priv;
- struct target *target = s3c24xx_info->target;
+ struct target *target = nand->target;
if (target->state != TARGET_HALTED) {
LOG_ERROR("target must be halted to use S3C24XX NAND flash controller");
static int s3c2410_nand_ready(struct nand_device *nand, int timeout)
{
- struct s3c24xx_nand_controller *s3c24xx_info = nand->controller_priv;
- struct target *target = s3c24xx_info->target;
+ struct target *target = nand->target;
uint8_t status;
if (target->state != TARGET_HALTED) {
static int s3c2412_init(struct nand_device *nand)
{
- struct s3c24xx_nand_controller *s3c24xx_info = nand->controller_priv;
- struct target *target = s3c24xx_info->target;
+ struct target *target = nand->target;
target_write_u32(target, S3C2410_NFCONF,
S3C2440_NFCONF_TACLS(3) |
static int s3c2440_init(struct nand_device *nand)
{
- struct s3c24xx_nand_controller *s3c24xx_info = nand->controller_priv;
- struct target *target = s3c24xx_info->target;
+ struct target *target = nand->target;
target_write_u32(target, S3C2410_NFCONF,
S3C2440_NFCONF_TACLS(3) |
int s3c2440_nand_ready(struct nand_device *nand, int timeout)
{
struct s3c24xx_nand_controller *s3c24xx_info = nand->controller_priv;
- struct target *target = s3c24xx_info->target;
+ struct target *target = nand->target;
uint8_t status;
if (target->state != TARGET_HALTED) {
int s3c2440_read_block_data(struct nand_device *nand, uint8_t *data, int data_size)
{
struct s3c24xx_nand_controller *s3c24xx_info = nand->controller_priv;
- struct target *target = s3c24xx_info->target;
+ struct target *target = nand->target;
uint32_t nfdata = s3c24xx_info->data;
uint32_t tmp;
int s3c2440_write_block_data(struct nand_device *nand, uint8_t *data, int data_size)
{
struct s3c24xx_nand_controller *s3c24xx_info = nand->controller_priv;
- struct target *target = s3c24xx_info->target;
+ struct target *target = nand->target;
uint32_t nfdata = s3c24xx_info->data;
uint32_t tmp;
static int s3c2443_init(struct nand_device *nand)
{
- struct s3c24xx_nand_controller *s3c24xx_info = nand->controller_priv;
- struct target *target = s3c24xx_info->target;
+ struct target *target = nand->target;
target_write_u32(target, S3C2410_NFCONF,
S3C2440_NFCONF_TACLS(3) |
}
nand->controller_priv = s3c24xx_info;
-
- s3c24xx_info->target = get_target(CMD_ARGV[1]);
- if (s3c24xx_info->target == NULL) {
- LOG_ERROR("target '%s' not defined", CMD_ARGV[1]);
- return ERROR_COMMAND_SYNTAX_ERROR;
- }
-
*info = s3c24xx_info;
return ERROR_OK;
int s3c24xx_reset(struct nand_device *nand)
{
struct s3c24xx_nand_controller *s3c24xx_info = nand->controller_priv;
- struct target *target = s3c24xx_info->target;
+ struct target *target = nand->target;
if (target->state != TARGET_HALTED) {
LOG_ERROR("target must be halted to use S3C24XX NAND flash controller");
int s3c24xx_command(struct nand_device *nand, uint8_t command)
{
struct s3c24xx_nand_controller *s3c24xx_info = nand->controller_priv;
- struct target *target = s3c24xx_info->target;
+ struct target *target = nand->target;
if (target->state != TARGET_HALTED) {
LOG_ERROR("target must be halted to use S3C24XX NAND flash controller");
int s3c24xx_address(struct nand_device *nand, uint8_t address)
{
struct s3c24xx_nand_controller *s3c24xx_info = nand->controller_priv;
- struct target *target = s3c24xx_info->target;
+ struct target *target = nand->target;
if (target->state != TARGET_HALTED) {
LOG_ERROR("target must be halted to use S3C24XX NAND flash controller");
int s3c24xx_write_data(struct nand_device *nand, uint16_t data)
{
struct s3c24xx_nand_controller *s3c24xx_info = nand->controller_priv;
- struct target *target = s3c24xx_info->target;
+ struct target *target = nand->target;
if (target->state != TARGET_HALTED) {
LOG_ERROR("target must be halted to use S3C24XX NAND flash controller");
int s3c24xx_read_data(struct nand_device *nand, void *data)
{
struct s3c24xx_nand_controller *s3c24xx_info = nand->controller_priv;
- struct target *target = s3c24xx_info->target;
+ struct target *target = nand->target;
if (target->state != TARGET_HALTED) {
LOG_ERROR("target must be halted to use S3C24XX NAND flash controller");
struct s3c24xx_nand_controller
{
- struct target *target;
-
/* register addresses */
uint32_t cmd;
uint32_t addr;
static int s3c6400_init(struct nand_device *nand)
{
- struct s3c24xx_nand_controller *s3c24xx_info = nand->controller_priv;
- struct target *target = s3c24xx_info->target;
+ struct target *target = nand->target;
target_write_u32(target, S3C2410_NFCONF,
S3C2440_NFCONF_TACLS(3) |