diff --git a/post/src/post.c b/post/src/post.c
index 2902574a9e300f90fe1b792bdcd07d7a0c7b9b53..1044dc9dfe0dc664237d0c554e7196e43504b4ef 100644 (file)
--- a/post/src/post.c
+++ b/post/src/post.c
/******************************************************************************
* Copyright (c) 2011 Texas Instruments Incorporated - http://www.ti.com
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
* are met:
*
- * Redistributions of source code must retain the above copyright
+ * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*****************************************************************************/
#include <string.h>
char post_version[] = POST_VERSION;
/******************************************************************************
- * Function: post_display_led_error
+ * Function: post_display_led_error
******************************************************************************/
-void
+void
post_display_led_error
(
POST_TEST_ID test_id
{
uint8_t led_status[POST_MAX_NUM_LED];
uint32_t i;
-
+
memset(led_status, POST_LED_ON, POST_MAX_NUM_LED);
while (TRUE)
{
}
/******************************************************************************
- * Function: post_write_uart
+ * Function: post_write_uart
******************************************************************************/
-Bool
+Bool
post_write_uart
(
char* msg
}
/******************************************************************************
- * Function: post_display_status
+ * Function: post_display_status
******************************************************************************/
-void
+void
post_display_status
(
POST_TEST_ID test_id,
if (post_write_uart(msg) != TRUE)
{
post_display_led_error(POST_TEST_UART); /* Never return from this function */
- }
+ }
post_display_led_error(test_id); /* Never return from this function */
}
break;
}
/******************************************************************************
- * Function: post_test_external_memory
+ * Function: post_test_external_memory
******************************************************************************/
-Bool
+Bool
post_test_external_memory
(
void
{
Bool test_passed = TRUE;
- if(platform_external_memory_test(0, 0) != Platform_EOK)
+ if(platform_external_memory_test(0, 0) != Platform_EOK)
{
test_passed = FALSE;
}
}
/******************************************************************************
- * Function: post_test_eeprom
+ * Function: post_test_eeprom
******************************************************************************/
-Bool
+Bool
post_test_eeprom
(
void
PLATFORM_DEVICE_info *p_device;
p_device = platform_device_open(POST_EEPROM_TEST_DEVICE_ID, 0);
- if (p_device == NULL)
+ if (p_device == NULL)
{
return FALSE;
}
- if(platform_device_read(p_device->handle,
- POST_EEPROM_TEST_READ_ADDRESS,
- test_buf,
- POST_EEPROM_TEST_READ_LENGTH) != Platform_EOK)
+ if(platform_device_read(p_device->handle,
+ POST_EEPROM_TEST_READ_ADDRESS,
+ test_buf,
+ POST_EEPROM_TEST_READ_LENGTH) != Platform_EOK)
{
test_passed = FALSE;
}
}
/******************************************************************************
- * Function: post_test_nand
+ * Function: post_test_nand
******************************************************************************/
-Bool
+Bool
post_test_nand
(
void
PLATFORM_DEVICE_info *p_device;
p_device = platform_device_open(POST_NAND_TEST_DEVICE_ID, 0);
- if (p_device == NULL)
+ if (p_device == NULL)
{
return FALSE;
}
addr = (POST_NAND_TEST_READ_BLOCK_NUM * p_device->page_count + POST_NAND_TEST_READ_PAGE_NUM) * p_device->page_size;
- if(platform_device_read(p_device->handle,
- addr,
- test_buf,
- POST_NAND_TEST_READ_LENGTH) != Platform_EOK)
+ if(platform_device_read(p_device->handle,
+ addr,
+ test_buf,
+ POST_NAND_TEST_READ_LENGTH) != Platform_EOK)
{
test_passed = FALSE;
}
}
/******************************************************************************
- * Function: post_test_nor
+ * Function: post_test_nor
******************************************************************************/
-Bool
+Bool
post_test_nor
(
void
PLATFORM_DEVICE_info *p_device;
p_device = platform_device_open(POST_NOR_TEST_DEVICE_ID, 0);
- if (p_device == NULL)
+ if (p_device == NULL)
{
return FALSE;
}
- if(platform_device_read(p_device->handle,
- POST_NOR_TEST_READ_ADDR,
- test_buf,
- POST_NOR_TEST_READ_LENGTH) != Platform_EOK)
+ if(platform_device_read(p_device->handle,
+ POST_NOR_TEST_READ_ADDR,
+ test_buf,
+ POST_NOR_TEST_READ_LENGTH) != Platform_EOK)
{
test_passed = FALSE;
}
}
/******************************************************************************
- * Function: post_write_serial_no
+ * Function: post_write_serial_no
******************************************************************************/
-void
+void
post_write_serial_no
(
void
uint32_t i, j;
uint8_t msg[20], msg2[2];
PLATFORM_DEVICE_info *p_device;
-
+
/* Check if user key in the passcode "ti" to enter board serial number */
- if (platform_uart_read(msg, POST_UART_READ_TIMEOUT) != Platform_EOK)
+ if (platform_uart_read(msg, POST_UART_READ_TIMEOUT) != Platform_EOK)
{
return;
}
return;
}
- if (platform_uart_read(msg, POST_UART_READ_TIMEOUT) != Platform_EOK)
+ if (platform_uart_read(msg, POST_UART_READ_TIMEOUT) != Platform_EOK)
{
return;
}
/* Passcode verified, prompt the user to enter serial number */
p_device = platform_device_open(PLATFORM_DEVID_EEPROM50, 0);
- if (p_device == NULL)
+ if (p_device == NULL)
{
return;
}
msg[j] = 0xff;
}
}
-
+
if(platform_device_write(p_device->handle, POST_SERIAL_NUM_ADDR, msg, 16) == Platform_EOK)
{
post_write_uart("\r\n\r\nSerial number programmed to EEPROM successfully! ");
/******************************************************************************
* Function: main function for POST
******************************************************************************/
-void
+void
main
(
void
post_write_uart(msg);
}
- sa_enable = *(volatile uint32_t *)0x20c0000;
+ sa_enable = *(volatile uint32_t *)0x20c0004;
sa_enable &= 0x1;
if (sa_enable)