diff --git a/arch/arm/mach-msm/board-htcleo-wifi-nvs.c b/arch/arm/mach-msm/board-htcleo-wifi-nvs.c index c92b8d75059a..ee9ad39c551d 100644 --- a/arch/arm/mach-msm/board-htcleo-wifi-nvs.c +++ b/arch/arm/mach-msm/board-htcleo-wifi-nvs.c @@ -126,7 +126,7 @@ static int parse_tag_msm_wifi(void) sid1 = crc32(~0, &id1, 4); sid2 = crc32(~0, &id2, 4); sid3 = crc32(~0, &id3, 4); - sprintf(nvs_mac_addr, "macaddr=00:90:4c:%2x:%2x:%2x\n", sid1 % 0xff, sid2 % 0xff, sid3 % 0xff); + sprintf(nvs_mac_addr, "macaddr=00:23:76:%2x:%2x:%2x\n", sid1 % 0xff, sid2 % 0xff, sid3 % 0xff); pr_info("Device Wifi Mac Address: %s\n", nvs_mac_addr); return 0; } diff --git a/arch/arm/mach-msm/board-htcleo.c b/arch/arm/mach-msm/board-htcleo.c index 1cea4e328734..3a3bf0f48f2d 100644 --- a/arch/arm/mach-msm/board-htcleo.c +++ b/arch/arm/mach-msm/board-htcleo.c @@ -15,6 +15,7 @@ * */ +#include #include #include #include @@ -900,30 +901,27 @@ struct platform_device bcm_bt_lpm_device = { }; -#define ATAG_BDADDR 0x43294329 /* htcleo bluetooth address tag */ -#define ATAG_BDADDR_SIZE 4 #define BDADDR_STR_SIZE 18 - static char bdaddr[BDADDR_STR_SIZE]; module_param_string(bdaddr, bdaddr, sizeof(bdaddr), 0400); MODULE_PARM_DESC(bdaddr, "bluetooth address"); -static int __init parse_tag_bdaddr(const struct tag *tag) +static int parse_tag_bdaddr(void) { - unsigned char *b = (unsigned char *)&tag->u; - - if (tag->hdr.size != ATAG_BDADDR_SIZE) - return -EINVAL; - - snprintf(bdaddr, BDADDR_STR_SIZE, "%02X:%02X:%02X:%02X:%02X:%02X", - b[0], b[1], b[2], b[3], b[4], b[5]); - + uint32_t id1, id2, id3, sid1, sid2, sid3; + uint32_t id_base = 0xef260; + id1 = readl(MSM_SHARED_RAM_BASE + id_base + 0x0); + id2 = readl(MSM_SHARED_RAM_BASE + id_base + 0x4); + id3 = readl(MSM_SHARED_RAM_BASE + id_base + 0x8); + sid1 = crc32(~0, &id1, 4); + sid2 = crc32(~0, &id2, 4); + sid3 = crc32(~0, &id3, 4); + sprintf(bdaddr, "00:23:76:%2X:%2X:%2X", sid3 % 0xff, sid2 % 0xff, sid1 % 0xff); + pr_info("Device Bluetooth Mac Address: %s\n", bdaddr); return 0; } -__tagtable(ATAG_BDADDR, parse_tag_bdaddr); - static int __init board_serialno_setup(char *serialno) { #ifdef CONFIG_USB_ANDROID_RNDIS @@ -1490,6 +1488,8 @@ static void __init htcleo_init(void) config_gpio_table(bt_gpio_table, ARRAY_SIZE(bt_gpio_table)); + parse_tag_bdaddr(); + bt_export_bd_address(); htcleo_audio_init();