]>
Commit | Line | Data |
---|---|---|
83d290c5 | 1 | // SPDX-License-Identifier: GPL-2.0+ |
c609719b | 2 | /* |
34c202c7 | 3 | * (C) Copyright 2000-2011 |
c609719b | 4 | * Wolfgang Denk, DENX Software Engineering, [email protected]. |
c609719b WD |
5 | */ |
6 | ||
7 | /* | |
8 | * IDE support | |
9 | */ | |
113bfe48 | 10 | |
c609719b | 11 | #include <common.h> |
2a981dc2 | 12 | #include <blk.h> |
c609719b WD |
13 | #include <config.h> |
14 | #include <watchdog.h> | |
15 | #include <command.h> | |
16 | #include <image.h> | |
17 | #include <asm/byteorder.h> | |
f98984cb | 18 | #include <asm/io.h> |
735dd97b | 19 | |
5b8e76c3 | 20 | #if defined(CONFIG_IDE_PCMCIA) |
c609719b WD |
21 | # include <pcmcia.h> |
22 | #endif | |
735dd97b | 23 | |
c609719b WD |
24 | #include <ide.h> |
25 | #include <ata.h> | |
735dd97b | 26 | |
2d8d190c | 27 | #ifdef CONFIG_LED_STATUS |
c609719b WD |
28 | # include <status_led.h> |
29 | #endif | |
735dd97b | 30 | |
c609719b | 31 | /* Current I/O Device */ |
584f316f | 32 | static int curr_device; |
c609719b | 33 | |
ed73508d SG |
34 | int do_ide(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) |
35 | { | |
09ed0d61 | 36 | if (argc == 2) { |
ed73508d | 37 | if (strncmp(argv[1], "res", 3) == 0) { |
5b8e76c3 | 38 | puts("\nReset IDE: "); |
ed73508d SG |
39 | ide_init(); |
40 | return 0; | |
ed73508d | 41 | } |
ed73508d | 42 | } |
09ed0d61 SG |
43 | |
44 | return blk_common_cmd(argc, argv, IF_TYPE_IDE, &curr_device); | |
ed73508d | 45 | } |
c40b2956 | 46 | |
ed73508d SG |
47 | int do_diskboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) |
48 | { | |
49 | return common_diskboot(cmdtp, "ide", argc, argv); | |
50 | } | |
c609719b | 51 | |
34c202c7 WD |
52 | U_BOOT_CMD(ide, 5, 1, do_ide, |
53 | "IDE sub-system", | |
54 | "reset - reset IDE controller\n" | |
55 | "ide info - show available IDE devices\n" | |
56 | "ide device [dev] - show or set current device\n" | |
57 | "ide part [dev] - print partition table of one or all IDE devices\n" | |
58 | "ide read addr blk# cnt\n" | |
59 | "ide write addr blk# cnt - read/write `cnt'" | |
60 | " blocks starting at block `blk#'\n" | |
61 | " to/from memory address `addr'"); | |
62 | ||
63 | U_BOOT_CMD(diskboot, 3, 1, do_diskboot, | |
64 | "boot from IDE device", "loadAddr dev:part"); |