Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dts: msm8974: Add support for Samsung Galaxy Note 3 #389

Merged
merged 4 commits into from
Jul 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Documentation/devices.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
- LG Google Nexus 5 - hammerhead D820, D821
- Motorola Moto X 2014 - victara
- OnePlus One - bacon <!--(use `lk2nd-msm8974-appended-dtb.img`)-->
- Samsung Galaxy Note 3 - SM-N9005
- Samsung Galaxy S5 - SM-G900F
- Samsung Galaxy S5 China LTE (Duos) - SM-G9006V/W, SM-G9008V/W, SM-G9009W
- Sony Xperia Z3 - leo
Expand Down
31 changes: 30 additions & 1 deletion lk2nd/device/dts/msm8974/samsung.dts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,40 @@
#include <lk2nd.dtsi>

/ {
qcom,msm-id = <0xC208FF01 10 0x10000>,
qcom,msm-id = <0x7E01FF01 7 0>,
<0xC208FF01 10 0x10000>,
<0xC208FF01 14 0x10000>;
};

&lk2nd {
/* rev 07 */

hlte {
model = "Samsung Galaxy Note 3 (SM-N9005)";
compatible = "samsung,hlte";
qcom,msm-id = <0x7E01FF01 7 0>;
lk2nd,match-bootloader = "N9005*";

lk2nd,dtb-files = "msm8974-samsung-hlte";

gpio-keys {
compatible = "gpio-keys";
home {
lk2nd,code = <KEY_HOME>;
gpios = <&pmic 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
};
down {
lk2nd,code = <KEY_VOLUMEDOWN>;
gpios = <&pmic 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
};

up {
lk2nd,code = <KEY_VOLUMEUP>;
gpios = <&pmic 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
};
};
};

/* rev 10 */

kltechn-unicom {
Expand Down
1 change: 1 addition & 0 deletions platform/msm8974/include/platform/iomap.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#define APCS_APC_KPSS_PLL_BASE (KPSS_BASE + 0x0000A000)
#define APCS_KPSS_CFG_BASE (KPSS_BASE + 0x00010000)
#define APCS_KPSS_WDT_BASE (KPSS_BASE + 0x00017000)
#define APCS_KPSS_WDT_EN (APCS_KPSS_WDT_BASE + 0x8)
#define KPSS_APCS_QTMR_AC_BASE (KPSS_BASE + 0x00020000)
#define KPSS_APCS_F0_QTMR_V1_BASE (KPSS_BASE + 0x00021000)
#define QTMR_BASE KPSS_APCS_F0_QTMR_V1_BASE
Expand Down
8 changes: 4 additions & 4 deletions platform/msm8974/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ int platform_is_8974(void)
return ret;
}

/* Check for 8974 PRO chip */
int platform_is_8974Pro(void)
/* Check for 8974Pro AC chip */
int platform_is_8974ac(void)
{
uint32_t platform = board_platform_id();
int ret = 0;
Expand All @@ -127,8 +127,8 @@ int platform_is_8974Pro(void)
return ret;
}

/* Check for 8974PRO AC chip */
int platform_is_8974ac(void)
/* Check for 8974Pro chip */
int platform_is_8974Pro(void)
{
uint32_t platform = board_platform_id();
int ret = 0;
Expand Down
12 changes: 8 additions & 4 deletions target/msm8974/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,16 +241,17 @@ static void target_mmc_sdhci_init(void)
* plan recommends to use the following frequencies:
* 200 MHz --> 192 MHZ
* 400 MHZ --> 384 MHZ
* only for emmc slot
* only for emmc (slot 1)
*/
if (platform_is_8974ac())
if (platform_is_8974ac()) {
config.max_clk_rate = MMC_CLK_192MHZ;
else
config.hs400_support = 1;
} else {
config.max_clk_rate = MMC_CLK_200MHZ;
}
config.sdhc_base = mmc_sdhci_base[config.slot - 1];
config.pwrctl_base = mmc_sdc_base[config.slot - 1];
config.pwr_irq = mmc_sdc_pwrctl_irq[config.slot - 1];
config.hs400_support = 1;

if (!(dev = mmc_init(&config))) {
/* Trying Slot 2 next */
Expand Down Expand Up @@ -359,6 +360,9 @@ void target_init(void)
#else
target_mmc_mci_init();
#endif

/* Disable Watchdog, if it was enabled by first bootloader. */
writel(0, APCS_KPSS_WDT_EN);
}

unsigned board_machtype(void)
Expand Down