lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | #include <common.h>
|
| 2 | #include <command.h>
|
| 3 | #include <net.h>
|
| 4 | #include <jffs2/load_kernel.h>
|
| 5 | #include <common.h>
|
| 6 | #include <asm/arch/hardware.h>
|
| 7 | #include <asm/arch/uart.h>
|
| 8 | #include <asm/arch/lsp_crpm.h>
|
| 9 | #include "errno.h"
|
| 10 |
|
| 11 | //#if CONFIG_HARDWARE_TEST
|
| 12 | #if 0
|
| 13 | void gpio_led_on(gpio_pin_t pin, gpio_sel_t val) |
| 14 | { |
| 15 | gpio_sel_t value = gpio_get_reuse(pin); /*for restore*/
|
| 16 | gpio_set_reuse(pin,val); /* gpio function*/
|
| 17 | gpio_direction_output(pin,1); /*out high*/
|
| 18 | udelay(1000000);
|
| 19 | gpio_direction_output(pin,0); /*out low*/
|
| 20 | gpio_direction_input(pin); |
| 21 | gpio_set_reuse(pin,value); /*restore*/
|
| 22 | }
|
| 23 |
|
| 24 | void gpio_leds_on(void) |
| 25 | { |
| 26 | gpio_led_on(GPIO9,1); /*gpio9 default function is i2c sda1*/
|
| 27 | gpio_led_on(GPIO11,0);
|
| 28 | gpio_led_on(GPIO12,0);
|
| 29 | // gpio_led_on(GPIO13,0);
|
| 30 | // gpio_led_on(GPIO16,0);
|
| 31 | gpio_led_on(GPIO17,0);
|
| 32 | }
|
| 33 |
|
| 34 |
|
| 35 | int do_test_gpio(void)
|
| 36 | {
|
| 37 | uint8_t i = 10;
|
| 38 | while( i-- )
|
| 39 | {
|
| 40 | gpio_leds_on();
|
| 41 | }
|
| 42 | return 0;
|
| 43 | }
|
| 44 |
|
| 45 | U_BOOT_CMD(
|
| 46 | test_gpio, CONFIG_SYS_MAXARGS, 0, do_test_gpio,
|
| 47 | "test_gpio: test_gpio ",
|
| 48 | ""
|
| 49 | );
|
| 50 |
|
| 51 | #endif
|