Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 1 | /* Yaffs commands. |
| 2 | * Modified by Charles Manning by adding ydevconfig command. |
| 3 | * |
| 4 | * Use ydevconfig to configure a mountpoint before use. |
| 5 | * For example: |
| 6 | * # Configure mountpt xxx using nand device 0 using blocks 100-500 |
| 7 | * ydevconfig xxx 0 100 500 |
| 8 | * # Mount it |
| 9 | * ymount xxx |
| 10 | * # yls, yrdm etc |
| 11 | * yls -l xxx |
| 12 | * yrdm xxx/boot-image 82000000 |
| 13 | * ... |
| 14 | */ |
| 15 | |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 16 | #include <config.h> |
| 17 | #include <command.h> |
| 18 | |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 19 | #ifdef YAFFS2_DEBUG |
| 20 | #define PRINTF(fmt, args...) printf(fmt, ##args) |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 21 | #else |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 22 | #define PRINTF(fmt, args...) do { } while (0) |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 23 | #endif |
| 24 | |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 25 | extern void cmd_yaffs_dev_ls(void); |
| 26 | extern void cmd_yaffs_tracemask(unsigned set, unsigned mask); |
| 27 | extern void cmd_yaffs_devconfig(char *mp, int flash_dev, |
| 28 | int start_block, int end_block); |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 29 | extern void cmd_yaffs_mount(char *mp); |
| 30 | extern void cmd_yaffs_umount(char *mp); |
| 31 | extern void cmd_yaffs_read_file(char *fn); |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 32 | extern void cmd_yaffs_write_file(char *fn, char bval, int sizeOfFile); |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 33 | extern void cmd_yaffs_ls(const char *mountpt, int longlist); |
| 34 | extern void cmd_yaffs_mwrite_file(char *fn, char *addr, int size); |
| 35 | extern void cmd_yaffs_mread_file(char *fn, char *addr); |
| 36 | extern void cmd_yaffs_mkdir(const char *dir); |
| 37 | extern void cmd_yaffs_rmdir(const char *dir); |
| 38 | extern void cmd_yaffs_rm(const char *path); |
| 39 | extern void cmd_yaffs_mv(const char *oldPath, const char *newPath); |
| 40 | |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 41 | extern int yaffs_dump_dev(const char *path); |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 42 | |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 43 | /* ytrace - show/set yaffs trace mask */ |
Simon Glass | 0914011 | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 44 | int do_ytrace(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 45 | { |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 46 | if (argc > 1) |
| 47 | cmd_yaffs_tracemask(1, simple_strtol(argv[1], NULL, 16)); |
| 48 | else |
| 49 | cmd_yaffs_tracemask(0, 0); |
Wolfgang Denk | 4b07080 | 2008-08-14 14:41:06 +0200 | [diff] [blame] | 50 | |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 51 | return 0; |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 52 | } |
| 53 | |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 54 | /* ydevls - lists yaffs mount points. */ |
Simon Glass | 0914011 | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 55 | int do_ydevls(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 56 | { |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 57 | cmd_yaffs_dev_ls(); |
Wolfgang Denk | 4b07080 | 2008-08-14 14:41:06 +0200 | [diff] [blame] | 58 | |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 59 | return 0; |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 60 | } |
| 61 | |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 62 | /* ydevconfig mount_pt mtd_dev_num start_block end_block */ |
Simon Glass | 0914011 | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 63 | int do_ydevconfig(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 64 | { |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 65 | char *mtpoint; |
| 66 | int mtd_dev; |
| 67 | int start_block; |
| 68 | int end_block; |
Wolfgang Denk | 4b07080 | 2008-08-14 14:41:06 +0200 | [diff] [blame] | 69 | |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 70 | if (argc != 5) { |
| 71 | printf |
| 72 | ("Bad arguments: ydevconfig mount_pt mtd_dev start_block end_block\n"); |
| 73 | return -1; |
| 74 | } |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 75 | |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 76 | mtpoint = argv[1]; |
| 77 | mtd_dev = simple_strtol(argv[2], NULL, 16); |
| 78 | start_block = simple_strtol(argv[3], NULL, 16); |
| 79 | end_block = simple_strtol(argv[4], NULL, 16); |
| 80 | |
| 81 | cmd_yaffs_devconfig(mtpoint, mtd_dev, start_block, end_block); |
| 82 | |
| 83 | return 0; |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 84 | } |
| 85 | |
Simon Glass | 0914011 | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 86 | int do_ymount(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 87 | { |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 88 | char *mtpoint; |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 89 | |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 90 | if (argc != 2) { |
| 91 | printf("Bad arguments: ymount mount_pt\n"); |
| 92 | return -1; |
| 93 | } |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 94 | |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 95 | mtpoint = argv[1]; |
| 96 | printf("Mounting yaffs2 mount point %s\n", mtpoint); |
| 97 | |
| 98 | cmd_yaffs_mount(mtpoint); |
| 99 | |
| 100 | return 0; |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 101 | } |
| 102 | |
Simon Glass | 0914011 | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 103 | int do_yumount(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 104 | { |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 105 | char *mtpoint; |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 106 | |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 107 | if (argc != 2) { |
| 108 | printf("Bad arguments: yumount mount_pt\n"); |
| 109 | return -1; |
| 110 | } |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 111 | |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 112 | mtpoint = argv[1]; |
| 113 | printf("Unmounting yaffs2 mount point %s\n", mtpoint); |
| 114 | cmd_yaffs_umount(mtpoint); |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 115 | |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 116 | return 0; |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 117 | } |
| 118 | |
Simon Glass | 0914011 | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 119 | int do_yls(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 120 | { |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 121 | char *dirname; |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 122 | |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 123 | if (argc < 2 || argc > 3 || (argc == 3 && strcmp(argv[1], "-l"))) { |
| 124 | printf("Bad arguments: yls [-l] dir\n"); |
| 125 | return -1; |
| 126 | } |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 127 | |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 128 | dirname = argv[argc - 1]; |
| 129 | |
| 130 | cmd_yaffs_ls(dirname, (argc > 2) ? 1 : 0); |
| 131 | |
| 132 | return 0; |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 133 | } |
| 134 | |
Simon Glass | 0914011 | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 135 | int do_yrd(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 136 | { |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 137 | char *filename; |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 138 | |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 139 | if (argc != 2) { |
| 140 | printf("Bad arguments: yrd file_name\n"); |
| 141 | return -1; |
| 142 | } |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 143 | |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 144 | filename = argv[1]; |
| 145 | |
| 146 | printf("Reading file %s ", filename); |
| 147 | |
| 148 | cmd_yaffs_read_file(filename); |
| 149 | |
| 150 | printf("done\n"); |
| 151 | return 0; |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 152 | } |
| 153 | |
Simon Glass | 0914011 | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 154 | int do_ywr(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 155 | { |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 156 | char *filename; |
| 157 | ulong value; |
| 158 | ulong numValues; |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 159 | |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 160 | if (argc != 4) { |
| 161 | printf("Bad arguments: ywr file_name value n_values\n"); |
| 162 | return -1; |
| 163 | } |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 164 | |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 165 | filename = argv[1]; |
Simon Glass | 7e5f460 | 2021-07-24 09:03:29 -0600 | [diff] [blame] | 166 | value = hextoul(argv[2], NULL); |
| 167 | numValues = hextoul(argv[3], NULL); |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 168 | |
| 169 | printf("Writing value (%lx) %lx times to %s... ", value, numValues, |
| 170 | filename); |
| 171 | |
| 172 | cmd_yaffs_write_file(filename, value, numValues); |
| 173 | |
| 174 | printf("done\n"); |
| 175 | return 0; |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 176 | } |
| 177 | |
Simon Glass | 0914011 | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 178 | int do_yrdm(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 179 | { |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 180 | char *filename; |
| 181 | ulong addr; |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 182 | |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 183 | if (argc != 3) { |
| 184 | printf("Bad arguments: yrdm file_name addr\n"); |
| 185 | return -1; |
| 186 | } |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 187 | |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 188 | filename = argv[1]; |
Simon Glass | 7e5f460 | 2021-07-24 09:03:29 -0600 | [diff] [blame] | 189 | addr = hextoul(argv[2], NULL); |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 190 | |
| 191 | cmd_yaffs_mread_file(filename, (char *)addr); |
| 192 | |
| 193 | return 0; |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 194 | } |
| 195 | |
Simon Glass | 0914011 | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 196 | int do_ywrm(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 197 | { |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 198 | char *filename; |
| 199 | ulong addr; |
| 200 | ulong size; |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 201 | |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 202 | if (argc != 4) { |
| 203 | printf("Bad arguments: ywrm file_name addr size\n"); |
| 204 | return -1; |
| 205 | } |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 206 | |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 207 | filename = argv[1]; |
Simon Glass | 7e5f460 | 2021-07-24 09:03:29 -0600 | [diff] [blame] | 208 | addr = hextoul(argv[2], NULL); |
| 209 | size = hextoul(argv[3], NULL); |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 210 | |
| 211 | cmd_yaffs_mwrite_file(filename, (char *)addr, size); |
| 212 | |
| 213 | return 0; |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 214 | } |
| 215 | |
Simon Glass | 0914011 | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 216 | int do_ymkdir(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 217 | { |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 218 | char *dirname; |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 219 | |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 220 | if (argc != 2) { |
| 221 | printf("Bad arguments: ymkdir dir_name\n"); |
| 222 | return -1; |
| 223 | } |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 224 | |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 225 | dirname = argv[1]; |
| 226 | cmd_yaffs_mkdir(dirname); |
| 227 | |
| 228 | return 0; |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 229 | } |
| 230 | |
Simon Glass | 0914011 | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 231 | int do_yrmdir(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 232 | { |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 233 | char *dirname; |
| 234 | |
| 235 | if (argc != 2) { |
| 236 | printf("Bad arguments: yrmdir dir_name\n"); |
| 237 | return -1; |
| 238 | } |
| 239 | |
| 240 | dirname = argv[1]; |
| 241 | cmd_yaffs_rmdir(dirname); |
| 242 | |
| 243 | return 0; |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 244 | } |
| 245 | |
Simon Glass | 0914011 | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 246 | int do_yrm(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 247 | { |
| 248 | char *name; |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 249 | |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 250 | if (argc != 2) { |
| 251 | printf("Bad arguments: yrm name\n"); |
| 252 | return -1; |
| 253 | } |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 254 | |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 255 | name = argv[1]; |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 256 | |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 257 | cmd_yaffs_rm(name); |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 258 | |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 259 | return 0; |
| 260 | } |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 261 | |
Simon Glass | 0914011 | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 262 | int do_ymv(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 263 | { |
| 264 | char *oldPath; |
| 265 | char *newPath; |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 266 | |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 267 | if (argc != 3) { |
| 268 | printf("Bad arguments: ymv old_path new_path\n"); |
| 269 | return -1; |
| 270 | } |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 271 | |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 272 | oldPath = argv[1]; |
| 273 | newPath = argv[2]; |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 274 | |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 275 | cmd_yaffs_mv(newPath, oldPath); |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 276 | |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 277 | return 0; |
| 278 | } |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 279 | |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 280 | U_BOOT_CMD(ytrace, 2, 0, do_ytrace, |
| 281 | "show/set yaffs trace mask", |
Peter Tyser | 5bd15b7 | 2015-02-03 10:15:04 -0600 | [diff] [blame] | 282 | "[new_mask] show/set yaffs trace mask"); |
William Juul | 90ef117 | 2007-11-15 12:23:57 +0100 | [diff] [blame] | 283 | |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 284 | U_BOOT_CMD(ydevls, 1, 0, do_ydevls, |
| 285 | "list yaffs mount points", "list yaffs mount points"); |
| 286 | |
| 287 | U_BOOT_CMD(ydevconfig, 5, 0, do_ydevconfig, |
| 288 | "configure yaffs mount point", |
Peter Tyser | 5bd15b7 | 2015-02-03 10:15:04 -0600 | [diff] [blame] | 289 | "mtpoint mtd_id start_block end_block configures a yaffs2 mount point"); |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 290 | |
| 291 | U_BOOT_CMD(ymount, 2, 0, do_ymount, |
Peter Tyser | 5bd15b7 | 2015-02-03 10:15:04 -0600 | [diff] [blame] | 292 | "mount yaffs", "mtpoint mounts a yaffs2 mount point"); |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 293 | |
| 294 | U_BOOT_CMD(yumount, 2, 0, do_yumount, |
Peter Tyser | 5bd15b7 | 2015-02-03 10:15:04 -0600 | [diff] [blame] | 295 | "unmount yaffs", "mtpoint unmounts a yaffs2 mount point"); |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 296 | |
Peter Tyser | 5bd15b7 | 2015-02-03 10:15:04 -0600 | [diff] [blame] | 297 | U_BOOT_CMD(yls, 3, 0, do_yls, "yaffs ls", "[-l] dirname"); |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 298 | |
| 299 | U_BOOT_CMD(yrd, 2, 0, do_yrd, |
Peter Tyser | 5bd15b7 | 2015-02-03 10:15:04 -0600 | [diff] [blame] | 300 | "read file from yaffs", "path read file from yaffs"); |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 301 | |
| 302 | U_BOOT_CMD(ywr, 4, 0, do_ywr, |
| 303 | "write file to yaffs", |
Peter Tyser | 5bd15b7 | 2015-02-03 10:15:04 -0600 | [diff] [blame] | 304 | "filename value num_vlues write values to yaffs file"); |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 305 | |
| 306 | U_BOOT_CMD(yrdm, 3, 0, do_yrdm, |
| 307 | "read file to memory from yaffs", |
Peter Tyser | 5bd15b7 | 2015-02-03 10:15:04 -0600 | [diff] [blame] | 308 | "filename offset reads yaffs file into memory"); |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 309 | |
| 310 | U_BOOT_CMD(ywrm, 4, 0, do_ywrm, |
| 311 | "write file from memory to yaffs", |
Peter Tyser | 5bd15b7 | 2015-02-03 10:15:04 -0600 | [diff] [blame] | 312 | "filename offset size writes memory to yaffs file"); |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 313 | |
| 314 | U_BOOT_CMD(ymkdir, 2, 0, do_ymkdir, |
Peter Tyser | 5bd15b7 | 2015-02-03 10:15:04 -0600 | [diff] [blame] | 315 | "YAFFS mkdir", "dir create a yaffs directory"); |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 316 | |
| 317 | U_BOOT_CMD(yrmdir, 2, 0, do_yrmdir, |
Peter Tyser | 5bd15b7 | 2015-02-03 10:15:04 -0600 | [diff] [blame] | 318 | "YAFFS rmdir", "dirname removes a yaffs directory"); |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 319 | |
Peter Tyser | 5bd15b7 | 2015-02-03 10:15:04 -0600 | [diff] [blame] | 320 | U_BOOT_CMD(yrm, 2, 0, do_yrm, "YAFFS rm", "path removes a yaffs file"); |
Charles Manning | 753ac61 | 2012-05-09 16:55:17 +0000 | [diff] [blame] | 321 | |
| 322 | U_BOOT_CMD(ymv, 4, 0, do_ymv, |
| 323 | "YAFFS mv", |
Peter Tyser | 5bd15b7 | 2015-02-03 10:15:04 -0600 | [diff] [blame] | 324 | "old_path new_path moves/rename files within a yaffs mount point"); |