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 | #include <config.h>
|
| 11 | #include <drvs_gpio.h>
|
| 12 |
|
| 13 |
|
| 14 | #if CONFIG_HARDWARE_TEST
|
| 15 | /*******************************************************************************
|
| 16 | * Function: hardware_test
|
| 17 | * Description: ÓÃÓÚÓ²¼þ²âÊÔ
|
| 18 | * Parameters:
|
| 19 | * Input:
|
| 20 | *
|
| 21 | * Output:
|
| 22 | *
|
| 23 | * Returns:
|
| 24 | *
|
| 25 | *
|
| 26 | * Others:
|
| 27 | ********************************************************************************/
|
| 28 | void hardware_test(void)
|
| 29 | {
|
| 30 | //test DDR and NAND
|
| 31 |
|
| 32 | zDrvGpio_SetFunc(GPIO32,GPIO32_GPIO32);
|
| 33 | zDrvGpio_SetFunc(GPIO33,GPIO33_GPIO33);
|
| 34 | zDrvGpio_SetFunc(GPIO70,GPIO70_GPIO70);
|
| 35 | zDrvGpio_SetFunc(GPIO75,GPIO75_GPIO75);
|
| 36 |
|
| 37 | zDrvGpio_SetDirection(GPIO32,GPIO_OUT);
|
| 38 | zDrvGpio_SetDirection(GPIO33,GPIO_OUT);
|
| 39 | zDrvGpio_SetDirection(GPIO70,GPIO_OUT);
|
| 40 | zDrvGpio_SetDirection(GPIO75,GPIO_OUT);
|
| 41 |
|
| 42 | zDrvGpio_SetOutputValue(GPIO32, GPIO_LOW);
|
| 43 | zDrvGpio_SetOutputValue(GPIO33, GPIO_LOW);
|
| 44 |
|
| 45 | zDrvGpio_SetOutputValue(GPIO70, GPIO_HIGH);
|
| 46 | zDrvGpio_SetOutputValue(GPIO75, GPIO_HIGH);
|
| 47 | udelay(100000);
|
| 48 | zDrvGpio_SetOutputValue(GPIO70, GPIO_LOW);
|
| 49 | zDrvGpio_SetOutputValue(GPIO75, GPIO_LOW);
|
| 50 |
|
| 51 | while(1)
|
| 52 | {
|
| 53 | run_command("test_ddr", 0);
|
| 54 | run_command("test_nand", 0);
|
| 55 | }
|
| 56 | }
|
| 57 |
|
| 58 | #endif
|
| 59 |
|