/* F_CLK_TIME */
#define FCT_CLK_DIV_MASK 0x0FFF
-#if 0
-static int lpc288x_register_commands(struct command_context_s *cmd_ctx);
-static int lpc288x_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank);
-static int lpc288x_erase(struct flash_bank_s *bank, int first, int last);
-static int lpc288x_protect(struct flash_bank_s *bank, int set, int first, int last);
-static int lpc288x_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint32_t count);
-static int lpc288x_probe(struct flash_bank_s *bank);
-static int lpc288x_erase_check(struct flash_bank_s *bank);
-static int lpc288x_protect_check(struct flash_bank_s *bank);
-static int lpc288x_info(struct flash_bank_s *bank, char *buf, int buf_size);
-#endif
static uint32_t lpc288x_wait_status_busy(flash_bank_t *bank, int timeout);
static void lpc288x_load_timer(int erase, struct target_s *target);
static void lpc288x_set_flash_clk(struct flash_bank_s *bank);
static int validate_target_state (struct nand_device_s *device);
static int do_data_output (struct nand_device_s *device);
-static int imx31_nand_device_command (struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc,
- struct nand_device_s *device);
-static int imx31_init (struct nand_device_s *device);
-static int imx31_read_data (struct nand_device_s *device, void *data);
-static int imx31_write_data (struct nand_device_s *device, uint16_t data);
-static int imx31_nand_ready (struct nand_device_s *device, int timeout);
-static int imx31_register_commands (struct command_context_s *cmd_ctx);
-static int imx31_reset (struct nand_device_s *device);
static int imx31_command (struct nand_device_s *device, uint8_t command);
static int imx31_address (struct nand_device_s *device, uint8_t address);
static int imx31_controller_ready (struct nand_device_s *device, int tout);
-static int imx31_write_page (struct nand_device_s *device, uint32_t page,
- uint8_t * data, uint32_t data_size, uint8_t * oob,
- uint32_t oob_size);
-static int imx31_read_page (struct nand_device_s *device, uint32_t page,
- uint8_t * data, uint32_t data_size, uint8_t * oob,
- uint32_t oob_size);
-
-nand_flash_controller_t imx31_nand_flash_controller = {
- .name = "imx31",
- .nand_device_command = imx31_nand_device_command,
- .register_commands = imx31_register_commands,
- .init = imx31_init,
- .reset = imx31_reset,
- .command = imx31_command,
- .address = imx31_address,
- .write_data = imx31_write_data,
- .read_data = imx31_read_data,
- .write_page = imx31_write_page,
- .read_page = imx31_read_page,
- .controller_ready = imx31_controller_ready,
- .nand_ready = imx31_nand_ready,
-};
static int imx31_nand_device_command (struct command_context_s *cmd_ctx,
char *cmd, char **args, int argc,
}
return ERROR_OK;
}
+
+nand_flash_controller_t imx31_nand_flash_controller = {
+ .name = "imx31",
+ .nand_device_command = &imx31_nand_device_command,
+ .register_commands = &imx31_register_commands,
+ .init = &imx31_init,
+ .reset = &imx31_reset,
+ .command = &imx31_command,
+ .address = &imx31_address,
+ .write_data = &imx31_write_data,
+ .read_data = &imx31_read_data,
+ .write_page = &imx31_write_page,
+ .read_page = &imx31_read_page,
+ .controller_ready = &imx31_controller_ready,
+ .nand_ready = &imx31_nand_ready,
+ };
static pld_device_t *pld_devices;
static command_t *pld_cmd;
-static int handle_pld_devices_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc);
-static int handle_pld_device_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc);
-static int handle_pld_load_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc);
-
-int pld_init(struct command_context_s *cmd_ctx)
-{
- if (pld_devices)
- {
- register_command(cmd_ctx, pld_cmd, "devices", handle_pld_devices_command, COMMAND_EXEC,
- "list configured pld devices");
- register_command(cmd_ctx, pld_cmd, "load", handle_pld_load_command, COMMAND_EXEC,
- "load configuration <file> into programmable logic device");
- }
-
- return ERROR_OK;
-}
-
pld_device_t *get_pld_device_by_num(int num)
{
pld_device_t *p;
return ERROR_OK;
}
+int pld_init(struct command_context_s *cmd_ctx)
+{
+ if (!pld_devices)
+ return ERROR_OK;
+
+ register_command(cmd_ctx, pld_cmd, "devices",
+ handle_pld_devices_command, COMMAND_EXEC,
+ "list configured pld devices");
+ register_command(cmd_ctx, pld_cmd, "load",
+ handle_pld_load_command, COMMAND_EXEC,
+ "load configuration <file> into programmable logic device");
+
+ return ERROR_OK;
+}
+
int pld_register_commands(struct command_context_s *cmd_ctx)
{
pld_cmd = register_command(cmd_ctx, NULL, "pld", NULL, COMMAND_ANY, "programmable logic device commands");
#include "pld.h"
-static int virtex2_register_commands(struct command_context_s *cmd_ctx);
-static int virtex2_pld_device_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct pld_device_s *pld_device);
-static int virtex2_load(struct pld_device_s *pld_device, char *filename);
-
-pld_driver_t virtex2_pld =
-{
- .name = "virtex2",
- .register_commands = virtex2_register_commands,
- .pld_device_command = virtex2_pld_device_command,
- .load = virtex2_load,
-};
-
static int virtex2_set_instr(jtag_tap_t *tap, uint32_t new_instr)
{
if (tap == NULL)
return ERROR_OK;
}
-static int virtex2_register_commands(struct command_context_s *cmd_ctx)
-{
- command_t *virtex2_cmd = register_command(cmd_ctx, NULL, "virtex2", NULL, COMMAND_ANY, "virtex2 specific commands");
-
- register_command(cmd_ctx, virtex2_cmd, "read_stat", virtex2_handle_read_stat_command, COMMAND_EXEC,
- "read Virtex-II status register");
-
- return ERROR_OK;
-}
-
static int virtex2_pld_device_command(struct command_context_s *cmd_ctx,
char *cmd, char **args, int argc, struct pld_device_s *pld_device)
{
return ERROR_OK;
}
+
+static int virtex2_register_commands(struct command_context_s *cmd_ctx)
+{
+ command_t *virtex2_cmd = register_command(cmd_ctx, NULL, "virtex2",
+ NULL, COMMAND_ANY, "virtex2 specific commands");
+
+ register_command(cmd_ctx, virtex2_cmd, "read_stat",
+ &virtex2_handle_read_stat_command, COMMAND_EXEC,
+ "read Virtex-II status register");
+
+ return ERROR_OK;
+}
+
+pld_driver_t virtex2_pld = {
+ .name = "virtex2",
+ .register_commands = &virtex2_register_commands,
+ .pld_device_command = &virtex2_pld_device_command,
+ .load = &virtex2_load,
+ };
static int etb_get_reg(reg_t *reg);
-static int handle_etb_config_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-
static int etb_set_instr(etb_t *etb, uint32_t new_instr)
{
jtag_tap_t *tap;
return ERROR_OK;
}
-static int etb_register_commands(struct command_context_s *cmd_ctx)
-{
- command_t *etb_cmd;
-
- etb_cmd = register_command(cmd_ctx, NULL, "etb", NULL, COMMAND_ANY, "Embedded Trace Buffer");
-
- register_command(cmd_ctx, etb_cmd, "config", handle_etb_config_command, COMMAND_CONFIG, NULL);
-
- return ERROR_OK;
-}
-
static int handle_etb_config_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{
target_t *target;
return ERROR_OK;
}
+static int etb_register_commands(struct command_context_s *cmd_ctx)
+{
+ command_t *etb_cmd = register_command(cmd_ctx, NULL, "etb",
+ NULL, COMMAND_ANY, "Embedded Trace Buffer");
+
+ register_command(cmd_ctx, etb_cmd, "config",
+ handle_etb_config_command, COMMAND_CONFIG,
+ NULL);
+
+ return ERROR_OK;
+}
+
static int etb_init(etm_context_t *etm_ctx)
{
etb_t *etb = etm_ctx->capture_driver_priv;