summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorJustin Waters <justin.waters@timesys.com>2013-07-19 13:34:06 -0400
committerJustin Waters <justin.waters@timesys.com>2013-07-19 13:34:06 -0400
commit48eddab640b4afb9d266b29ce5bb9472b0650620 (patch)
tree1cfd61c2333a5d69df437d1a8bf6939c314e5ccc /board
parente905badacaff9b85d8bb4f0933d1246625293572 (diff)
LogicPD Support for OMAP3/DM3/AM3 boards 2.4 Update Release 22011.06-omap3logic-ts4
Diffstat (limited to 'board')
-rw-r--r--board/ti/logic/logic-data.c19
-rw-r--r--board/ti/logic/logic-display.c4
-rw-r--r--board/ti/logic/logic-product-id.c18
-rw-r--r--board/ti/logic/logic.c3
-rw-r--r--board/ti/logic/prod-id/query.c10
-rw-r--r--board/ti/logic/prod-id/startup.c7
6 files changed, 46 insertions, 15 deletions
diff --git a/board/ti/logic/logic-data.c b/board/ti/logic/logic-data.c
index dfcfb61cba7..9149de6fd60 100644
--- a/board/ti/logic/logic-data.c
+++ b/board/ti/logic/logic-data.c
@@ -499,41 +499,37 @@ int _fetch_production_data(void)
gpio_i2c_set_pin_level(GPIO_I2C_SCLK, 1);
}
- printf("Read production data: ");
-
if (identify_device()) {
- printf("failed to identify device!\n");
+ printf("failed to identify ID device!\n");
err = -1;
goto out;
}
if (read_user_zone(0, 0, (unsigned char *)&product_id_data.d.u_zone0, sizeof(product_id_data.d.u_zone0))) {
- printf("failed!\n");
+ printf("failed to read ID device!\n");
err = -1;
goto out;
}
/* If the header doesn't match, we can't map any of the data */
if (extract_header_version(&product_id_data, &header_version)) {
- printf("failed - invalid header version %d!\n", header_version);
+ printf("ID device read failed - invalid header version %d!\n", header_version);
err = -2;
goto out;
}
if (read_user_zone(0, 32, (unsigned char *)&product_id_data.d.zone1, sizeof(product_id_data.d.zone1))) {
- printf("failed reading zone1 data!\n");
+ printf("failed reading ID device zone1 data!\n");
err = -3;
goto out;
}
if (read_user_zone(0, 64, (unsigned char *)&product_id_data.d.zone2, sizeof(product_id_data.d.zone2))) {
- printf("failed reading zone2 data!\n");
+ printf("failed reading ID device zone2 data!\n");
err = -4;
goto out;
}
- printf("done\n");
-
production_data_valid = 1;
/* Correct endianess issues */
product_id_data.d.zone2.pz_2r0.processor_type = le16_to_cpu(product_id_data.d.zone2.pz_2r0.processor_type);
@@ -547,7 +543,7 @@ int _fetch_production_data(void)
reading it if we know it can't fit in the productID chip */
if (2 + sizeof(product_id_data.d.wifi_config_data.data) / devptr->zonesize < devptr->zones) {
if (read_user_zone(2, 0, (unsigned char *)&product_id_data.d.wifi_config_data.data, sizeof(product_id_data.d.wifi_config_data.data))) {
- printf("failed reading wifi_config data!\n");
+ printf("failed reading wifi_config data from ID device!\n");
} else
product_id_data.d.wifi_config_data.valid = 1;
}
@@ -583,6 +579,8 @@ void _dump_production_data(void)
if (!production_data_valid)
return;
+ printf("\nID data ROM : Gen 1\n");
+
/* Print out the name, model number, and set MAC addresses */
extract_product_id_part_number(&product_id_data, buf, sizeof(buf));
printf("Part Number : %s\n", buf);
@@ -609,6 +607,7 @@ void _dump_production_data(void)
printf("LAN[%d] = %02x:%02x:%02x:%02x:%02x:%02x\n",
i, mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
}
+ printf("\n");
}
#ifdef CONFIG_OMAP3_LOGIC_USE_NEW_PRODUCT_ID
diff --git a/board/ti/logic/logic-display.c b/board/ti/logic/logic-display.c
index 8f684aae69f..875b7e80873 100644
--- a/board/ti/logic/logic-display.c
+++ b/board/ti/logic/logic-display.c
@@ -30,6 +30,8 @@
#include "splash-332x57.h"
#include "logic-proto.h"
+#ifdef CONFIG_LCD
+
DECLARE_GLOBAL_DATA_PTR;
/* LCD-required members */
@@ -932,3 +934,5 @@ U_BOOT_CMD(dump_video, 1, 1, do_info_video,
" - Displays information on video parameters",
""
);
+
+#endif // #ifdef CONFIG_LCD \ No newline at end of file
diff --git a/board/ti/logic/logic-product-id.c b/board/ti/logic/logic-product-id.c
index dba8c197ee6..8c84a8741dd 100644
--- a/board/ti/logic/logic-product-id.c
+++ b/board/ti/logic/logic-product-id.c
@@ -188,7 +188,7 @@ int logic_dump_serialization_info(void)
{
int ret;
struct id_cookie cookie;
- int part_number, speed, model_number;
+ int part_number, speed, model_number, version_code;
u8 model_name[33];
u8 model_type[11];
u8 model_grade[11];
@@ -248,6 +248,19 @@ int logic_dump_serialization_info(void)
return ret;
}
+ /* Find version code */
+ ret = id_find_number(&cookie, ID_KEY_version_code, &version_code);
+//printf("%s[%u] cookie.mem_ptr: 0x%08x, cookie.offset: %u, val: %02x %02x %02x %02x\n", __FILE__, __LINE__, cookie.mem_ptr, cookie.offset,
+// *(unsigned char*)((unsigned int)cookie.mem_ptr + cookie.offset + 0),
+// *(unsigned char*)((unsigned int)cookie.mem_ptr + cookie.offset + 1),
+// *(unsigned char*)((unsigned int)cookie.mem_ptr + cookie.offset + 2),
+// *(unsigned char*)((unsigned int)cookie.mem_ptr + cookie.offset + 3)
+// );
+ if (ret != ID_EOK) {
+ printf("%s:%d ret %d\n", __FUNCTION__, __LINE__, ret);
+ return ret;
+ }
+
/* Find model name */
model_name_size = sizeof(model_name) - 1;
ret = id_find_string(&cookie, ID_KEY_model_name, model_name, &model_name_size);
@@ -321,6 +334,7 @@ int logic_dump_serialization_info(void)
hardware_platform[model_hardware_platform_size] = '\0';
serial_number[serial_number_size] = '\0';
+ printf("\nID data ROM : Gen 2\n");
printf("Model : %.*s%u ", model_type_size, model_type, model_number);
if (!strncmp(hardware_platform, "t", 2))
printf("Torpedo");
@@ -329,6 +343,7 @@ int logic_dump_serialization_info(void)
else if (!strncmp(hardware_platform, "m2", 2))
printf("SOM-M2");
printf("\n");
+ printf("Version Code : -%u\n", version_code);
printf("Temp Grade : ");
if (!strncmp(model_grade, "i", 1))
printf("Industrial");
@@ -341,6 +356,7 @@ int logic_dump_serialization_info(void)
printf("Part Number : %u\n", part_number);
printf("Model Name : %.*s\n", model_name_size, model_name);
printf("Serial Number: %.*s\n", serial_number_size, serial_number);
+ printf("\n");
return 0;
}
diff --git a/board/ti/logic/logic.c b/board/ti/logic/logic.c
index d3bff273aa3..84a04de04c1 100644
--- a/board/ti/logic/logic.c
+++ b/board/ti/logic/logic.c
@@ -257,8 +257,9 @@ void touchup_env(int initial_env)
setenv("defaultecc", "soft");
/* touchup the display environment variable(s) */
+#ifdef CONFIG_LCD
touchup_display_env();
-
+#endif
if (initial_env) {
/* Need to set mdtids/mtdparts to computed defaults */
setenv("mtdparts", get_mtdparts_default());
diff --git a/board/ti/logic/prod-id/query.c b/board/ti/logic/prod-id/query.c
index 69a2e2b3ca2..031d7b98321 100644
--- a/board/ti/logic/prod-id/query.c
+++ b/board/ti/logic/prod-id/query.c
@@ -2,6 +2,9 @@
#include "internals.h"
#include "id-errno.h"
+// This is only for debugging purposes. Set to zero to deactivate.
+#define SPOOF_VERSION_CODE 0
+
static int id_extract_key(struct id_cookie *cookie, id_keys_t *key)
{
int err;
@@ -156,6 +159,13 @@ int id_find_number(struct id_cookie *cookie, id_keys_t key, int *num)
if (err != ID_EOK)
return err;
/* Extract the number size */
+#if SPOOF_VERSION_CODE
+ if ((cookie->offset == 509) && (key == ID_KEY_version_code))
+ {
+ *num = SPOOF_VERSION_CODE;
+ return ID_EOK;
+ }
+#endif
l_num = extract_unsigned_pnum(&d_cookie, 5, &err);
if (err != ID_EOK)
return err;
diff --git a/board/ti/logic/prod-id/startup.c b/board/ti/logic/prod-id/startup.c
index d87836ccd13..56b30e8ea9e 100644
--- a/board/ti/logic/prod-id/startup.c
+++ b/board/ti/logic/prod-id/startup.c
@@ -201,7 +201,7 @@ int id_startup(struct id_data *data, int (*setup_id_chip)(void), int (*shutdown_
ret = _id_startup(data, 1);
data->mem_ptr = mem_ptr;
if (!ret) {
- id_printf("Found new Product ID data at %p\n", mem_ptr);
+ printf("Product ID data cached to: %p\n", mem_ptr);
return ret;
}
}
@@ -212,9 +212,10 @@ int id_startup(struct id_data *data, int (*setup_id_chip)(void), int (*shutdown_
id_error("%s: setup_id_chip failed!", __FUNCTION__);
return ret;
}
- ret = _id_startup(data, 0);
if (!ret)
- id_printf("Cache new Product ID data from AT24 to %p\n", mem_ptr);
+ printf("Product ID data cached to: %p\n", mem_ptr);
+
+ ret = _id_startup(data, 0);
ret2 = (*shutdown_id_chip)();
if (ret2)
id_error("%s: shutdown_id_chip failed!", __FUNCTION__);