blob: f7e5df3e2decc812341b21692fb9333fb7824ca8 [file] [log] [blame]
Haavard Skinnemoend255bb02008-05-16 11:10:31 +02001/*
2 * Command for accessing DataFlash.
3 *
4 * Copyright (C) 2008 Atmel Corporation
5 */
6#include <common.h>
7#include <df.h>
8
Wolfgang Denk54841ab2010-06-28 22:00:46 +02009static int do_df(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
Haavard Skinnemoend255bb02008-05-16 11:10:31 +020010{
11 const char *cmd;
12
13 /* need at least two arguments */
14 if (argc < 2)
15 goto usage;
16
17 cmd = argv[1];
18
19 if (strcmp(cmd, "init") == 0) {
20 df_init(0, 0, 1000000);
21 return 0;
22 }
23
24 if (strcmp(cmd, "info") == 0) {
25 df_show_info();
26 return 0;
27 }
28
29usage:
Simon Glass4c12eeb2011-12-10 08:44:01 +000030 return CMD_RET_USAGE;
Haavard Skinnemoend255bb02008-05-16 11:10:31 +020031}
32
33U_BOOT_CMD(
34 sf, 2, 1, do_serial_flash,
Peter Tyser2fb26042009-01-27 18:03:12 -060035 "Serial flash sub-system",
Wolfgang Denka89c33d2009-05-24 17:06:54 +020036 "probe [bus:]cs - init flash device on given SPI bus and CS")