projects
/
fw
/
openocd
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tms470: use register_commands()
[fw/openocd]
/
src
/
flash
/
s3c24xx_nand.c
diff --git
a/src/flash/s3c24xx_nand.c
b/src/flash/s3c24xx_nand.c
index 8be5f0212fa0f3c06bac86c93e57a029b794183b..262569e8f1ec18cd50a3174e6b391831c65cce94 100644
(file)
--- a/
src/flash/s3c24xx_nand.c
+++ b/
src/flash/s3c24xx_nand.c
@@
-31,39
+31,36
@@
#include "s3c24xx_nand.h"
#include "s3c24xx_nand.h"
-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)
+S3C24XX_DEVICE_COMMAND()
{
{
- s
3c24xx_nand_controller_t
*s3c24xx_info;
+ s
truct s3c24xx_nand_controller
*s3c24xx_info;
- s3c24xx_info = malloc(sizeof(s
3c24xx_nand_controller_t
));
+ s3c24xx_info = malloc(sizeof(s
truct s3c24xx_nand_controller
));
if (s3c24xx_info == NULL) {
LOG_ERROR("no memory for nand controller\n");
if (s3c24xx_info == NULL) {
LOG_ERROR("no memory for nand controller\n");
- return
NULL
;
+ return
-ENOMEM
;
}
}
-
device
->controller_priv = s3c24xx_info;
+
nand
->controller_priv = s3c24xx_info;
- s3c24xx_info->target = get_target(
args
[1]);
+ s3c24xx_info->target = get_target(
CMD_ARGV
[1]);
if (s3c24xx_info->target == NULL) {
if (s3c24xx_info->target == NULL) {
- LOG_ERROR("target '%s' not defined",
args
[1]);
- return
NULL
;
+ LOG_ERROR("target '%s' not defined",
CMD_ARGV
[1]);
+ return
ERROR_COMMAND_SYNTAX_ERROR
;
}
}
- return
s3c24xx_info
;
+ return
ERROR_OK
;
}
}
-int s3c24xx_register_commands(struct command_context
_s
*cmd_ctx)
+int s3c24xx_register_commands(struct command_context *cmd_ctx)
{
return ERROR_OK;
}
{
return ERROR_OK;
}
-int s3c24xx_reset(struct nand_device
_s *device
)
+int s3c24xx_reset(struct nand_device
*nand
)
{
{
- s
3c24xx_nand_controller_t *s3c24xx_info = device
->controller_priv;
-
target_
t *target = s3c24xx_info->target;
+ s
truct s3c24xx_nand_controller *s3c24xx_info = nand
->controller_priv;
+
struct targe
t *target = s3c24xx_info->target;
if (target->state != TARGET_HALTED) {
LOG_ERROR("target must be halted to use S3C24XX NAND flash controller");
if (target->state != TARGET_HALTED) {
LOG_ERROR("target must be halted to use S3C24XX NAND flash controller");
@@
-75,10
+72,10
@@
int s3c24xx_reset(struct nand_device_s *device)
return ERROR_OK;
}
return ERROR_OK;
}
-int s3c24xx_command(struct nand_device
_s *device
, uint8_t command)
+int s3c24xx_command(struct nand_device
*nand
, uint8_t command)
{
{
- s
3c24xx_nand_controller_t *s3c24xx_info = device
->controller_priv;
-
target_
t *target = s3c24xx_info->target;
+ s
truct s3c24xx_nand_controller *s3c24xx_info = nand
->controller_priv;
+
struct targe
t *target = s3c24xx_info->target;
if (target->state != TARGET_HALTED) {
LOG_ERROR("target must be halted to use S3C24XX NAND flash controller");
if (target->state != TARGET_HALTED) {
LOG_ERROR("target must be halted to use S3C24XX NAND flash controller");
@@
-90,10
+87,10
@@
int s3c24xx_command(struct nand_device_s *device, uint8_t command)
}
}
-int s3c24xx_address(struct nand_device
_s *device
, uint8_t address)
+int s3c24xx_address(struct nand_device
*nand
, uint8_t address)
{
{
- s
3c24xx_nand_controller_t *s3c24xx_info = device
->controller_priv;
-
target_
t *target = s3c24xx_info->target;
+ s
truct s3c24xx_nand_controller *s3c24xx_info = nand
->controller_priv;
+
struct targe
t *target = s3c24xx_info->target;
if (target->state != TARGET_HALTED) {
LOG_ERROR("target must be halted to use S3C24XX NAND flash controller");
if (target->state != TARGET_HALTED) {
LOG_ERROR("target must be halted to use S3C24XX NAND flash controller");
@@
-104,10
+101,10
@@
int s3c24xx_address(struct nand_device_s *device, uint8_t address)
return ERROR_OK;
}
return ERROR_OK;
}
-int s3c24xx_write_data(struct nand_device
_s *device, u16
data)
+int s3c24xx_write_data(struct nand_device
*nand, uint16_t
data)
{
{
- s
3c24xx_nand_controller_t *s3c24xx_info = device
->controller_priv;
-
target_
t *target = s3c24xx_info->target;
+ s
truct s3c24xx_nand_controller *s3c24xx_info = nand
->controller_priv;
+
struct targe
t *target = s3c24xx_info->target;
if (target->state != TARGET_HALTED) {
LOG_ERROR("target must be halted to use S3C24XX NAND flash controller");
if (target->state != TARGET_HALTED) {
LOG_ERROR("target must be halted to use S3C24XX NAND flash controller");
@@
-118,10
+115,10
@@
int s3c24xx_write_data(struct nand_device_s *device, u16 data)
return ERROR_OK;
}
return ERROR_OK;
}
-int s3c24xx_read_data(struct nand_device
_s *device
, void *data)
+int s3c24xx_read_data(struct nand_device
*nand
, void *data)
{
{
- s
3c24xx_nand_controller_t *s3c24xx_info = device
->controller_priv;
-
target_
t *target = s3c24xx_info->target;
+ s
truct s3c24xx_nand_controller *s3c24xx_info = nand
->controller_priv;
+
struct targe
t *target = s3c24xx_info->target;
if (target->state != TARGET_HALTED) {
LOG_ERROR("target must be halted to use S3C24XX NAND flash controller");
if (target->state != TARGET_HALTED) {
LOG_ERROR("target must be halted to use S3C24XX NAND flash controller");
@@
-132,7
+129,7
@@
int s3c24xx_read_data(struct nand_device_s *device, void *data)
return ERROR_OK;
}
return ERROR_OK;
}
-int s3c24xx_controller_ready(struct nand_device
_s *device
, int timeout)
+int s3c24xx_controller_ready(struct nand_device
*nand
, int timeout)
{
return 1;
}
{
return 1;
}