diff options
author | Justin Waters <justin.waters@timesys.com> | 2013-04-24 17:43:23 -0400 |
---|---|---|
committer | Justin Waters <justin.waters@timesys.com> | 2013-04-24 17:43:23 -0400 |
commit | 15473818068d8de6672d6a83a6888ed40b1f9811 (patch) | |
tree | c3f0db00b4b2f3d0a7fcd26c3b90599523440f57 /board | |
parent | 18282017b14c0b32b4aa6fd05df58ba5cff0b472 (diff) |
LogicPD Support for OMAP3/DM3/AM3 boards 2.3 Update
Diffstat (limited to 'board')
-rw-r--r-- | board/ti/logic/config.mk | 1 | ||||
-rw-r--r-- | board/ti/logic/logic-product-id.c | 90 | ||||
-rw-r--r-- | board/ti/logic/logic.c | 30 |
3 files changed, 112 insertions, 9 deletions
diff --git a/board/ti/logic/config.mk b/board/ti/logic/config.mk index 897b252b07d..cf78f30272d 100644 --- a/board/ti/logic/config.mk +++ b/board/ti/logic/config.mk @@ -30,4 +30,5 @@ # (mem base + reserved) # For use with external or internal boots. + CONFIG_SYS_TEXT_BASE = 0x80400000 diff --git a/board/ti/logic/logic-product-id.c b/board/ti/logic/logic-product-id.c index edc440945f2..dba8c197ee6 100644 --- a/board/ti/logic/logic-product-id.c +++ b/board/ti/logic/logic-product-id.c @@ -188,18 +188,26 @@ int logic_dump_serialization_info(void) { int ret; struct id_cookie cookie; - int part_number; + int part_number, speed, model_number; u8 model_name[33]; + u8 model_type[11]; + u8 model_grade[11]; + u8 hardware_platform[11]; u32 model_name_size; + u32 model_type_size; + u32 model_grade_size; u8 serial_number[11]; u32 serial_number_size; + u32 model_hardware_platform_size; if (!found_id_data) { + printf("No ID data found\n"); return -1; } ret = id_init_cookie(&id_data, &cookie); if (ret != ID_EOK) { + printf("Cannot initialize the ID data\n"); printf("%s:%d ret %d\n", __FUNCTION__, __LINE__, ret); return ret; } @@ -248,12 +256,92 @@ int logic_dump_serialization_info(void) return ret; } + /* Find platform */ + model_hardware_platform_size = sizeof(hardware_platform) - 1; + ret = id_find_string(&cookie, ID_KEY_hardware_platform, hardware_platform, &model_hardware_platform_size); + if (ret != ID_EOK) { + printf("%s:%d ret %d\n", __FUNCTION__, __LINE__, ret); + return ret; + } + + /* Reinitialise cookie back to the root */ + ret = id_init_cookie(&id_data, &cookie); + if (ret != ID_EOK) { + printf("%s:%d ret %d\n", __FUNCTION__, __LINE__, ret); + return ret; + } + + /* find /cpu0_group from root */ + ret = id_find_dict(&cookie, ID_KEY_cpu0_group, IDENUM_DICT); + if (ret != ID_EOK) { + printf("%s:%d ret %d\n", __FUNCTION__, __LINE__, ret); + return ret; + } + + /* Find type */ + model_type_size = sizeof(model_type) - 1; + ret = id_find_string(&cookie, ID_KEY_type, model_type, &model_type_size); + if (ret != ID_EOK) { + printf("%s:%d ret %d\n", __FUNCTION__, __LINE__, ret); + return ret; + } + + /* Find number */ + ret = id_find_number(&cookie, ID_KEY_number, &model_number); + if (ret != ID_EOK) { + printf("%s:%d ret %d\n", __FUNCTION__, __LINE__, ret); + return ret; + } + + /* Find speed_mhz */ + ret = id_find_number(&cookie, ID_KEY_speed_mhz, &speed); + if (ret != ID_EOK) { + printf("%s:%d ret %d\n", __FUNCTION__, __LINE__, ret); + return ret; + } + + /* Find grade */ + model_grade_size = sizeof(model_grade) - 1; + ret = id_find_string(&cookie, ID_KEY_temp_class, model_grade, &model_grade_size); + if (ret != ID_EOK) { + printf("%s:%d ret %d\n", __FUNCTION__, __LINE__, ret); + return ret; + } + + /* Reinitialise cookie back to the root */ + ret = id_init_cookie(&id_data, &cookie); + if (ret != ID_EOK) { + printf("%s:%d ret %d\n", __FUNCTION__, __LINE__, ret); + return ret; + } + model_name[model_name_size] = '\0'; + model_type[model_type_size] = '\0'; + model_grade[model_grade_size] = '\0'; + hardware_platform[model_hardware_platform_size] = '\0'; serial_number[serial_number_size] = '\0'; + printf("Model : %.*s%u ", model_type_size, model_type, model_number); + if (!strncmp(hardware_platform, "t", 2)) + printf("Torpedo"); + else if (!strncmp(hardware_platform, "lv", 2)) + printf("SOM-LV"); + else if (!strncmp(hardware_platform, "m2", 2)) + printf("SOM-M2"); + printf("\n"); + printf("Temp Grade : "); + if (!strncmp(model_grade, "i", 1)) + printf("Industrial"); + else if (!strncmp(model_grade, "c", 1)) + printf("Commercial"); + else if (!strncmp(model_grade, "x", 1)) + printf("Extended"); + printf("\n"); + printf("Max Speed : %uMHz\n", speed); 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); + return 0; } diff --git a/board/ti/logic/logic.c b/board/ti/logic/logic.c index 82ee77ce15c..911d2d8d9a4 100644 --- a/board/ti/logic/logic.c +++ b/board/ti/logic/logic.c @@ -43,6 +43,7 @@ #include "logic.h" #include "product_id.h" #include "logic-proto.h" +#include <ecc-method_autogenerated.h> DECLARE_GLOBAL_DATA_PTR; @@ -67,6 +68,7 @@ unsigned int logic_identify(void) MUX_LOGIC_HSUSB0_D5_GPIO_MUX(); if (!omap_request_gpio(189)) { + twl4030_usb_ulpi_init(); omap_set_gpio_direction(189, 0); omap_set_gpio_dataout(189, 1); @@ -109,12 +111,22 @@ unsigned int logic_identify(void) /* * Set the default NAND ECC method used for the environment */ -static int omap3logic_nand_default = -1; +static enum omap_nand_ecc_mode omap3logic_nand_default; void nand_setup_default_ecc_method(void) { - if (omap_nand_chip_has_ecc()) + omap3logic_nand_default = OMAP_ECC_NONE; + +#ifdef SYSCFG_NAND_ECC_SOFT_BCH + omap3logic_nand_default = OMAP_ECC_SOFT_BCH; +#endif + if (omap_nand_chip_has_ecc()) { +#ifdef SYSCFG_NAND_ECC_IN_CHIP omap3logic_nand_default = OMAP_ECC_CHIP; - else +#endif + } + + /* If no ECC then default to HW as the default */ + if (omap3logic_nand_default == OMAP_ECC_NONE) omap3logic_nand_default = OMAP_ECC_HW; omap_nand_switch_ecc(omap3logic_nand_default); @@ -240,8 +252,10 @@ void touchup_env(int initial_env) setenv("defaultecc", "chip"); else if (omap3logic_nand_default == OMAP_ECC_HW) setenv("defaultecc", "hw"); + else if (omap3logic_nand_default == OMAP_ECC_SOFT_BCH) + setenv("defaultecc", "bch"); else - printf("%s: bad NAND ECC default %d!\n", __FUNCTION__, omap3logic_nand_default); + setenv("defaultecc", "soft"); /* touchup the display environment variable(s) */ touchup_display_env(); @@ -490,10 +504,10 @@ static void setup_net_chip(void) * not sure if optimal */ #define LOGIC_NAND_GPMC_CONFIG1 0x00001800 #define LOGIC_NAND_GPMC_CONFIG2 0x00090900 -#define LOGIC_NAND_GPMC_CONFIG3 0x00090902 -#define LOGIC_NAND_GPMC_CONFIG4 0x07020702 -#define LOGIC_NAND_GPMC_CONFIG5 0x0008080A -#define LOGIC_NAND_GPMC_CONFIG6 0x000002CF +#define LOGIC_NAND_GPMC_CONFIG3 0x00090900 +#define LOGIC_NAND_GPMC_CONFIG4 0x06000700 +#define LOGIC_NAND_GPMC_CONFIG5 0x00070C0C +#define LOGIC_NAND_GPMC_CONFIG6 0x00000FCF #define LOGIC_NAND_GPMC_CONFIG7 0x00000C70 #endif |