Peter Meerwald | 9e9f4a4 | 2010-09-20 14:08:57 -0400 | [diff] [blame] | 1 | /* |
| 2 | * cled.c - control color led |
| 3 | * |
| 4 | * Copyright (c) 2010 BCT Electronic GmbH |
| 5 | * |
| 6 | * Licensed under the GPL-2 or later. |
| 7 | */ |
| 8 | |
| 9 | #include <common.h> |
| 10 | #include <command.h> |
| 11 | #include <asm/blackfin.h> |
| 12 | #include <asm/io.h> |
| 13 | |
| 14 | int do_cled(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
| 15 | { |
Wolfgang Denk | 1136f69 | 2010-10-27 22:48:30 +0200 | [diff] [blame] | 16 | ulong addr = 0x20000000 + 0x200000; /* AMS2 */ |
Peter Meerwald | 9e9f4a4 | 2010-09-20 14:08:57 -0400 | [diff] [blame] | 17 | uchar data; |
| 18 | |
| 19 | if (argc < 2) |
| 20 | return cmd_usage(cmdtp); |
| 21 | |
| 22 | data = simple_strtoul(argv[1], NULL, 10); |
| 23 | outb(data, addr); |
| 24 | |
| 25 | printf("cled, write %02x\n", data); |
| 26 | |
| 27 | return 0; |
| 28 | } |
| 29 | |
| 30 | U_BOOT_CMD(cled, 2, 0, do_cled, |
| 31 | "set/clear color LED", |
| 32 | ""); |