]>
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 | |
c609719b WD |
20 | #include <ide.h> |
21 | #include <ata.h> | |
735dd97b | 22 | |
2d8d190c | 23 | #ifdef CONFIG_LED_STATUS |
c609719b WD |
24 | # include <status_led.h> |
25 | #endif | |
735dd97b | 26 | |
c609719b | 27 | /* Current I/O Device */ |
584f316f | 28 | static int curr_device; |
c609719b | 29 | |
09140113 | 30 | int do_ide(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) |
ed73508d | 31 | { |
09ed0d61 | 32 | if (argc == 2) { |
ed73508d | 33 | if (strncmp(argv[1], "res", 3) == 0) { |
5b8e76c3 | 34 | puts("\nReset IDE: "); |
ed73508d SG |
35 | ide_init(); |
36 | return 0; | |
ed73508d | 37 | } |
ed73508d | 38 | } |
09ed0d61 | 39 | |
e33a5c6b | 40 | return blk_common_cmd(argc, argv, UCLASS_IDE, &curr_device); |
ed73508d | 41 | } |
c40b2956 | 42 | |
09140113 | 43 | int do_diskboot(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) |
ed73508d SG |
44 | { |
45 | return common_diskboot(cmdtp, "ide", argc, argv); | |
46 | } | |
c609719b | 47 | |
34c202c7 WD |
48 | U_BOOT_CMD(ide, 5, 1, do_ide, |
49 | "IDE sub-system", | |
50 | "reset - reset IDE controller\n" | |
51 | "ide info - show available IDE devices\n" | |
52 | "ide device [dev] - show or set current device\n" | |
53 | "ide part [dev] - print partition table of one or all IDE devices\n" | |
54 | "ide read addr blk# cnt\n" | |
55 | "ide write addr blk# cnt - read/write `cnt'" | |
56 | " blocks starting at block `blk#'\n" | |
57 | " to/from memory address `addr'"); | |
58 | ||
59 | U_BOOT_CMD(diskboot, 3, 1, do_diskboot, | |
60 | "boot from IDE device", "loadAddr dev:part"); |