diff options
author | Dhivya Subramanian <dthiru@codeaurora.org> | 2012-11-26 13:43:09 -0800 |
---|---|---|
committer | Dhivya Subramanian <dthiru@codeaurora.org> | 2012-11-26 13:43:09 -0800 |
commit | 0067b77b520567e648efcaa94fe93b5a93e871ce (patch) | |
tree | 5076bc3926630559622b1183e0b5653c0c942fcf | |
parent | ded979acf47adf7ba60b4a4042c3483dafa790b3 (diff) | |
parent | d59986b711341cd00b30a5ec774d662498a83cb9 (diff) |
Merge commit 'AU_LINUX_ANDROID_JB_2.2_RB2_3.04.01.02.37.002' into HEAD
Conflicts:
arch/arm/mach-msm/acpuclock-8064.c
arch/arm/mach-msm/acpuclock-8960ab.c
Change-Id: I3e651de1aed39569210598a26a95c1380f76938d
Signed-off-by: Dhivya Subramanian <dthiru@codeaurora.org>
27 files changed, 386 insertions, 169 deletions
diff --git a/arch/arm/mach-msm/acpuclock-8064.c b/arch/arm/mach-msm/acpuclock-8064.c index 090b65645059..cda952f1b64e 100644 --- a/arch/arm/mach-msm/acpuclock-8064.c +++ b/arch/arm/mach-msm/acpuclock-8064.c @@ -115,7 +115,7 @@ static struct msm_bus_scale_pdata bus_scale_data __initdata = { .name = "acpuclk-8064", }; -static struct l2_level l2_freq_tbl[] __initdata __initdata = { +static struct l2_level l2_freq_tbl[] __initdata = { [0] = { { 384000, PLL_8, 0, 0x00 }, 950000, 1050000, 1 }, [1] = { { 432000, HFPLL, 2, 0x20 }, 1050000, 1050000, 2 }, [2] = { { 486000, HFPLL, 2, 0x24 }, 1050000, 1050000, 2 }, @@ -132,8 +132,6 @@ static struct l2_level l2_freq_tbl[] __initdata __initdata = { [13] = { { 1080000, HFPLL, 1, 0x28 }, 1150000, 1150000, 5 }, [14] = { { 1134000, HFPLL, 1, 0x2A }, 1150000, 1150000, 5 }, [15] = { { 1188000, HFPLL, 1, 0x2C }, 1150000, 1150000, 5 }, - /* L2 Level 16 is for 8064ab only */ - [16] = { { 1242000, HFPLL, 1, 0x2E }, 1150000, 1150000, 5 }, { } }; @@ -215,27 +213,17 @@ static struct acpu_level tbl_fast[] __initdata = { { 0, { 0 } } }; -static struct acpu_level tbl_slow_1p7[] __initdata = { +static struct acpu_level tbl_PVS0_1700MHz[] __initdata = { { 1, { 384000, PLL_8, 0, 0x00 }, L2(0), 950000 }, - { 0, { 432000, HFPLL, 2, 0x20 }, L2(6), 975000 }, { 1, { 486000, HFPLL, 2, 0x24 }, L2(6), 975000 }, - { 0, { 540000, HFPLL, 2, 0x28 }, L2(6), 1000000 }, { 1, { 594000, HFPLL, 1, 0x16 }, L2(6), 1000000 }, - { 0, { 648000, HFPLL, 1, 0x18 }, L2(6), 1025000 }, { 1, { 702000, HFPLL, 1, 0x1A }, L2(6), 1025000 }, - { 0, { 756000, HFPLL, 1, 0x1C }, L2(6), 1075000 }, { 1, { 810000, HFPLL, 1, 0x1E }, L2(6), 1075000 }, - { 0, { 864000, HFPLL, 1, 0x20 }, L2(6), 1100000 }, { 1, { 918000, HFPLL, 1, 0x22 }, L2(6), 1100000 }, - { 0, { 972000, HFPLL, 1, 0x24 }, L2(6), 1125000 }, { 1, { 1026000, HFPLL, 1, 0x26 }, L2(6), 1125000 }, - { 0, { 1080000, HFPLL, 1, 0x28 }, L2(15), 1175000 }, { 1, { 1134000, HFPLL, 1, 0x2A }, L2(15), 1175000 }, - { 0, { 1188000, HFPLL, 1, 0x2C }, L2(15), 1200000 }, { 1, { 1242000, HFPLL, 1, 0x2E }, L2(15), 1200000 }, - { 0, { 1296000, HFPLL, 1, 0x30 }, L2(15), 1225000 }, { 1, { 1350000, HFPLL, 1, 0x32 }, L2(15), 1225000 }, - { 0, { 1404000, HFPLL, 1, 0x34 }, L2(15), 1237500 }, { 1, { 1458000, HFPLL, 1, 0x36 }, L2(15), 1237500 }, { 1, { 1512000, HFPLL, 1, 0x38 }, L2(15), 1250000 }, { 1, { 1566000, HFPLL, 1, 0x3A }, L2(15), 1250000 }, @@ -244,38 +232,136 @@ static struct acpu_level tbl_slow_1p7[] __initdata = { { 0, { 0 } } }; -static struct acpu_level tbl_slow_2p0[] __initdata = { - { 1, { 384000, PLL_8, 0, 0x00 }, L2(0), 950000 }, - { 0, { 432000, HFPLL, 2, 0x20 }, L2(6), 975000 }, - { 1, { 486000, HFPLL, 2, 0x24 }, L2(6), 975000 }, - { 0, { 540000, HFPLL, 2, 0x28 }, L2(6), 1000000 }, - { 1, { 594000, HFPLL, 1, 0x16 }, L2(6), 1000000 }, - { 0, { 648000, HFPLL, 1, 0x18 }, L2(6), 1025000 }, - { 1, { 702000, HFPLL, 1, 0x1A }, L2(6), 1025000 }, - { 0, { 756000, HFPLL, 1, 0x1C }, L2(6), 1075000 }, - { 1, { 810000, HFPLL, 1, 0x1E }, L2(6), 1075000 }, - { 0, { 864000, HFPLL, 1, 0x20 }, L2(6), 1100000 }, - { 1, { 918000, HFPLL, 1, 0x22 }, L2(6), 1100000 }, - { 0, { 972000, HFPLL, 1, 0x24 }, L2(6), 1125000 }, - { 1, { 1026000, HFPLL, 1, 0x26 }, L2(6), 1125000 }, - { 0, { 1080000, HFPLL, 1, 0x28 }, L2(15), 1175000 }, - { 1, { 1134000, HFPLL, 1, 0x2A }, L2(15), 1175000 }, - { 0, { 1188000, HFPLL, 1, 0x2C }, L2(15), 1200000 }, - { 1, { 1242000, HFPLL, 1, 0x2E }, L2(15), 1200000 }, - { 0, { 1296000, HFPLL, 1, 0x30 }, L2(15), 1225000 }, - { 1, { 1350000, HFPLL, 1, 0x32 }, L2(15), 1225000 }, - { 0, { 1404000, HFPLL, 1, 0x34 }, L2(15), 1237500 }, - { 1, { 1458000, HFPLL, 1, 0x36 }, L2(15), 1237500 }, - { 1, { 1512000, HFPLL, 1, 0x38 }, L2(15), 1250000 }, - { 1, { 1566000, HFPLL, 1, 0x3A }, L2(15), 1250000 }, - { 1, { 1620000, HFPLL, 1, 0x3C }, L2(15), 1250000 }, - { 1, { 1674000, HFPLL, 1, 0x3E }, L2(15), 1250000 }, - { 1, { 1728000, HFPLL, 1, 0x40 }, L2(15), 1250000 }, - { 1, { 1782000, HFPLL, 1, 0x42 }, L2(15), 1250000 }, - { 1, { 1836000, HFPLL, 1, 0x44 }, L2(15), 1250000 }, +static struct acpu_level tbl_PVS0_2000MHz[] __initdata = { + { 1, { 384000, PLL_8, 0, 0x00 }, L2(0), 900000 }, + { 1, { 486000, HFPLL, 2, 0x24 }, L2(6), 900000 }, + { 1, { 594000, HFPLL, 1, 0x16 }, L2(6), 900000 }, + { 1, { 702000, HFPLL, 1, 0x1A }, L2(6), 900000 }, + { 1, { 810000, HFPLL, 1, 0x1E }, L2(6), 912500 }, + { 1, { 918000, HFPLL, 1, 0x22 }, L2(6), 962500 }, + { 1, { 1026000, HFPLL, 1, 0x26 }, L2(6), 987500 }, + { 1, { 1134000, HFPLL, 1, 0x2A }, L2(15), 1012500 }, + { 1, { 1242000, HFPLL, 1, 0x2E }, L2(15), 1025000 }, + { 1, { 1350000, HFPLL, 1, 0x32 }, L2(15), 1075000 }, + { 1, { 1458000, HFPLL, 1, 0x36 }, L2(15), 1112500 }, + { 1, { 1566000, HFPLL, 1, 0x3A }, L2(15), 1150000 }, + { 1, { 1674000, HFPLL, 1, 0x3E }, L2(15), 1200000 }, + { 1, { 1782000, HFPLL, 1, 0x42 }, L2(15), 1262500 }, + { 1, { 1890000, HFPLL, 1, 0x46 }, L2(15), 1300000 }, + { 0, { 0 } } +}; + +static struct acpu_level tbl_PVS1_2000MHz[] __initdata = { + { 1, { 384000, PLL_8, 0, 0x00 }, L2(0), 900000 }, + { 1, { 486000, HFPLL, 2, 0x24 }, L2(6), 900000 }, + { 1, { 594000, HFPLL, 1, 0x16 }, L2(6), 900000 }, + { 1, { 702000, HFPLL, 1, 0x1A }, L2(6), 900000 }, + { 1, { 810000, HFPLL, 1, 0x1E }, L2(6), 900000 }, + { 1, { 918000, HFPLL, 1, 0x22 }, L2(6), 962500 }, + { 1, { 1026000, HFPLL, 1, 0x26 }, L2(6), 987500 }, + { 1, { 1134000, HFPLL, 1, 0x2A }, L2(15), 1000000 }, + { 1, { 1242000, HFPLL, 1, 0x2E }, L2(15), 1012500 }, + { 1, { 1350000, HFPLL, 1, 0x32 }, L2(15), 1062500 }, + { 1, { 1458000, HFPLL, 1, 0x36 }, L2(15), 1087500 }, + { 1, { 1566000, HFPLL, 1, 0x3A }, L2(15), 1125000 }, + { 1, { 1674000, HFPLL, 1, 0x3E }, L2(15), 1187500 }, + { 1, { 1782000, HFPLL, 1, 0x42 }, L2(15), 1237500 }, + { 1, { 1890000, HFPLL, 1, 0x46 }, L2(15), 1275000 }, + { 0, { 0 } } +}; + +static struct acpu_level tbl_PVS2_2000MHz[] __initdata = { + { 1, { 384000, PLL_8, 0, 0x00 }, L2(0), 900000 }, + { 1, { 486000, HFPLL, 2, 0x24 }, L2(6), 900000 }, + { 1, { 594000, HFPLL, 1, 0x16 }, L2(6), 900000 }, + { 1, { 702000, HFPLL, 1, 0x1A }, L2(6), 900000 }, + { 1, { 810000, HFPLL, 1, 0x1E }, L2(6), 900000 }, + { 1, { 918000, HFPLL, 1, 0x22 }, L2(6), 950000 }, + { 1, { 1026000, HFPLL, 1, 0x26 }, L2(6), 975000 }, + { 1, { 1134000, HFPLL, 1, 0x2A }, L2(15), 987500 }, + { 1, { 1242000, HFPLL, 1, 0x2E }, L2(15), 1000000 }, + { 1, { 1350000, HFPLL, 1, 0x32 }, L2(15), 1050000 }, + { 1, { 1458000, HFPLL, 1, 0x36 }, L2(15), 1075000 }, + { 1, { 1566000, HFPLL, 1, 0x3A }, L2(15), 1112500 }, + { 1, { 1674000, HFPLL, 1, 0x3E }, L2(15), 1162500 }, + { 1, { 1782000, HFPLL, 1, 0x42 }, L2(15), 1212500 }, { 1, { 1890000, HFPLL, 1, 0x46 }, L2(15), 1250000 }, - { 1, { 1944000, HFPLL, 1, 0x48 }, L2(15), 1250000 }, - { 1, { 1998000, HFPLL, 1, 0x4A }, L2(15), 1250000 }, + { 0, { 0 } } +}; + +static struct acpu_level tbl_PVS3_2000MHz[] __initdata = { + { 1, { 384000, PLL_8, 0, 0x00 }, L2(0), 900000 }, + { 1, { 486000, HFPLL, 2, 0x24 }, L2(6), 900000 }, + { 1, { 594000, HFPLL, 1, 0x16 }, L2(6), 900000 }, + { 1, { 702000, HFPLL, 1, 0x1A }, L2(6), 900000 }, + { 1, { 810000, HFPLL, 1, 0x1E }, L2(6), 900000 }, + { 1, { 918000, HFPLL, 1, 0x22 }, L2(6), 925000 }, + { 1, { 1026000, HFPLL, 1, 0x26 }, L2(6), 950000 }, + { 1, { 1134000, HFPLL, 1, 0x2A }, L2(15), 962500 }, + { 1, { 1242000, HFPLL, 1, 0x2E }, L2(15), 975000 }, + { 1, { 1350000, HFPLL, 1, 0x32 }, L2(15), 1012500 }, + { 1, { 1458000, HFPLL, 1, 0x36 }, L2(15), 1037500 }, + { 1, { 1566000, HFPLL, 1, 0x3A }, L2(15), 1075000 }, + { 1, { 1674000, HFPLL, 1, 0x3E }, L2(15), 1112500 }, + { 1, { 1782000, HFPLL, 1, 0x42 }, L2(15), 1162500 }, + { 1, { 1890000, HFPLL, 1, 0x46 }, L2(15), 1200000 }, + { 0, { 0 } } +}; + +static struct acpu_level tbl_PVS4_2000MHz[] __initdata = { + { 1, { 384000, PLL_8, 0, 0x00 }, L2(0), 900000 }, + { 1, { 486000, HFPLL, 2, 0x24 }, L2(6), 900000 }, + { 1, { 594000, HFPLL, 1, 0x16 }, L2(6), 900000 }, + { 1, { 702000, HFPLL, 1, 0x1A }, L2(6), 900000 }, + { 1, { 810000, HFPLL, 1, 0x1E }, L2(6), 900000 }, + { 1, { 918000, HFPLL, 1, 0x22 }, L2(6), 900000 }, + { 1, { 1026000, HFPLL, 1, 0x26 }, L2(6), 925000 }, + { 1, { 1134000, HFPLL, 1, 0x2A }, L2(15), 937500 }, + { 1, { 1242000, HFPLL, 1, 0x2E }, L2(15), 950000 }, + { 1, { 1350000, HFPLL, 1, 0x32 }, L2(15), 975000 }, + { 1, { 1458000, HFPLL, 1, 0x36 }, L2(15), 1000000 }, + { 1, { 1566000, HFPLL, 1, 0x3A }, L2(15), 1037500 }, + { 1, { 1674000, HFPLL, 1, 0x3E }, L2(15), 1062500 }, + { 1, { 1782000, HFPLL, 1, 0x42 }, L2(15), 1112500 }, + { 1, { 1890000, HFPLL, 1, 0x46 }, L2(15), 1150000 }, + { 0, { 0 } } +}; + +static struct acpu_level tbl_PVS5_2000MHz[] __initdata = { + { 1, { 384000, PLL_8, 0, 0x00 }, L2(0), 900000 }, + { 1, { 486000, HFPLL, 2, 0x24 }, L2(6), 900000 }, + { 1, { 594000, HFPLL, 1, 0x16 }, L2(6), 900000 }, + { 1, { 702000, HFPLL, 1, 0x1A }, L2(6), 900000 }, + { 1, { 810000, HFPLL, 1, 0x1E }, L2(6), 900000 }, + { 1, { 918000, HFPLL, 1, 0x22 }, L2(6), 900000 }, + { 1, { 1026000, HFPLL, 1, 0x26 }, L2(6), 925000 }, + { 1, { 1134000, HFPLL, 1, 0x2A }, L2(15), 937500 }, + { 1, { 1242000, HFPLL, 1, 0x2E }, L2(15), 950000 }, + { 1, { 1350000, HFPLL, 1, 0x32 }, L2(15), 962500 }, + { 1, { 1458000, HFPLL, 1, 0x36 }, L2(15), 987500 }, + { 1, { 1566000, HFPLL, 1, 0x3A }, L2(15), 1012500 }, + { 1, { 1674000, HFPLL, 1, 0x3E }, L2(15), 1037500 }, + { 1, { 1782000, HFPLL, 1, 0x42 }, L2(15), 1087500 }, + { 1, { 1890000, HFPLL, 1, 0x46 }, L2(15), 1125000 }, + { 0, { 0 } } +}; + +static struct acpu_level tbl_PVS6_2000MHz[] __initdata = { + { 1, { 384000, PLL_8, 0, 0x00 }, L2(0), 900000 }, + { 1, { 486000, HFPLL, 2, 0x24 }, L2(6), 900000 }, + { 1, { 594000, HFPLL, 1, 0x16 }, L2(6), 900000 }, + { 1, { 702000, HFPLL, 1, 0x1A }, L2(6), 900000 }, + { 1, { 810000, HFPLL, 1, 0x1E }, L2(6), 900000 }, + { 1, { 918000, HFPLL, 1, 0x22 }, L2(6), 900000 }, + { 1, { 1026000, HFPLL, 1, 0x26 }, L2(6), 925000 }, + { 1, { 1134000, HFPLL, 1, 0x2A }, L2(15), 937500 }, + { 1, { 1242000, HFPLL, 1, 0x2E }, L2(15), 950000 }, + { 1, { 1350000, HFPLL, 1, 0x32 }, L2(15), 962500 }, + { 1, { 1458000, HFPLL, 1, 0x36 }, L2(15), 975000 }, + { 1, { 1566000, HFPLL, 1, 0x3A }, L2(15), 1000000 }, + { 1, { 1674000, HFPLL, 1, 0x3E }, L2(15), 1025000 }, + { 1, { 1782000, HFPLL, 1, 0x42 }, L2(15), 1062500 }, + { 1, { 1890000, HFPLL, 1, 0x46 }, L2(15), 1100000 }, { 0, { 0 } } }; @@ -285,21 +371,21 @@ static struct pvs_table pvs_tables[NUM_SPEED_BINS][NUM_PVS] __initdata = { [0][PVS_FAST] = {tbl_fast, sizeof(tbl_fast), 25000 }, [0][PVS_FASTER] = {tbl_fast, sizeof(tbl_fast), 25000 }, - [1][0] = { tbl_slow_1p7, sizeof(tbl_slow_1p7), 0 }, - [1][1] = { tbl_slow_1p7, sizeof(tbl_slow_1p7), 0 }, - [1][2] = { tbl_slow_1p7, sizeof(tbl_slow_1p7), 0 }, - [1][3] = { tbl_slow_1p7, sizeof(tbl_slow_1p7), 0 }, - [1][4] = { tbl_slow_1p7, sizeof(tbl_slow_1p7), 0 }, - [1][5] = { tbl_slow_1p7, sizeof(tbl_slow_1p7), 0 }, - [1][6] = { tbl_slow_1p7, sizeof(tbl_slow_1p7), 0 }, + [1][0] = { tbl_PVS0_1700MHz, sizeof(tbl_PVS0_1700MHz), 0 }, + [1][1] = { tbl_PVS0_1700MHz, sizeof(tbl_PVS0_1700MHz), 0 }, + [1][2] = { tbl_PVS0_1700MHz, sizeof(tbl_PVS0_1700MHz), 0 }, + [1][3] = { tbl_PVS0_1700MHz, sizeof(tbl_PVS0_1700MHz), 0 }, + [1][4] = { tbl_PVS0_1700MHz, sizeof(tbl_PVS0_1700MHz), 0 }, + [1][5] = { tbl_PVS0_1700MHz, sizeof(tbl_PVS0_1700MHz), 0 }, + [1][6] = { tbl_PVS0_1700MHz, sizeof(tbl_PVS0_1700MHz), 0 }, - [2][0] = { tbl_slow_2p0, sizeof(tbl_slow_2p0), 0 }, - [2][1] = { tbl_slow_2p0, sizeof(tbl_slow_2p0), 0 }, - [2][2] = { tbl_slow_2p0, sizeof(tbl_slow_2p0), 0 }, - [2][3] = { tbl_slow_2p0, sizeof(tbl_slow_2p0), 0 }, - [2][4] = { tbl_slow_2p0, sizeof(tbl_slow_2p0), 0 }, - [2][5] = { tbl_slow_2p0, sizeof(tbl_slow_2p0), 0 }, - [2][6] = { tbl_slow_2p0, sizeof(tbl_slow_2p0), 0 }, + [2][0] = { tbl_PVS0_2000MHz, sizeof(tbl_PVS0_2000MHz), 0 }, + [2][1] = { tbl_PVS1_2000MHz, sizeof(tbl_PVS1_2000MHz), 0 }, + [2][2] = { tbl_PVS2_2000MHz, sizeof(tbl_PVS2_2000MHz), 0 }, + [2][3] = { tbl_PVS3_2000MHz, sizeof(tbl_PVS3_2000MHz), 0 }, + [2][4] = { tbl_PVS4_2000MHz, sizeof(tbl_PVS4_2000MHz), 0 }, + [2][5] = { tbl_PVS5_2000MHz, sizeof(tbl_PVS5_2000MHz), 0 }, + [2][6] = { tbl_PVS6_2000MHz, sizeof(tbl_PVS6_2000MHz), 0 }, }; static struct acpuclk_krait_params acpuclk_8064_params __initdata = { diff --git a/arch/arm/mach-msm/board-8064-gpu.c b/arch/arm/mach-msm/board-8064-gpu.c index 122505e4c081..68debff0fc5a 100644 --- a/arch/arm/mach-msm/board-8064-gpu.c +++ b/arch/arm/mach-msm/board-8064-gpu.c @@ -251,11 +251,17 @@ void __init apq8064_init_gpu(void) { unsigned int version = socinfo_get_version(); - if ((SOCINFO_VERSION_MAJOR(version) == 1) && - (SOCINFO_VERSION_MINOR(version) == 1)) - kgsl_3d0_pdata.chipid = ADRENO_CHIPID(3, 2, 0, 1); - else - kgsl_3d0_pdata.chipid = ADRENO_CHIPID(3, 2, 0, 0); + if (cpu_is_apq8064ab()) + kgsl_3d0_pdata.pwrlevel[0].gpu_freq = 450000000; + if (SOCINFO_VERSION_MAJOR(version) == 2) { + kgsl_3d0_pdata.chipid = ADRENO_CHIPID(3, 2, 0, 2); + } else { + if ((SOCINFO_VERSION_MAJOR(version) == 1) && + (SOCINFO_VERSION_MINOR(version) == 1)) + kgsl_3d0_pdata.chipid = ADRENO_CHIPID(3, 2, 0, 1); + else + kgsl_3d0_pdata.chipid = ADRENO_CHIPID(3, 2, 0, 0); + } platform_device_register(&device_kgsl_3d0); } diff --git a/arch/arm/mach-msm/board-8064.c b/arch/arm/mach-msm/board-8064.c index 5dd4686ebf37..7d932e0a11c5 100644 --- a/arch/arm/mach-msm/board-8064.c +++ b/arch/arm/mach-msm/board-8064.c @@ -738,12 +738,6 @@ static void __init apq8064_early_reserve(void) static struct msm_bus_vectors hsic_init_vectors[] = { { .src = MSM_BUS_MASTER_SPS, - .dst = MSM_BUS_SLAVE_EBI_CH0, - .ab = 0, - .ib = 0, - }, - { - .src = MSM_BUS_MASTER_SPS, .dst = MSM_BUS_SLAVE_SPS, .ab = 0, .ib = 0, @@ -754,15 +748,9 @@ static struct msm_bus_vectors hsic_init_vectors[] = { static struct msm_bus_vectors hsic_max_vectors[] = { { .src = MSM_BUS_MASTER_SPS, - .dst = MSM_BUS_SLAVE_EBI_CH0, - .ab = 60000000, /* At least 480Mbps on bus. */ - .ib = 960000000, /* MAX bursts rate */ - }, - { - .src = MSM_BUS_MASTER_SPS, .dst = MSM_BUS_SLAVE_SPS, .ab = 0, - .ib = 512000000, /*vote for 64Mhz dfab clk rate*/ + .ib = 256000000, /*vote for 32Mhz dfab clk rate*/ }, }; @@ -3298,6 +3286,7 @@ static void __init apq8064_pm8917_pdata_fixup(void) static void __init apq8064_common_init(void) { u32 platform_version = socinfo_get_platform_version(); + struct msm_rpmrs_level rpmrs_level; if (socinfo_get_pmic_model() == PMIC_MODEL_PM8917) apq8064_pm8917_pdata_fixup(); @@ -3363,8 +3352,12 @@ static void __init apq8064_common_init(void) } enable_ddr3_regulator(); - msm_hsic_pdata.swfi_latency = - msm_rpmrs_levels[0].latency_us; + rpmrs_level = + msm_rpmrs_levels[MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT]; + msm_hsic_pdata.swfi_latency = rpmrs_level.latency_us; + rpmrs_level = + msm_rpmrs_levels[MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE]; + msm_hsic_pdata.standalone_latency = rpmrs_level.latency_us; if (machine_is_apq8064_mtp()) { msm_hsic_pdata.log2_irq_thresh = 5, apq8064_device_hsic_host.dev.platform_data = &msm_hsic_pdata; diff --git a/arch/arm/mach-msm/clock-8960.c b/arch/arm/mach-msm/clock-8960.c index da081ef3c112..c671422f8c39 100644 --- a/arch/arm/mach-msm/clock-8960.c +++ b/arch/arm/mach-msm/clock-8960.c @@ -1534,6 +1534,11 @@ static CLK_SDC(sdc3_clk, 3, 4, 104000000, 208000000); static CLK_SDC(sdc4_clk, 4, 3, 33000000, 67000000); static CLK_SDC(sdc5_clk, 5, 2, 33000000, 67000000); +static unsigned long fmax_sdc1_8064v2[MAX_VDD_LEVELS] __initdata = { + [VDD_DIG_LOW] = 100000000, + [VDD_DIG_NOMINAL] = 200000000, +}; + #define F_TSIF_REF(f, s, d, m, n) \ { \ .freq_hz = f, \ @@ -1907,6 +1912,7 @@ static struct clk_freq_tbl clk_tbl_ce3[] = { F_CE3( 0, gnd, 1), F_CE3( 48000000, pll8, 8), F_CE3(100000000, pll3, 12), + F_CE3(120000000, pll3, 10), F_END }; @@ -1929,6 +1935,11 @@ static struct rcg_clk ce3_src_clk = { }, }; +static unsigned long fmax_ce3_8064v2[MAX_VDD_LEVELS] __initdata = { + [VDD_DIG_LOW] = 57000000, + [VDD_DIG_NOMINAL] = 120000000, +}; + static struct branch_clk ce3_core_clk = { .b = { .ctl_reg = CE3_CORE_CLK_CTL_REG, @@ -3540,11 +3551,12 @@ static struct clk_freq_tbl clk_tbl_gfx3d_8064[] = { F_GFX3D(145455000, pll2, 2, 11), F_GFX3D(160000000, pll2, 1, 5), F_GFX3D(177778000, pll2, 2, 9), + F_GFX3D(192000000, pll8, 1, 2), F_GFX3D(200000000, pll2, 1, 4), F_GFX3D(228571000, pll2, 2, 7), F_GFX3D(266667000, pll2, 1, 3), - F_GFX3D(325000000, pll15, 1, 3), F_GFX3D(400000000, pll2, 1, 2), + F_GFX3D(450000000, pll15, 1, 2), F_END }; @@ -3570,6 +3582,12 @@ static struct clk_freq_tbl clk_tbl_gfx3d_8930[] = { F_END }; +static unsigned long fmax_gfx3d_8064ab[MAX_VDD_LEVELS] __initdata = { + [VDD_DIG_LOW] = 128000000, + [VDD_DIG_NOMINAL] = 325000000, + [VDD_DIG_HIGH] = 450000000 +}; + static unsigned long fmax_gfx3d_8064[MAX_VDD_LEVELS] __initdata = { [VDD_DIG_LOW] = 128000000, [VDD_DIG_NOMINAL] = 325000000, @@ -4295,6 +4313,7 @@ static struct clk_freq_tbl clk_tbl_vcodec[] = { F_VCODEC(133330000, pll2, 1, 6), F_VCODEC(200000000, pll2, 1, 4), F_VCODEC(228570000, pll2, 2, 7), + F_VCODEC(266670000, pll2, 1, 3), F_END }; @@ -4325,6 +4344,12 @@ static struct rcg_clk vcodec_clk = { }, }; +static unsigned long fmax_vcodec_8064v2[MAX_VDD_LEVELS] __initdata = { + [VDD_DIG_LOW] = 100000000, + [VDD_DIG_NOMINAL] = 200000000, + [VDD_DIG_HIGH] = 266670000, +}; + #define F_VPE(f, s, d) \ { \ .freq_hz = f, \ @@ -6295,7 +6320,7 @@ static void __init reg_init(void) writel_relaxed(0x3C7097F9, AHB_EN2_REG); } - if (cpu_is_apq8064()) + if (cpu_is_apq8064() || cpu_is_apq8064ab()) rmwreg(0x00000001, AHB_EN3_REG, 0x00000001); /* Deassert all locally-owned MM AHB resets. */ @@ -6318,7 +6343,7 @@ static void __init reg_init(void) rmwreg(0x0027FCFF, MAXI_EN3_REG, 0x003FFFFF); rmwreg(0x0027FCFF, MAXI_EN4_REG, 0x017FFFFF); - if (cpu_is_apq8064()) + if (cpu_is_apq8064() || cpu_is_apq8064ab()) rmwreg(0x019FECFF, MAXI_EN5_REG, 0x01FFEFFF); if (cpu_is_msm8930() || cpu_is_msm8930aa() || cpu_is_msm8627()) rmwreg(0x000004FF, MAXI_EN5_REG, 0x00000FFF); @@ -6356,7 +6381,8 @@ static void __init reg_init(void) rmwreg(0x80FF0000, VFE_CC_REG, 0xE0FF4010); rmwreg(0x800000FF, VFE_CC2_REG, 0xE00000FF); rmwreg(0x80FF0000, VPE_CC_REG, 0xE0FF0010); - if (cpu_is_msm8960ab() || cpu_is_msm8960() || cpu_is_apq8064()) { + if (cpu_is_msm8960ab() || cpu_is_msm8960() || cpu_is_apq8064() + || cpu_is_apq8064ab()) { rmwreg(0x80FF0000, DSI2_BYTE_CC_REG, 0xE0FF0010); rmwreg(0x80FF0000, DSI2_PIXEL_CC_REG, 0xE0FF0010); rmwreg(0x80FF0000, JPEGD_CC_REG, 0xE0FF0010); @@ -6374,7 +6400,7 @@ static void __init reg_init(void) rmwreg(0x80FF0000, GFX2D0_CC_REG, 0xE0FF0010); rmwreg(0x80FF0000, GFX2D1_CC_REG, 0xE0FF0010); } - if (cpu_is_apq8064()) { + if (cpu_is_apq8064() || cpu_is_apq8064ab()) { rmwreg(0x00000000, TV_CC_REG, 0x00004010); rmwreg(0x80FF0000, VCAP_CC_REG, 0xE0FF1010); } @@ -6385,7 +6411,7 @@ static void __init reg_init(void) * and wake-up value to max. */ rmwreg(0x0000004F, USB_HS1_HCLK_FS_REG, 0x0000007F); - if (cpu_is_apq8064()) { + if (cpu_is_apq8064() || cpu_is_apq8064ab()) { rmwreg(0x0000004F, USB_HS3_HCLK_FS_REG, 0x0000007F); rmwreg(0x0000004F, USB_HS4_HCLK_FS_REG, 0x0000007F); } @@ -6407,7 +6433,8 @@ static void __init reg_init(void) /* Source the dsi_byte_clks from the DSI PHY PLLs */ rmwreg(0x1, DSI1_BYTE_NS_REG, 0x7); - if (cpu_is_msm8960ab() || cpu_is_msm8960() || cpu_is_apq8064()) + if (cpu_is_msm8960ab() || cpu_is_msm8960() || cpu_is_apq8064() + || cpu_is_apq8064ab()) rmwreg(0x2, DSI2_BYTE_NS_REG, 0x7); /* Source the dsi1_esc_clk from the DSI1 PHY PLLs */ @@ -6417,7 +6444,7 @@ static void __init reg_init(void) * Source the sata_phy_ref_clk from PXO and set predivider of * sata_pmalive_clk to 1. */ - if (cpu_is_apq8064()) { + if (cpu_is_apq8064() || cpu_is_apq8064ab()) { rmwreg(0, SATA_PHY_REF_CLK_CTL_REG, 0x1); rmwreg(0, SATA_PMALIVE_CLK_CTL_REG, 0x3); } @@ -6426,7 +6453,7 @@ static void __init reg_init(void) * TODO: Programming below PLLs and prng_clk is temporary and * needs to be removed after bootloaders program them. */ - if (cpu_is_apq8064()) { + if (cpu_is_apq8064() || cpu_is_apq8064ab()) { u32 is_pll_enabled; /* Program pxo_src_clk to source from PXO */ @@ -6436,16 +6463,13 @@ static void __init reg_init(void) is_pll_enabled = readl_relaxed(BB_PLL14_STATUS_REG) & BIT(16); if (!is_pll_enabled) /* Ref clk = 27MHz and program pll14 to 480MHz */ - configure_pll(&pll14_config, &pll14_regs, 1); - - /* Program PLL15 to 975MHz with ref clk = 27MHz */ - configure_pll(&pll15_config, &pll15_regs, 0); + configure_sr_pll(&pll14_config, &pll14_regs, 1); /* Check if PLL4 is active */ is_pll_enabled = readl_relaxed(LCC_PLL0_STATUS_REG) & BIT(16); if (!is_pll_enabled) /* Ref clk = 27MHz and program pll4 to 393.2160MHz */ - configure_pll(&pll4_config_393, &pll4_regs, 1); + configure_sr_pll(&pll4_config_393, &pll4_regs, 1); /* Enable PLL4 source on the LPASS Primary PLL Mux */ writel_relaxed(0x1, LCC_PRI_PLL_CLK_CTL_REG); @@ -6455,6 +6479,17 @@ static void __init reg_init(void) writel_relaxed(0x2B, PRNG_CLK_NS_REG); } + if (cpu_is_apq8064()) { + /* Program PLL15 to 975MHz with ref clk = 27MHz */ + configure_sr_pll(&pll15_config, &pll15_regs, 0); + } else if (cpu_is_apq8064ab()) { + /* Program PLL15 to 900MHZ */ + pll15_config.l = 0x21 | BVAL(31, 7, 0x620); + pll15_config.m = 0x1; + pll15_config.n = 0x3; + configure_sr_pll(&pll15_config, &pll15_regs, 0); + } + /* * Program PLL15 to 900MHz with ref clk = 27MHz and * only enable PLL main output. @@ -6463,7 +6498,7 @@ static void __init reg_init(void) pll15_config.l = 0x21 | BVAL(31, 7, 0x600); pll15_config.m = 0x1; pll15_config.n = 0x3; - configure_pll(&pll15_config, &pll15_regs, 0); + configure_sr_pll(&pll15_config, &pll15_regs, 0); /* Disable AUX and BIST outputs */ writel_relaxed(0, MM_PLL3_TEST_CTL_REG); } @@ -6475,7 +6510,7 @@ static void __init msm8960_clock_pre_init(void) /* Initialize clock registers. */ reg_init(); - if (cpu_is_apq8064()) + if (cpu_is_apq8064() || cpu_is_apq8064ab()) vdd_sr2_hdmi_pll.set_vdd = set_vdd_sr2_hdmi_pll_8064; /* Detect PLL4 programmed for alternate 491.52MHz clock plan. */ @@ -6517,13 +6552,32 @@ static void __init msm8960_clock_pre_init(void) } /* * Change the freq tables for and voltage requirements for - * clocks which differ between 8960 and 8064. + * clocks which differ between chips. */ if (cpu_is_apq8064()) { gfx3d_clk.freq_tbl = clk_tbl_gfx3d_8064; memcpy(gfx3d_clk.c.fmax, fmax_gfx3d_8064, sizeof(gfx3d_clk.c.fmax)); + } + if (cpu_is_apq8064ab()) { + gfx3d_clk.freq_tbl = clk_tbl_gfx3d_8064; + + memcpy(gfx3d_clk.c.fmax, fmax_gfx3d_8064ab, + sizeof(gfx3d_clk.c.fmax)); + } + if ((cpu_is_apq8064() && + SOCINFO_VERSION_MAJOR(socinfo_get_version()) == 2) || + cpu_is_apq8064ab()) { + + memcpy(vcodec_clk.c.fmax, fmax_vcodec_8064v2, + sizeof(vcodec_clk.c.fmax)); + memcpy(ce3_src_clk.c.fmax, fmax_ce3_8064v2, + sizeof(ce3_src_clk.c.fmax)); + memcpy(sdc1_clk.c.fmax, fmax_sdc1_8064v2, + sizeof(sdc1_clk.c.fmax)); + } + if (cpu_is_apq8064() || cpu_is_apq8064ab()) { memcpy(ijpeg_clk.c.fmax, fmax_ijpeg_8064, sizeof(ijpeg_clk.c.fmax)); memcpy(mdp_clk.c.fmax, fmax_mdp_8064, @@ -6599,7 +6653,7 @@ static void __init msm8960_clock_post_init(void) clk_set_rate(&tsif_ref_clk.c, 105000); clk_set_rate(&tssc_clk.c, 27000000); clk_set_rate(&usb_hs1_xcvr_clk.c, 60000000); - if (cpu_is_apq8064()) { + if (cpu_is_apq8064() || cpu_is_apq8064ab()) { clk_set_rate(&usb_hs3_xcvr_clk.c, 60000000); clk_set_rate(&usb_hs4_xcvr_clk.c, 60000000); } diff --git a/arch/arm/mach-msm/clock-8974.c b/arch/arm/mach-msm/clock-8974.c index b054e0878548..62e8f0f1c55d 100644 --- a/arch/arm/mach-msm/clock-8974.c +++ b/arch/arm/mach-msm/clock-8974.c @@ -5594,16 +5594,16 @@ static void __init reg_init(void) if (!(readl_relaxed(GCC_REG_BASE(GPLL0_STATUS_REG)) & gpll0_clk_src.status_mask)) - configure_pll(&gpll0_config, &gpll0_regs, 1); + configure_sr_hpm_lp_pll(&gpll0_config, &gpll0_regs, 1); if (!(readl_relaxed(GCC_REG_BASE(GPLL1_STATUS_REG)) & gpll1_clk_src.status_mask)) - configure_pll(&gpll1_config, &gpll1_regs, 1); + configure_sr_hpm_lp_pll(&gpll1_config, &gpll1_regs, 1); - configure_pll(&mmpll0_config, &mmpll0_regs, 1); - configure_pll(&mmpll1_config, &mmpll1_regs, 1); - configure_pll(&mmpll3_config, &mmpll3_regs, 0); - configure_pll(&lpapll0_config, &lpapll0_regs, 1); + configure_sr_hpm_lp_pll(&mmpll0_config, &mmpll0_regs, 1); + configure_sr_hpm_lp_pll(&mmpll1_config, &mmpll1_regs, 1); + configure_sr_hpm_lp_pll(&mmpll3_config, &mmpll3_regs, 0); + configure_sr_hpm_lp_pll(&lpapll0_config, &lpapll0_regs, 1); /* Enable GPLL0's aux outputs. */ regval = readl_relaxed(GCC_REG_BASE(GPLL0_USER_CTL_REG)); @@ -5769,7 +5769,7 @@ static void __init msm8974_clock_pre_init(void) if (!virt_bases[APCS_BASE]) panic("clock-8974: Unable to ioremap APCS_GCC_CC memory!"); - clk_ops_local_pll.enable = msm8974_pll_clk_enable; + clk_ops_local_pll.enable = sr_hpm_lp_pll_clk_enable; vdd_dig_reg = rpm_regulator_get(NULL, "vdd_dig"); if (IS_ERR(vdd_dig_reg)) diff --git a/arch/arm/mach-msm/clock-9615.c b/arch/arm/mach-msm/clock-9615.c index 648a8d43bde1..15eaa4b5fec9 100644 --- a/arch/arm/mach-msm/clock-9615.c +++ b/arch/arm/mach-msm/clock-9615.c @@ -1807,14 +1807,14 @@ static void __init msm9615_clock_pre_init(void) regval |= BIT(12); writel_relaxed(regval, BB_PLL0_TEST_CTL_REG); - configure_pll(&pll0_config, &pll0_regs, 1); + configure_sr_pll(&pll0_config, &pll0_regs, 1); } /* Check if PLL14 is enabled in FSM mode */ is_pll_enabled = readl_relaxed(BB_PLL14_STATUS_REG) & BIT(16); if (!is_pll_enabled) - configure_pll(&pll14_config, &pll14_regs, 1); + configure_sr_pll(&pll14_config, &pll14_regs, 1); else if (!(readl_relaxed(BB_PLL14_MODE_REG) & BIT(20))) WARN(1, "PLL14 enabled in non-FSM mode!\n"); diff --git a/arch/arm/mach-msm/clock-pll.c b/arch/arm/mach-msm/clock-pll.c index d5831e23d635..23941d7fac9e 100644 --- a/arch/arm/mach-msm/clock-pll.c +++ b/arch/arm/mach-msm/clock-pll.c @@ -247,7 +247,7 @@ int sr_pll_clk_enable(struct clk *c) #define PLL_LOCKED_BIT BIT(16) -int msm8974_pll_clk_enable(struct clk *c) +int sr_hpm_lp_pll_clk_enable(struct clk *c) { unsigned long flags; struct pll_clk *pll = to_pll_clk(c); @@ -255,23 +255,12 @@ int msm8974_pll_clk_enable(struct clk *c) int ret = 0; spin_lock_irqsave(&pll_reg_lock, flags); - mode = readl_relaxed(PLL_MODE_REG(pll)); - /* Disable PLL bypass mode. */ - mode |= PLL_BYPASSNL; - writel_relaxed(mode, PLL_MODE_REG(pll)); - - /* - * H/W requires a 5us delay between disabling the bypass and - * de-asserting the reset. Delay 10us just to be safe. - */ - mb(); - udelay(10); - /* De-assert active-low PLL reset. */ - mode |= PLL_RESET_N; + /* Disable PLL bypass mode and de-assert reset. */ + mode = PLL_BYPASSNL | PLL_RESET_N; writel_relaxed(mode, PLL_MODE_REG(pll)); - /* Wait for pll to enable. */ + /* Wait for pll to lock. */ for (count = ENABLE_WAIT_MAX_LOOPS; count > 0; count--) { if (readl_relaxed(PLL_STATUS_REG(pll)) & PLL_LOCKED_BIT) break; @@ -453,7 +442,8 @@ struct clk_ops clk_ops_pll = { .is_enabled = pll_clk_is_enabled, }; -static void __init __set_fsm_mode(void __iomem *mode_reg) +static void __init __set_fsm_mode(void __iomem *mode_reg, + u32 bias_count, u32 lock_count) { u32 regval = readl_relaxed(mode_reg); @@ -463,12 +453,12 @@ static void __init __set_fsm_mode(void __iomem *mode_reg) /* Program bias count */ regval &= ~BM(19, 14); - regval |= BVAL(19, 14, 0x1); + regval |= BVAL(19, 14, bias_count); writel_relaxed(regval, mode_reg); /* Program lock count */ regval &= ~BM(13, 8); - regval |= BVAL(13, 8, 0x8); + regval |= BVAL(13, 8, lock_count); writel_relaxed(regval, mode_reg); /* Enable PLL FSM voting */ @@ -476,7 +466,7 @@ static void __init __set_fsm_mode(void __iomem *mode_reg) writel_relaxed(regval, mode_reg); } -void __init configure_pll(struct pll_config *config, +void __init __configure_pll(struct pll_config *config, struct pll_config_regs *regs, u32 ena_fsm_mode) { u32 regval; @@ -509,8 +499,21 @@ void __init configure_pll(struct pll_config *config, regval &= ~config->vco_mask; regval |= config->vco_val; writel_relaxed(regval, PLL_CONFIG_REG(regs)); +} - /* Configure in FSM mode if necessary */ +void __init configure_sr_pll(struct pll_config *config, + struct pll_config_regs *regs, u32 ena_fsm_mode) +{ + __configure_pll(config, regs, ena_fsm_mode); if (ena_fsm_mode) - __set_fsm_mode(PLL_MODE_REG(regs)); + __set_fsm_mode(PLL_MODE_REG(regs), 0x1, 0x8); } + +void __init configure_sr_hpm_lp_pll(struct pll_config *config, + struct pll_config_regs *regs, u32 ena_fsm_mode) +{ + __configure_pll(config, regs, ena_fsm_mode); + if (ena_fsm_mode) + __set_fsm_mode(PLL_MODE_REG(regs), 0x1, 0x0); +} + diff --git a/arch/arm/mach-msm/clock-pll.h b/arch/arm/mach-msm/clock-pll.h index 90f8a95e1399..30f595bd881a 100644 --- a/arch/arm/mach-msm/clock-pll.h +++ b/arch/arm/mach-msm/clock-pll.h @@ -111,7 +111,7 @@ static inline struct pll_clk *to_pll_clk(struct clk *c) } int sr_pll_clk_enable(struct clk *c); -int msm8974_pll_clk_enable(struct clk *c); +int sr_hpm_lp_pll_clk_enable(struct clk *c); /* * PLL vote clock APIs @@ -146,6 +146,8 @@ struct pll_config_regs { void *const __iomem *base; }; -void __init configure_pll(struct pll_config *, struct pll_config_regs *, u32); - +void configure_sr_pll(struct pll_config *config, struct pll_config_regs *regs, + u32 ena_fsm_mode); +void configure_sr_hpm_lp_pll(struct pll_config *config, + struct pll_config_regs *, u32 ena_fsm_mode); #endif diff --git a/arch/arm/mach-msm/clock.c b/arch/arm/mach-msm/clock.c index 27f2405b90bd..2b7a4f50dfab 100644 --- a/arch/arm/mach-msm/clock.c +++ b/arch/arm/mach-msm/clock.c @@ -135,6 +135,18 @@ static void unvote_rate_vdd(struct clk *clk, unsigned long rate) unvote_vdd_level(clk->vdd_class, level); } +/* Returns true if the rate is valid without voting for it */ +static bool is_rate_valid(struct clk *clk, unsigned long rate) +{ + int level; + + if (!clk->vdd_class) + return true; + + level = find_vdd_level(clk, rate); + return level >= 0; +} + int clk_prepare(struct clk *clk) { int ret = 0; @@ -333,14 +345,16 @@ int clk_set_rate(struct clk *clk, unsigned long rate) /* Enforce vdd requirements for target frequency. */ rc = vote_rate_vdd(clk, rate); if (rc) - goto err_vote_vdd; + goto out; rc = clk->ops->set_rate(clk, rate); if (rc) goto err_set_rate; /* Release vdd requirements for starting frequency. */ unvote_rate_vdd(clk, start_rate); - } else { + } else if (is_rate_valid(clk, rate)) { rc = clk->ops->set_rate(clk, rate); + } else { + rc = -EINVAL; } if (!rc) @@ -351,7 +365,6 @@ out: err_set_rate: unvote_rate_vdd(clk, rate); -err_vote_vdd: goto out; } EXPORT_SYMBOL(clk_set_rate); diff --git a/arch/arm/mach-msm/devices-iommu.c b/arch/arm/mach-msm/devices-iommu.c index acf577ec5a1d..6434a63b57f5 100644 --- a/arch/arm/mach-msm/devices-iommu.c +++ b/arch/arm/mach-msm/devices-iommu.c @@ -1017,13 +1017,13 @@ static int __init iommu_init(void) ARRAY_SIZE(msm_iommu_gfx2d_devs)); } - if (cpu_is_apq8064() || cpu_is_msm8960ab()) { + if (cpu_is_apq8064() || cpu_is_msm8960ab() || cpu_is_apq8064ab()) { platform_add_devices(msm_iommu_jpegd_devs, ARRAY_SIZE(msm_iommu_jpegd_devs)); platform_add_devices(msm_iommu_adreno3xx_gfx_devs, ARRAY_SIZE(msm_iommu_adreno3xx_gfx_devs)); } - if (cpu_is_apq8064()) + if (cpu_is_apq8064() || cpu_is_apq8064ab()) platform_add_devices(msm_iommu_vcap_devs, ARRAY_SIZE(msm_iommu_vcap_devs)); @@ -1039,14 +1039,14 @@ static int __init iommu_init(void) ARRAY_SIZE(msm_iommu_gfx2d_ctx_devs)); } - if (cpu_is_apq8064() || cpu_is_msm8960ab()) { + if (cpu_is_apq8064() || cpu_is_msm8960ab() || cpu_is_apq8064ab()) { platform_add_devices(msm_iommu_jpegd_ctx_devs, ARRAY_SIZE(msm_iommu_jpegd_ctx_devs)); platform_add_devices(msm_iommu_adreno3xx_ctx_devs, ARRAY_SIZE(msm_iommu_adreno3xx_ctx_devs)); } - if (cpu_is_apq8064()) + if (cpu_is_apq8064() || cpu_is_apq8064ab()) platform_add_devices(msm_iommu_vcap_ctx_devs, ARRAY_SIZE(msm_iommu_vcap_ctx_devs)); @@ -1081,12 +1081,12 @@ static void __exit iommu_exit(void) for (i = 0; i < ARRAY_SIZE(msm_iommu_jpegd_devs); i++) platform_device_unregister(msm_iommu_jpegd_devs[i]); } - if (cpu_is_apq8064()) { + if (cpu_is_apq8064() || cpu_is_apq8064ab()) { for (i = 0; i < ARRAY_SIZE(msm_iommu_vcap_ctx_devs); i++) platform_device_unregister(msm_iommu_vcap_ctx_devs[i]); } - if (cpu_is_apq8064() || cpu_is_msm8960ab()) { + if (cpu_is_apq8064() || cpu_is_msm8960ab() || cpu_is_apq8064ab()) { for (i = 0; i < ARRAY_SIZE(msm_iommu_adreno3xx_ctx_devs); i++) platform_device_unregister( @@ -1097,7 +1097,7 @@ static void __exit iommu_exit(void) platform_device_unregister( msm_iommu_jpegd_ctx_devs[i]); - if (cpu_is_apq8064()) { + if (cpu_is_apq8064() || cpu_is_apq8064ab()) { for (i = 0; i < ARRAY_SIZE(msm_iommu_vcap_devs); i++) platform_device_unregister( diff --git a/arch/arm/mach-msm/gss-8064.c b/arch/arm/mach-msm/gss-8064.c index e528650ac8c2..ba6af61846e5 100644 --- a/arch/arm/mach-msm/gss-8064.c +++ b/arch/arm/mach-msm/gss-8064.c @@ -200,7 +200,7 @@ static int __init gss_8064_init(void) { int ret; - if (!cpu_is_apq8064()) + if (!(cpu_is_apq8064() || cpu_is_apq8064ab())) return -ENODEV; ret = smsm_state_cb_register(SMSM_MODEM_STATE, SMSM_RESET, diff --git a/arch/arm/mach-msm/modem-8960.c b/arch/arm/mach-msm/modem-8960.c index f0a123b005cc..83b3bc4d28f9 100644 --- a/arch/arm/mach-msm/modem-8960.c +++ b/arch/arm/mach-msm/modem-8960.c @@ -258,7 +258,7 @@ static int __init modem_8960_init(void) { int ret; - if (cpu_is_apq8064()) + if (cpu_is_apq8064() || cpu_is_apq8064ab()) return -ENODEV; ret = smsm_state_cb_register(SMSM_MODEM_STATE, SMSM_RESET, diff --git a/arch/arm/mach-msm/msm_xo.c b/arch/arm/mach-msm/msm_xo.c index 2d61504053c6..404b35081774 100644 --- a/arch/arm/mach-msm/msm_xo.c +++ b/arch/arm/mach-msm/msm_xo.c @@ -236,7 +236,7 @@ static int __msm_xo_mode_vote(struct msm_xo_voter *xo_voter, unsigned mode) int needs_workaround = cpu_is_msm8960() || cpu_is_apq8064() || cpu_is_msm8930() || cpu_is_msm8930aa() || cpu_is_msm9615() || cpu_is_msm8627() || - cpu_is_msm8960ab(); + cpu_is_msm8960ab() || cpu_is_apq8064ab(); if (xo_voter->mode == mode) return 0; diff --git a/arch/arm/mach-msm/platsmp.c b/arch/arm/mach-msm/platsmp.c index b2681b75be49..fa93ad0e417d 100644 --- a/arch/arm/mach-msm/platsmp.c +++ b/arch/arm/mach-msm/platsmp.c @@ -163,7 +163,8 @@ static int __cpuinit release_secondary(unsigned int cpu) return krait_release_secondary_sim(0xf9088000, cpu); if (cpu_is_msm8960() || cpu_is_msm8930() || cpu_is_msm8930aa() || - cpu_is_apq8064() || cpu_is_msm8627() || cpu_is_msm8960ab()) + cpu_is_apq8064() || cpu_is_msm8627() || cpu_is_msm8960ab() || + cpu_is_apq8064ab()) return krait_release_secondary(0x02088000, cpu); if (cpu_is_msm8974()) diff --git a/arch/arm/mach-msm/rpm_resources.c b/arch/arm/mach-msm/rpm_resources.c index 3ab5a98e1dee..dfed3aab9a1b 100644 --- a/arch/arm/mach-msm/rpm_resources.c +++ b/arch/arm/mach-msm/rpm_resources.c @@ -1132,7 +1132,8 @@ static struct msm_pm_sleep_ops msm_rpmrs_ops = { static int __init msm_rpmrs_l2_init(void) { if (cpu_is_msm8960() || cpu_is_msm8930() || cpu_is_msm8930aa() || - cpu_is_apq8064() || cpu_is_msm8627() || cpu_is_msm8960ab()) { + cpu_is_apq8064() || cpu_is_msm8627() || cpu_is_msm8960ab() || + cpu_is_apq8064ab()) { msm_pm_set_l2_flush_flag(0); diff --git a/arch/arm/mach-msm/spm_devices.c b/arch/arm/mach-msm/spm_devices.c index c7e7b29de6d3..2cbed946f137 100644 --- a/arch/arm/mach-msm/spm_devices.c +++ b/arch/arm/mach-msm/spm_devices.c @@ -168,7 +168,8 @@ int msm_spm_turn_on_cpu_rail(unsigned int cpu) reg = saw_bases[cpu]; if (cpu_is_msm8960() || cpu_is_msm8930() || cpu_is_msm8930aa() || - cpu_is_apq8064() || cpu_is_msm8627() || cpu_is_msm8960ab()) { + cpu_is_apq8064() || cpu_is_msm8627() || cpu_is_msm8960ab() || + cpu_is_apq8064ab()) { val = 0xA4; reg += 0x14; timeout = 512; diff --git a/arch/arm/mach-msm/timer.c b/arch/arm/mach-msm/timer.c index 668f4cc936f8..b361d9d67305 100644 --- a/arch/arm/mach-msm/timer.c +++ b/arch/arm/mach-msm/timer.c @@ -966,7 +966,7 @@ int __cpuinit local_timer_setup(struct clock_event_device *evt) if (cpu_is_msm8x60() || cpu_is_msm8960() || cpu_is_apq8064() || cpu_is_msm8930() || cpu_is_msm8930aa() || cpu_is_msm8627() || - cpu_is_msm8960ab()) + cpu_is_msm8960ab() || cpu_is_apq8064ab()) __raw_writel(DGT_CLK_CTL_DIV_4, MSM_TMR_BASE + DGT_CLK_CTL); if (__get_cpu_var(first_boot)) { @@ -1064,7 +1064,7 @@ static void __init msm_timer_init(void) dgt->flags |= MSM_CLOCK_FLAGS_UNSTABLE_COUNT; } else if (cpu_is_msm8960() || cpu_is_apq8064() || cpu_is_msm8930() || cpu_is_msm8930aa() || cpu_is_msm8627() || - cpu_is_msm8960ab()) { + cpu_is_msm8960ab() || cpu_is_apq8064ab()) { global_timer_offset = MSM_TMR0_BASE - MSM_TMR_BASE; dgt->freq = 6750000; __raw_writel(DGT_CLK_CTL_DIV_4, MSM_TMR_BASE + DGT_CLK_CTL); @@ -1127,7 +1127,7 @@ static void __init msm_timer_init(void) if (cpu_is_msm8x60() || cpu_is_msm8960() || cpu_is_apq8064() || cpu_is_msm8930() || cpu_is_msm9615() || cpu_is_msm8625() || cpu_is_msm8627() || cpu_is_msm8930aa() || - cpu_is_msm8960ab()) { + cpu_is_msm8960ab() || cpu_is_apq8064ab()) { clock->percpu_evt = alloc_percpu(struct clock_event_device *); if (!clock->percpu_evt) { pr_err("msm_timer_init: memory allocation " diff --git a/drivers/char/diag/diagfwd.c b/drivers/char/diag/diagfwd.c index 884e5fe14ff6..b1ee8e4a2019 100644 --- a/drivers/char/diag/diagfwd.c +++ b/drivers/char/diag/diagfwd.c @@ -135,6 +135,7 @@ int chk_config_get_id(void) case MSM_CPU_8960AB: return AO8960_TOOLS_ID; case MSM_CPU_8064: + case MSM_CPU_8064AB: return APQ8064_TOOLS_ID; case MSM_CPU_8930: case MSM_CPU_8930AA: @@ -162,6 +163,7 @@ int chk_apps_only(void) case MSM_CPU_8960: case MSM_CPU_8960AB: case MSM_CPU_8064: + case MSM_CPU_8064AB: case MSM_CPU_8930: case MSM_CPU_8930AA: case MSM_CPU_8627: @@ -184,7 +186,7 @@ int chk_apps_master(void) return 1; else if (cpu_is_msm8960() || cpu_is_msm8930() || cpu_is_msm8930aa() || cpu_is_msm9615() || cpu_is_apq8064() || cpu_is_msm8627() || - cpu_is_msm8960ab()) + cpu_is_msm8960ab() || cpu_is_apq8064ab()) return 1; else return 0; diff --git a/drivers/slimbus/slimbus.c b/drivers/slimbus/slimbus.c index da2a30d34f87..11a01299dab1 100644 --- a/drivers/slimbus/slimbus.c +++ b/drivers/slimbus/slimbus.c @@ -2851,6 +2851,9 @@ int slim_control_ch(struct slim_device *sb, u16 chanh, mutex_lock(&sb->sldev_reconf); mutex_lock(&ctrl->m_ctrl); do { + struct slim_pending_ch *pch; + u8 add_mark_removal = true; + slc = &ctrl->chans[chan]; dev_dbg(&ctrl->dev, "chan:%d,ctrl:%d,def:%d", chan, chctrl, slc->def); @@ -2875,9 +2878,30 @@ int slim_control_ch(struct slim_device *sb, u16 chanh, ret = -ENOTCONN; break; } - ret = add_pending_ch(&sb->mark_removal, chan); - if (ret) - break; + /* If channel removal request comes when pending + * in the mark_define, remove it from the define + * list instead of adding it to removal list + */ + if (!list_empty(&sb->mark_define)) { + struct list_head *pos, *next; + list_for_each_safe(pos, next, + &sb->mark_define) { + pch = list_entry(pos, + struct slim_pending_ch, + pending); + if (pch->chan == slc->chan) { + list_del(&pch->pending); + kfree(pch); + add_mark_removal = false; + break; + } + } + } + if (add_mark_removal == true) { + ret = add_pending_ch(&sb->mark_removal, chan); + if (ret) + break; + } } if (!(slc->nextgrp & SLIM_END_GRP)) diff --git a/drivers/usb/host/ehci-msm-hsic.c b/drivers/usb/host/ehci-msm-hsic.c index 0a48a6e18393..baa73b3c4bd5 100644 --- a/drivers/usb/host/ehci-msm-hsic.c +++ b/drivers/usb/host/ehci-msm-hsic.c @@ -325,7 +325,7 @@ static void dump_hsic_regs(struct usb_hcd *hcd) #define ULPI_IO_TIMEOUT_USEC (10 * 1000) #define USB_PHY_VDD_DIG_VOL_NONE 0 /*uV */ -#define USB_PHY_VDD_DIG_VOL_MIN 1000000 /* uV */ +#define USB_PHY_VDD_DIG_VOL_MIN 945000 /* uV */ #define USB_PHY_VDD_DIG_VOL_MAX 1320000 /* uV */ #define HSIC_DBG1_REG 0x38 @@ -653,6 +653,7 @@ static int msm_hsic_suspend(struct msm_hsic_hcd *mehci) int cnt = 0, ret; u32 val; int none_vol, max_vol; + struct msm_hsic_host_platform_data *pdata = mehci->dev->platform_data; if (atomic_read(&mehci->in_lpm)) { dev_dbg(mehci->dev, "%s called in lpm\n", __func__); @@ -731,6 +732,10 @@ static int msm_hsic_suspend(struct msm_hsic_hcd *mehci) enable_irq_wake(mehci->wakeup_irq); enable_irq(mehci->wakeup_irq); + if (pdata && pdata->standalone_latency) + pm_qos_update_request(&mehci->pm_qos_req_dma, + PM_QOS_DEFAULT_VALUE); + wake_unlock(&mehci->wlock); dev_info(mehci->dev, "HSIC-USB in low power mode\n"); @@ -745,12 +750,17 @@ static int msm_hsic_resume(struct msm_hsic_hcd *mehci) unsigned temp; int min_vol, max_vol; unsigned long flags; + struct msm_hsic_host_platform_data *pdata = mehci->dev->platform_data; if (!atomic_read(&mehci->in_lpm)) { dev_dbg(mehci->dev, "%s called in !in_lpm\n", __func__); return 0; } + if (pdata && pdata->standalone_latency) + pm_qos_update_request(&mehci->pm_qos_req_dma, + pdata->standalone_latency + 1); + spin_lock_irqsave(&mehci->wakeup_lock, flags); if (mehci->wakeup_irq_enabled) { disable_irq_wake(mehci->wakeup_irq); @@ -1041,9 +1051,9 @@ resume_again: pm_qos_update_request(&mehci->pm_qos_req_dma, pdata->swfi_latency + 1); wait_for_completion(&mehci->gpt0_completion); - if (pdata && pdata->swfi_latency) + if (pdata && pdata->standalone_latency) pm_qos_update_request(&mehci->pm_qos_req_dma, - PM_QOS_DEFAULT_VALUE); + pdata->standalone_latency + 1); spin_lock_irq(&ehci->lock); } else { dbg_log_event(NULL, "FPR: Tightloop", 0); @@ -1664,9 +1674,9 @@ static int __devinit ehci_hsic_msm_probe(struct platform_device *pdev) __mehci = mehci; - if (pdata && pdata->swfi_latency) + if (pdata && pdata->standalone_latency) pm_qos_add_request(&mehci->pm_qos_req_dma, - PM_QOS_CPU_DMA_LATENCY, PM_QOS_DEFAULT_VALUE); + PM_QOS_CPU_DMA_LATENCY, pdata->standalone_latency + 1); /* * This pdev->dev is assigned parent of root-hub by USB core, @@ -1705,7 +1715,7 @@ static int __devexit ehci_hsic_msm_remove(struct platform_device *pdev) struct msm_hsic_hcd *mehci = hcd_to_hsic(hcd); struct msm_hsic_host_platform_data *pdata = mehci->dev->platform_data; - if (pdata && pdata->swfi_latency) + if (pdata && pdata->standalone_latency) pm_qos_remove_request(&mehci->pm_qos_req_dma); if (mehci->peripheral_status_irq) diff --git a/drivers/video/msm/mdp4_overlay_dsi_video.c b/drivers/video/msm/mdp4_overlay_dsi_video.c index 29ddc86680cb..f4e35b2f8ee6 100644 --- a/drivers/video/msm/mdp4_overlay_dsi_video.c +++ b/drivers/video/msm/mdp4_overlay_dsi_video.c @@ -168,6 +168,8 @@ int mdp4_dsi_video_pipe_commit(int cndx, int wait) pipe = vctrl->base_pipe; mixer = pipe->mixer_num; + mdp_update_pm(vctrl->mfd, vctrl->vsync_time); + if (vp->update_cnt == 0) { mutex_unlock(&vctrl->update_lock); return cnt; @@ -1114,7 +1116,6 @@ void mdp4_dsi_video_overlay(struct msm_fb_data_type *mfd) mdp4_dsi_video_pipe_queue(0, pipe); } - mdp_update_pm(mfd, vsync_ctrl_db[0].vsync_time); mdp4_overlay_mdp_perf_upd(mfd, 1); cnt = 0; diff --git a/drivers/video/msm/mdp4_overlay_dtv.c b/drivers/video/msm/mdp4_overlay_dtv.c index 0968f3d51657..815542eadc20 100644 --- a/drivers/video/msm/mdp4_overlay_dtv.c +++ b/drivers/video/msm/mdp4_overlay_dtv.c @@ -81,6 +81,7 @@ static struct vsycn_ctrl { struct completion dmae_comp; struct completion vsync_comp; spinlock_t spin_lock; + struct msm_fb_data_type *mfd; struct mdp4_overlay_pipe *base_pipe; struct vsync_update vlist[2]; int vsync_irq_enabled; @@ -185,6 +186,8 @@ int mdp4_dtv_pipe_commit(int cndx, int wait) mixer = pipe->mixer_num; mdp4_overlay_iommu_unmap_freelist(mixer); + mdp_update_pm(vctrl->mfd, vctrl->vsync_time); + if (vp->update_cnt == 0) { mutex_unlock(&vctrl->update_lock); return 0; @@ -411,6 +414,9 @@ static int mdp4_dtv_start(struct msm_fb_data_type *mfd) int hsync_end_x; struct fb_info *fbi; struct fb_var_screeninfo *var; + struct vsycn_ctrl *vctrl; + + vctrl = &vsync_ctrl_db[0]; if (!mfd) return -ENODEV; @@ -421,6 +427,8 @@ static int mdp4_dtv_start(struct msm_fb_data_type *mfd) fbi = mfd->fbi; var = &fbi->var; + vctrl->mfd = mfd; + mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_ON, FALSE); if (hdmi_prim_display) { if (is_mdp4_hw_reset()) { @@ -1063,7 +1071,6 @@ void mdp4_dtv_overlay(struct msm_fb_data_type *mfd) pipe->srcp0_addr = (uint32)mfd->ibuf.buf; mdp4_dtv_pipe_queue(0, pipe); } - mdp_update_pm(mfd, vsync_ctrl_db[0].vsync_time); mutex_lock(&mfd->dma->ov_mutex); mdp4_overlay_mdp_perf_upd(mfd, 1); diff --git a/drivers/video/msm/mdp4_overlay_lcdc.c b/drivers/video/msm/mdp4_overlay_lcdc.c index b5e34f73b1be..0939d21b0393 100644 --- a/drivers/video/msm/mdp4_overlay_lcdc.c +++ b/drivers/video/msm/mdp4_overlay_lcdc.c @@ -172,6 +172,8 @@ int mdp4_lcdc_pipe_commit(int cndx, int wait) pipe = vctrl->base_pipe; mixer = pipe->mixer_num; + mdp_update_pm(vctrl->mfd, vctrl->vsync_time); + if (vp->update_cnt == 0) { mutex_unlock(&vctrl->update_lock); return 0; @@ -967,7 +969,6 @@ void mdp4_lcdc_overlay(struct msm_fb_data_type *mfd) mdp4_lcdc_pipe_queue(0, pipe); } - mdp_update_pm(mfd, vsync_ctrl_db[0].vsync_time); mdp4_overlay_mdp_perf_upd(mfd, 1); diff --git a/drivers/video/msm/vidc/1080p/resource_tracker/vcd_res_tracker.c b/drivers/video/msm/vidc/1080p/resource_tracker/vcd_res_tracker.c index 3ac396c111de..a10e7d8cbdef 100644 --- a/drivers/video/msm/vidc/1080p/resource_tracker/vcd_res_tracker.c +++ b/drivers/video/msm/vidc/1080p/resource_tracker/vcd_res_tracker.c @@ -27,8 +27,8 @@ #define PIL_FW_SIZE 0x200000 -static unsigned int vidc_clk_table[4] = { - 48000000, 133330000, 200000000, 228570000, +static unsigned int vidc_clk_table[5] = { + 48000000, 133330000, 200000000, 228570000, 266670000, }; static unsigned int restrk_mmu_subsystem[] = { MSM_SUBSYSTEM_VIDEO, MSM_SUBSYSTEM_VIDEO_FWARE}; @@ -629,7 +629,7 @@ u32 res_trk_set_perf_level(u32 req_perf_lvl, u32 *pn_set_perf_lvl, vidc_freq = vidc_clk_table[2]; *pn_set_perf_lvl = RESTRK_1080P_MAX_PERF_LEVEL; } else { - vidc_freq = vidc_clk_table[3]; + vidc_freq = vidc_clk_table[4]; *pn_set_perf_lvl = RESTRK_1080P_TURBO_PERF_LEVEL; } @@ -650,6 +650,10 @@ u32 res_trk_set_perf_level(u32 req_perf_lvl, u32 *pn_set_perf_lvl, VCDRES_MSG_MED("%s(): Setting vidc freq to %u\n", __func__, vidc_freq); if (!res_trk_sel_clk_rate(vidc_freq)) { + if (vidc_freq == vidc_clk_table[4]) { + if (res_trk_sel_clk_rate(vidc_clk_table[3])) + goto ret; + } VCDRES_MSG_ERROR("%s(): res_trk_sel_clk_rate FAILED\n", __func__); *pn_set_perf_lvl = 0; @@ -657,7 +661,7 @@ u32 res_trk_set_perf_level(u32 req_perf_lvl, u32 *pn_set_perf_lvl, } } #endif - VCDRES_MSG_MED("%s() set perl level : %d", __func__, *pn_set_perf_lvl); +ret: VCDRES_MSG_MED("%s() set perl level : %d", __func__, *pn_set_perf_lvl); return true; } diff --git a/include/linux/usb/msm_hsusb.h b/include/linux/usb/msm_hsusb.h index 82f91072594c..95980c7fc1d8 100644 --- a/include/linux/usb/msm_hsusb.h +++ b/include/linux/usb/msm_hsusb.h @@ -379,7 +379,12 @@ struct msm_hsic_host_platform_data { unsigned data; struct msm_bus_scale_pdata *bus_scale_table; unsigned log2_irq_thresh; + + /*swfi latency is required while driving resume on to the bus */ u32 swfi_latency; + + /*standalone latency is required when HSCI is active*/ + u32 standalone_latency; }; struct msm_usb_host_platform_data { diff --git a/sound/soc/msm/apq8064-i2s.c b/sound/soc/msm/apq8064-i2s.c index f57d686b3232..2b09886154cb 100644 --- a/sound/soc/msm/apq8064-i2s.c +++ b/sound/soc/msm/apq8064-i2s.c @@ -2799,7 +2799,8 @@ module_init(msm_audio_init); static void __exit msm_audio_exit(void) { - if (!cpu_is_apq8064() || (socinfo_get_id() == 130)) { + if (!(cpu_is_apq8064() || cpu_is_apq8064ab()) || + (socinfo_get_id() == 130)) { pr_err("%s: Not the right machine type\n", __func__); return ; } diff --git a/sound/soc/msm/apq8064.c b/sound/soc/msm/apq8064.c index e0094fa855a4..087c6dd46099 100644 --- a/sound/soc/msm/apq8064.c +++ b/sound/soc/msm/apq8064.c @@ -2041,7 +2041,8 @@ static int __init msm_audio_init(void) { int ret; u32 version = socinfo_get_platform_version(); - if (!cpu_is_apq8064() || (socinfo_get_id() == 130) || + if (!(cpu_is_apq8064() || cpu_is_apq8064ab()) || + (socinfo_get_id() == 130) || (machine_is_apq8064_mtp() && (SOCINFO_VERSION_MINOR(version) == 1))) { pr_info("%s: Not APQ8064 in SLIMBUS mode\n", __func__); @@ -2081,7 +2082,8 @@ module_init(msm_audio_init); static void __exit msm_audio_exit(void) { - if (!cpu_is_apq8064() || (socinfo_get_id() == 130)) { + if (!(cpu_is_apq8064() || cpu_is_apq8064ab()) || + (socinfo_get_id() == 130)) { pr_err("%s: Not the right machine type\n", __func__); return ; } |