From: strongtz Date: 星期天, 28 Jun 2020 03:14:11 +0000 (+0800) Subject: Fix dtb boot issues and add support for volume keys X-Git-Tag: v0.1.1 X-Git-Url: https://git.renegade-project.org/?a=commitdiff_plain;h=83903d3e477f6b45a8f8f9a3625511e5f9fa12c0;p=edk2-sdm845.git Fix dtb boot issues and add support for volume keys --- diff --git a/sdm845Pkg/FdtBlob/sdm845-xiaomi-polaris.dtb b/sdm845Pkg/FdtBlob/sdm845-xiaomi-polaris.dtb index 3dc62c0..2e19422 100644 Binary files a/sdm845Pkg/FdtBlob/sdm845-xiaomi-polaris.dtb and b/sdm845Pkg/FdtBlob/sdm845-xiaomi-polaris.dtb differ diff --git a/sdm845Pkg/FdtBlob/sdm845-xiaomi-polaris.dts b/sdm845Pkg/FdtBlob/sdm845-xiaomi-polaris.dts index 7797b31..8eaf37c 100644 --- a/sdm845Pkg/FdtBlob/sdm845-xiaomi-polaris.dts +++ b/sdm845Pkg/FdtBlob/sdm845-xiaomi-polaris.dts @@ -17,6 +17,9 @@ / { model = "Xiaomi MIX 2s"; compatible = "xiaomi,polaris", "qcom,sdm845"; + /* required for bootloader to select correct board */ + qcom,board-id = <0x2a 0x0>; + qcom,msm-id = <0x141 0x20001>; aliases { serial0 = &uart9; @@ -30,6 +33,45 @@ regulator-max-microvolt = <3700000>; }; + vbat: vbat-regulator { + compatible = "regulator-fixed"; + regulator-name = "VBAT"; + + vin-supply = <&vph_pwr>; + regulator-min-microvolt = <4200000>; + regulator-max-microvolt = <4200000>; + regulator-always-on; + }; + + vbat_som: vbat-som-regulator { + compatible = "regulator-fixed"; + regulator-name = "VBAT_SOM"; + + vin-supply = <&vph_pwr>; + regulator-min-microvolt = <4200000>; + regulator-max-microvolt = <4200000>; + regulator-always-on; + }; + + vdc_3v3: vdc-3v3-regulator { + compatible = "regulator-fixed"; + regulator-name = "VDC_3V3"; + vin-supply = <&vph_pwr>; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; + + vdc_5v: vdc-5v-regulator { + compatible = "regulator-fixed"; + regulator-name = "VDC_5V"; + + vin-supply = <&vph_pwr>; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <500000>; + regulator-always-on; + }; + vreg_tp_vddio: tp-vddio-vreg { regulator-always-on; compatible = "regulator-fixed"; @@ -54,8 +96,23 @@ vin-supply = <&vph_pwr>; }; + + gpio_keys { + compatible = "gpio-keys"; + autorepeat; + + pinctrl-names = "default"; + pinctrl-0 = <&vol_up_pin_a>; + + vol-up { + label = "Volume Up"; + linux,code = ; + gpios = <&pm8998_gpio 6 GPIO_ACTIVE_LOW>; + }; + }; }; + &apps_rsc { pm8998-rpmh-regulators { compatible = "qcom,pm8998-rpmh-regulators"; @@ -321,7 +378,7 @@ }; &apps_smmu { - /* Fuck this stupid thing */ + /* Enable this when upstream smmu driver gets patched */ status = "disabled"; }; @@ -331,21 +388,25 @@ ; }; +/* NFC */ // &i2c3 { // status = "okay"; // clock-frequency = <400000>; // }; +/* Audio DAC tas2559 */ // &i2c5 { // status = "okay"; // clock-frequency = <400000>; // }; +/* smb1355 and p9220 */ // &i2c10 { // status = "okay"; // clock-frequency = <400000>; // }; +/* touchscreen */ &i2c14 { status = "okay"; clock-frequency = <400000>; @@ -376,36 +437,23 @@ }; }; -&qup_i2c12_default { - drive-strength = <2>; - bias-disable; -}; - -&qup_i2c14_default { - drive-strength = <2>; - bias-disable; -}; - -&qup_uart6_default { - pinmux { - pins = "gpio45", "gpio46", "gpio47", "gpio48"; - function = "qup6"; - }; - - cts { - pins = "gpio45"; - bias-pull-down; - }; - - rts-tx { - pins = "gpio46", "gpio47"; - drive-strength = <2>; - bias-disable; +&pm8998_gpio { + vol_up_pin_a: vol-up-active { + pins = "gpio6"; + function = "normal"; + input-enable; + bias-pull-up; + qcom,drive-strength = ; }; +}; - rx { - pins = "gpio48"; +&pm8998_pon { + resin { + compatible = "qcom,pm8941-resin"; + interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>; + debounce = <15625>; bias-pull-up; + linux,code = ; }; }; @@ -447,3 +495,39 @@ vdda-phy-supply = <&vdda_ufs1_core>; vdda-pll-supply = <&vdda_ufs1_1p2>; }; + + +/* PINCTRL - additions to nodes defined in sdm845.dtsi */ + +&qup_i2c12_default { + drive-strength = <2>; + bias-disable; +}; + +&qup_i2c14_default { + drive-strength = <2>; + bias-disable; +}; + +&qup_uart6_default { + pinmux { + pins = "gpio45", "gpio46", "gpio47", "gpio48"; + function = "qup6"; + }; + + cts { + pins = "gpio45"; + bias-disable; + }; + + rts-tx { + pins = "gpio46", "gpio47"; + drive-strength = <2>; + bias-disable; + }; + + rx { + pins = "gpio48"; + bias-pull-up; + }; +};