Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Subject: htcleo: wifi: Load the real MAC address from SPL if running SD build on WM.
- Thank for Savan's help.
- Refer to https://gitorious.org/2-6-32-photon/testing/commit/3c64a1c16fd17ba892e76170cd54b9719dd72c37
- ---
- arch/arm/mach-msm/board-htcleo-wifi-nvs.c | 23 ++++++++++++++++++++++-
- arch/arm/mach-msm/include/mach/msm_iomap-8x50.h | 11 ++++++++---
- arch/arm/mach-msm/io.c | 6 +++---
- 3 files changed, 33 insertions(+), 7 deletions(-)
- diff --git a/arch/arm/mach-msm/board-htcleo-wifi-nvs.c b/arch/arm/mach-msm/board-htcleo-wifi-nvs.c
- index ee9ad39..7865b6d 100644
- --- a/arch/arm/mach-msm/board-htcleo-wifi-nvs.c
- +++ b/arch/arm/mach-msm/board-htcleo-wifi-nvs.c
- @@ -28,6 +28,8 @@
- #include <linux/crc32.h>
- #include <linux/io.h>
- +#include "board-htcleo.h"
- +
- #define NVS_MAX_SIZE 0x800U
- #define NVS_MACADDR_SIZE 0x1AU
- #define WLAN_SKB_BUF_NUM 16
- @@ -131,6 +133,21 @@ static int parse_tag_msm_wifi(void)
- return 0;
- }
- +static int parse_tag_msm_wifi_from_spl(void)
- +{
- + uint32_t id1, id2, id3, id4, id5, id6;
- + uint32_t id_base = 0xFC028; //real mac offset found in spl for haret.exe on WM
- + id1 = readl(MSM_SPLHOOD_BASE + id_base + 0x0);
- + id2 = readl(MSM_SPLHOOD_BASE + id_base + 0x1);
- + id3 = readl(MSM_SPLHOOD_BASE + id_base + 0x2);
- + id4 = readl(MSM_SPLHOOD_BASE + id_base + 0x3);
- + id5 = readl(MSM_SPLHOOD_BASE + id_base + 0x4);
- + id6 = readl(MSM_SPLHOOD_BASE + id_base + 0x5);
- + sprintf(nvs_mac_addr, "macaddr=%2x:%2x:%2x:%2x:%2x:%2x\n", id1 & 0xff, id2 & 0xff, id3 & 0xff, id4 & 0xff, id5 & 0xff, id6 & 0xff);
- + pr_info("Device Real Wifi Mac Address: %s\n", nvs_mac_addr);
- + return 0;
- +}
- +
- static unsigned wifi_get_nvs_size( void )
- {
- unsigned len;
- @@ -171,7 +188,11 @@ static int wifi_calibration_read_proc(char *page, char **start, off_t off,
- static int __init wifi_nvs_init(void)
- {
- pr_info("%s\n", __func__);
- - parse_tag_msm_wifi();
- + if (htcleo_is_nand_boot()) {
- + parse_tag_msm_wifi();
- + } else {
- + parse_tag_msm_wifi_from_spl();
- + }
- wifi_calibration = create_proc_entry("calibration", 0444, NULL);
- if (wifi_calibration != NULL) {
- wifi_calibration->size = wifi_get_nvs_size();
- diff --git a/arch/arm/mach-msm/include/mach/msm_iomap-8x50.h b/arch/arm/mach-msm/include/mach/msm_iomap-8x50.h
- index 32289fd..1a50517 100644
- --- a/arch/arm/mach-msm/include/mach/msm_iomap-8x50.h
- +++ b/arch/arm/mach-msm/include/mach/msm_iomap-8x50.h
- @@ -159,9 +159,9 @@
- #define MSM_SPI_PHYS 0xA1200000
- #define MSM_SPI_SIZE SZ_4K
- -#define MSM_TCSR_BASE IOMEM(0xF8008000)
- -#define MSM_TCSR_PHYS 0xA8700000
- -#define MSM_TCSR_SIZE SZ_4K
- +#define MSM_TCSR_BASE IOMEM(0xF8008000)
- +#define MSM_TCSR_PHYS 0xA8700000
- +#define MSM_TCSR_SIZE SZ_4K
- #endif
- // Originally this does not need to be defined,
- @@ -177,3 +177,8 @@
- #endif
- #define MSM_RAM_CONSOLE_SIZE 0x00040000
- +// For reading the real WiFi MAC address
- +#define MSM_SPLHOOD_BASE IOMEM(0xF9200000)
- +#define MSM_SPLHOOD_PHYS 0x0
- +#define MSM_SPLHOOD_SIZE SZ_1M
- +
- diff --git a/arch/arm/mach-msm/io.c b/arch/arm/mach-msm/io.c
- index c032741..e4b89c5 100644
- --- a/arch/arm/mach-msm/io.c
- +++ b/arch/arm/mach-msm/io.c
- @@ -90,9 +90,9 @@ static struct map_desc msm_io_desc[] __initdata = {
- },
- #endif
- {
- - .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
- - .pfn = __phys_to_pfn(MSM_SHARED_RAM_PHYS),
- - .length = MSM_SHARED_RAM_SIZE,
- + .virtual = (unsigned long) MSM_SPLHOOD_BASE,
- + .pfn = __phys_to_pfn(MSM_SPLHOOD_PHYS),
- + .length = MSM_SPLHOOD_SIZE,
- .type = MT_DEVICE,
- },
- MSM_DEVICE(SDC2),
- --
- 1.7.4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement