diff --git a/dts/upstream/src/arm64/qcom/sm7150-samsung-a715f.dts b/dts/upstream/src/arm64/qcom/sm7150-samsung-a715f.dts new file mode 100644 index 000000000000..25eaee695f8a --- /dev/null +++ b/dts/upstream/src/arm64/qcom/sm7150-samsung-a715f.dts @@ -0,0 +1,829 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2023, Danila Tikhonov + */ + +/dts-v1/; + +#include +#include +#include +#include +#include +#include +#include + +#include "sm7150.dtsi" +#include "pm6150.dtsi" +#include "pm6150l.dtsi" + +/delete-node/ &camera_mem; +/delete-node/ &mpss_mem; +/delete-node/ &venus_mem; +/delete-node/ &cdsp_mem; +/delete-node/ &adsp_mem; +/delete-node/ &wlan_msa_mem; +/delete-node/ &npu_mem; +/delete-node/ &ipa_fw_mem; +/delete-node/ &ipa_gsi_mem; +/delete-node/ &gpu_mem; +/delete-node/ &sec_cdsp_mem; + +/* Increase the size */ +&tz_mem { + reg = <0x0 0x86200000 0x0 0x5600000>; +}; + +&qseecom_mem { + reg = <0x0 0x9e400000 0x0 0x2400000>; +}; + +/* Limit CPU clock to 2.2 GHz */ +&cpu6_opp14 { + status = "disabled"; +}; + +/ { + model = "Samsung Galaxy A71"; + compatible = "samsung,a715f", "qcom,sm7150"; + chassis-type = "handset"; + + qcom,msm-id = ; + qcom,board-id = <34 0>, /* Rev0.0 */ + <34 1>, /* Rev0.1 */ + <34 2>, /* Rev0.2 */ + <34 3>, /* Rev0.3 */ + <34 4>, /* Rev0.4 */ + <34 5>, /* Rev0.5 */ + <34 6>, /* Rev0.6 */ + <34 7>; /* Rev0.7 */ + + aliases { + bluetooth0 = &bluetooth; + hsuart0 = &uart3; + wifi0 = &wifi; + }; + + battery: battery { + compatible = "simple-battery"; + + voltage-min-design-microvolt = <3400000>; + voltage-max-design-microvolt = <4400000>; + charge-full-design-microamp-hours = <4500000>; + }; + + chosen { + #address-cells = <2>; + #size-cells = <2>; + ranges; + framebuffer@9c000000 { + compatible = "simple-framebuffer"; + reg = <0x0 0x9c000000 0x0 (1080 * 2400 * 4)>; + width = <1080>; + height = <2400>; + stride = <(1080 * 4)>; + format = "a8r8g8b8"; + clocks = <&gcc GCC_DISP_HF_AXI_CLK>; + }; + }; + + gpio_keys: gpio-keys { + compatible = "gpio-keys"; + pinctrl-names = "default"; + pinctrl-0 = <&vol_up_n>; + + key-volume-up { + label = "Volume Up"; + linux,code = ; + gpios = <&pm6150l_gpios 2 GPIO_ACTIVE_LOW>; + debounce-interval = <15>; + }; + }; + + reserved-memory { + camera_mem: memory@8cb00000 { + reg = <0x0 0x8cb00000 0x0 0x500000>; + no-map; + }; + + mpss_mem: memory@8d000000 { + reg = <0x0 0x8d000000 0x0 0x8c00000>; + no-map; + }; + + venus_mem: memory@95c00000 { + reg = <0x0 0x95c00000 0x0 0x500000>; + no-map; + }; + + cdsp_mem: memory@96100000 { + reg = <0x0 0x96100000 0x0 0x1e00000>; + no-map; + }; + + adsp_mem: memory@97f00000 { + reg = <0x0 0x97f00000 0x0 0x2800000>; + no-map; + }; + + wlan_msa_mem: memory@9a700000 { + reg = <0x0 0x9a700000 0x0 0x180000>; + no-map; + }; + + npu_mem: memory@9a880000 { + reg = <0x0 0x9a880000 0x0 0x80000>; + no-map; + }; + + ipa_fw_mem: memory@9a900000 { + reg = <0x0 0x9a900000 0x0 0x10000>; + no-map; + }; + + ipa_gsi_mem: memory@9a910000 { + reg = <0x0 0x9a910000 0x0 0x5000>; + no-map; + }; + + gpu_mem: memory@9a915000 { + reg = <0x0 0x9a915000 0x0 0x2000>; + no-map; + }; + + framebuffer_region@9c000000 { + reg = <0x0 0x9c000000 0x0 (1080 * 2400 * 4)>; + no-map; + }; + + ramoops@a1300000 { + compatible = "ramoops"; + reg = <0x0 0xa1300000 0x0 0x100000>; + + record-size = <0x40000>; + pmsg-size = <0x40000>; + console-size = <0x40000>; + }; + + sec_cdsp_mem: memory@a4000000 { + reg = <0x0 0xa4000000 0x0 0xc00000>; + no-map; + }; + + rmtfs_mem: memory@fe301000 { + compatible = "qcom,rmtfs-mem"; + reg = <0 0xfe301000 0 0x200000>; + no-map; + + qcom,client-id = <1>; + qcom,vmid = <15>; + }; + }; +}; + +&apps_rsc { + regulators-0 { + compatible = "qcom,pm6150-rpmh-regulators"; + qcom,pmic-id = "a"; + + vreg_s4a_1p1: smps4 { + regulator-min-microvolt = <824000>; + regulator-max-microvolt = <1120000>; + }; + + vreg_s5a_2p0: smps5 { + regulator-min-microvolt = <1744000>; + regulator-max-microvolt = <2040000>; + }; + + vreg_l1a_1p2: ldo1 { + regulator-min-microvolt = <1096000>; + regulator-max-microvolt = <1304000>; + regulator-initial-mode = ; + regulator-allow-set-load; + regulator-allowed-modes = ; + }; + + vreg_l2a_1p0: ldo2 { + regulator-min-microvolt = <944000>; + regulator-max-microvolt = <1056000>; + regulator-initial-mode = ; + regulator-allow-set-load; + regulator-allowed-modes = ; + }; + + vreg_l3a_1p0: ldo3 { + regulator-min-microvolt = <968000>; + regulator-max-microvolt = <1064000>; + regulator-initial-mode = ; + regulator-allow-set-load; + regulator-allowed-modes = ; + }; + + vreg_l4a_0p88: ldo4 { + regulator-min-microvolt = <824000>; + regulator-max-microvolt = <920000>; + regulator-initial-mode = ; + regulator-allow-set-load; + regulator-allowed-modes = ; + }; + + vreg_l5a_2p7: ldo5 { + regulator-min-microvolt = <2600000>; + regulator-max-microvolt = <2800000>; + regulator-initial-mode = ; + regulator-allow-set-load; + regulator-allowed-modes = ; + }; + + vreg_l6a_1p2: ldo6 { + regulator-min-microvolt = <1096000>; + regulator-max-microvolt = <1304000>; + regulator-initial-mode = ; + regulator-allow-set-load; + regulator-allowed-modes = ; + }; + + vreg_l9a_0p8: ldo9 { + regulator-min-microvolt = <624000>; + regulator-max-microvolt = <760000>; + regulator-initial-mode = ; + regulator-allow-set-load; + regulator-allowed-modes = ; + }; + + vreg_l10a_1p8: ldo10 { + regulator-min-microvolt = <1720000>; + regulator-max-microvolt = <1832000>; + regulator-initial-mode = ; + regulator-allow-set-load; + regulator-allowed-modes = ; + }; + + vreg_l11a_1p8: ldo11 { + regulator-min-microvolt = <1696000>; + regulator-max-microvolt = <1984000>; + regulator-initial-mode = ; + regulator-allow-set-load; + regulator-allowed-modes = ; + }; + + vreg_l12a_1p8: ldo12 { + regulator-min-microvolt = <1696000>; + regulator-max-microvolt = <1952000>; + regulator-initial-mode = ; + regulator-allow-set-load; + regulator-allowed-modes = ; + }; + + vreg_l13a_1p8: ldo13 { + regulator-min-microvolt = <1696000>; + regulator-max-microvolt = <1904000>; + regulator-initial-mode = ; + regulator-allow-set-load; + regulator-allowed-modes = ; + }; + + vreg_l14a_1p8: ldo14 { + regulator-min-microvolt = <1720000>; + regulator-max-microvolt = <1856000>; + regulator-initial-mode = ; + regulator-allow-set-load; + regulator-allowed-modes = ; + }; + + vreg_l15a_1p8: ldo15 { + regulator-min-microvolt = <1696000>; + regulator-max-microvolt = <1904000>; + regulator-initial-mode = ; + regulator-allow-set-load; + regulator-allowed-modes = ; + }; + + vreg_l16a_2p8: ldo16 { + regulator-min-microvolt = <2424000>; + regulator-max-microvolt = <2976000>; + regulator-initial-mode = ; + regulator-allow-set-load; + regulator-allowed-modes = ; + }; + + vreg_l17a_3p1: ldo17 { + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3232000>; + regulator-initial-mode = ; + regulator-allow-set-load; + regulator-allowed-modes = ; + }; + + vreg_l18a_2p8: ldo18 { + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <3000000>; + regulator-initial-mode = ; + regulator-allow-set-load; + regulator-allowed-modes = ; + }; + + vreg_l19a_2p85: ldo19 { + regulator-min-microvolt = <2944000>; + regulator-max-microvolt = <3304000>; + regulator-initial-mode = ; + regulator-allow-set-load; + regulator-allowed-modes = ; + }; + }; + + regulators-1 { + compatible = "qcom,pm6150l-rpmh-regulators"; + qcom,pmic-id = "c"; + + vreg_s1c_1p13: smps1 { + regulator-min-microvolt = <1000000>; + regulator-max-microvolt = <1200000>; + }; + + vreg_s8c_1p35: smps8 { + regulator-min-microvolt = <1120000>; + regulator-max-microvolt = <1408000>; + }; + + vreg_l1c_1p8: ldo1 { + regulator-min-microvolt = <1616000>; + regulator-max-microvolt = <1984000>; + regulator-initial-mode = ; + regulator-allow-set-load; + regulator-allowed-modes = ; + }; + + vreg_l2c_1p3: ldo2 { + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1352000>; + regulator-initial-mode = ; + regulator-allow-set-load; + regulator-allowed-modes = ; + }; + + vreg_l3c_1p23: ldo3 { + regulator-min-microvolt = <1144000>; + regulator-max-microvolt = <1256000>; + regulator-initial-mode = ; + regulator-allow-set-load; + regulator-allowed-modes = ; + }; + + vreg_l4c_1p8: ldo4 { + regulator-min-microvolt = <1648000>; + regulator-max-microvolt = <2950000>; + regulator-initial-mode = ; + regulator-allow-set-load; + regulator-allowed-modes = ; + }; + + vreg_l5c_1p8: ldo5 { + regulator-min-microvolt = <1648000>; + regulator-max-microvolt = <2950000>; + regulator-initial-mode = ; + regulator-allow-set-load; + regulator-allowed-modes = ; + }; + + vreg_l6c_3p0: ldo6 { + regulator-min-microvolt = <1648000>; + regulator-max-microvolt = <3100000>; + regulator-initial-mode = ; + regulator-allow-set-load; + regulator-allowed-modes = ; + }; + + vreg_l7c_3p0: ldo7 { + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3312000>; + regulator-initial-mode = ; + regulator-allow-set-load; + regulator-allowed-modes = ; + }; + + vreg_l8c_1p8: ldo8 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1900000>; + regulator-initial-mode = ; + regulator-allow-set-load; + regulator-allowed-modes = ; + }; + + /* + * Downstream specifies a range of 2950-3312mV. + * Tighten the range to 2950-3100mV. + */ + vreg_l9c_3p1: ldo9 { + regulator-min-microvolt = <2950000>; + regulator-max-microvolt = <3100000>; + regulator-initial-mode = ; + regulator-allow-set-load; + regulator-allowed-modes = ; + }; + + vreg_l10c_3p3: ldo10 { + regulator-min-microvolt = <3200000>; + regulator-max-microvolt = <3312000>; + regulator-initial-mode = ; + regulator-allow-set-load; + regulator-allowed-modes = ; + }; + + vreg_l11c_3p3: ldo11 { + regulator-min-microvolt = <2950000>; + regulator-max-microvolt = <3400000>; + regulator-initial-mode = ; + regulator-allow-set-load; + regulator-allowed-modes = ; + }; + + vreg_bob: bob { + regulator-min-microvolt = <3296000>; + regulator-max-microvolt = <3960000>; + regulator-initial-mode = ; + regulator-allow-bypass; + }; + }; +}; + +&dispcc { + status = "okay"; +}; + +&gpi_dma0 { + status = "okay"; +}; + +// If enabled device crashes. It might be directly this device or a dependent +&gpi_dma1 { + status = "okay"; +}; + +&gpu { + zap-shader { + firmware-name = "qcom/sm7150/a715f/a615_zap.mbn"; + }; +}; + +&i2c0 { + clock-frequency = <100000>; + status = "okay"; +}; + +&i2c2 { + clock-frequency = <1000000>; + status = "okay"; +}; + +&i2c7 { + clock-frequency = <100000>; + status = "okay"; +}; + +&i2c9 { + clock-frequency = <100000>; + status = "okay"; +}; + +&ipa { + memory-region = <&ipa_fw_mem>; + firmware-name = "qcom/sm7150/a715f/ipa_fws.mbn"; + status = "okay"; +}; + +&mdss { + status = "okay"; +}; + +&mdss_dsi0 { + vdda-supply = <&vreg_l3c_1p23>; + status = "okay"; + + panel@0 { + compatible = "mdss,s6e3fa9-amb667um06"; + reg = <0>; + + reset-gpios = <&pm6150l_gpios 9 GPIO_ACTIVE_LOW>; + + pinctrl-0 = <&sde_te_active &sde_dsi_active &sde_esd_active &sde_ub_det_active>; + pinctrl-names = "default"; + + vddio-supply = <&vreg_l13a_1p8>; + vdd3p3-supply = <&vreg_l18a_2p8>; + + port { + panel_in: endpoint { + remote-endpoint = <&mdss_dsi0_out>; + }; + }; + }; +}; + +&mdss_dsi0_out { + data-lanes = <0 1 2 3>; + remote-endpoint = <&panel_in>; + status = "okay"; +}; + +&mdss_dsi0_phy { + // vdda-0p9-supply = <0x1a1>; + vdda-supply = <&vreg_l4a_0p88>; + status = "okay"; +}; + +&pm6150_qgauge { + monitored-battery = <&battery>; + status = "okay"; +}; + +&pm6150_resin { + linux,code = ; + status = "okay"; +}; + +&pm6150_rtc { + status = "okay"; +}; + +&pm6150_typec { + vdd-vbus-supply = <&pm6150_vbus>; + vdd-pdphy-supply = <&vreg_l17a_3p1>; + status = "okay"; + + connector { + compatible = "usb-c-connector"; + + power-role = "source"; + data-role = "dual"; + self-powered; + + source-pdos = ; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + pm6150_role_switch_in: endpoint { + remote-endpoint = <&usb_1_dwc3_hs>; + }; + }; + }; + }; +}; + +&pm6150_vbus { + regulator-min-microamp = <500000>; + regulator-max-microamp = <3000000>; + status = "okay"; +}; + +&pm6150l_gpios { + vol_up_n: vol-up-n-state { + pins = "gpio2"; + function = PMIC_GPIO_FUNC_NORMAL; + input-enable; + bias-pull-up; + power-source = <0>; + }; +}; + +&qup_spi1_spi { + drive-strength = <6>; + bias-disable; +}; + +&qup_spi1_cs_gpio { + drive-strength = <6>; + bias-disable; +}; + +&qupv3_id_0 { + status = "okay"; +}; + +&qupv3_id_1 { + status = "okay"; +}; + +&remoteproc_adsp { + firmware-name = "qcom/sm7150/a715f/adsp.mbn"; + status = "okay"; +}; + +&remoteproc_cdsp { + firmware-name = "qcom/sm7150/a715f/cdsp.mbn"; + status = "okay"; +}; + +&remoteproc_mpss { + firmware-name = "qcom/sm7150/a715f/modem.mbn"; + status = "okay"; +}; + +&sdhc_2 { + cd-gpios = <&tlmm 69 GPIO_ACTIVE_HIGH>; + + vmmc-supply = <&vreg_l9c_3p1>; + vqmmc-supply = <&vreg_l6c_3p0>; + + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&sdc2_on>; + pinctrl-1 = <&sdc2_off>; + + // When enabled the display turns off at start and does not turn on again + // status = "okay"; +}; + +&tlmm { + gpio-reserved-ranges = <0 4>, <59 4>, <83 2>; + + sde_te_active: sde-te-state { + pins = "gpio10"; + function = "mdp_vsync"; + drive-strength = <0x02>; + bias-pull-down; + }; + + sde_dsi_active: sde-dsi-state { + pins = "gpio11", "gpio64"; + function = "gpio"; + drive-strength = <0x08>; + bias-disable = <0x00>; + }; + + sde_esd_active: sde-esd-state { + pins = "gpio63"; + function = "gpio"; + drive-strength = <0x08>; + bias-disable = <0x00>; + }; + + sde_ub_det_active: sde-ub-det-state { + pins = "gpio66"; + function = "gpio"; + drive-strength = <0x02>; + bias-disable = <0x00>; + }; + + sdc2_on: sdc2-on-state { + clk-pins { + pins = "sdc2_clk"; + bias-disable; + drive-strength = <16>; + }; + + cmd-pins { + pins = "sdc2_cmd"; + bias-pull-up; + drive-strength = <10>; + }; + + data-pins { + pins = "sdc2_data"; + bias-pull-up; + drive-strength = <10>; + }; + + sd-cd-pins { + pins = "gpio69"; + function = "gpio"; + bias-pull-up; + drive-strength = <2>; + }; + }; + + sdc2_off: sdc1-off-state { + clk-pins { + pins = "sdc2_clk"; + bias-disable; + drive-strength = <2>; + }; + + cmd-pins { + pins = "sdc2_cmd"; + bias-pull-up; + drive-strength = <2>; + }; + + data-pins { + pins = "sdc2_data"; + bias-pull-up; + drive-strength = <2>; + }; + + sd-cd-pins { + pins = "gpio69"; + function = "gpio"; + bias-pull-up; + drive-strength = <2>; + }; + }; +}; + +&uart3 { + /delete-property/interrupts; + interrupts-extended = <&intc GIC_SPI 604 IRQ_TYPE_LEVEL_HIGH>, + <&tlmm 41 IRQ_TYPE_EDGE_FALLING>; + pinctrl-names = "default", "sleep"; + pinctrl-1 = <&qup_uart3_default>; + status = "okay"; + + // NOTE: needs this after every reboot: 'sudo btmgmt --index 0 public-addr 00:11:22:33:44:55' + // see: https://matrix.to/#/!IeSVTOYowpUldDcgJO:matrix.org/$SrXjQ6LfPBMPk-qDWwhQDPtVsgR-8gJTnSDKPATnVNU?via=matrix.org&via=tchncs.de&via=nitro.chat + bluetooth: bluetooth { + compatible = "qcom,wcn3990-bt"; + + vddio-supply = <&vreg_l10a_1p8>; + vddxo-supply = <&vreg_l1c_1p8>; + vddrf-supply = <&vreg_l2c_1p3>; + vddch0-supply = <&vreg_l10c_3p3>; + max-speed = <3200000>; // TODO: copied; still need to verify + }; +}; + +&ufs_mem_hc { + vcc-supply = <&vreg_l19a_2p85>; + vcc-max-microamp = <600000>; + vccq2-supply = <&vreg_l12a_1p8>; + vccq2-max-microamp = <600000>; + status = "okay"; +}; + +&ufs_mem_phy { + vdda-phy-supply = <&vreg_l4a_0p88>; + vdda-pll-supply = <&vreg_l3c_1p23>; + vdda-phy-max-microamp = <62900>; + vdda-pll-max-microamp = <18300>; + status = "okay"; +}; + +&usb_1 { + qcom,select-utmi-as-pipe-clk; + status = "okay"; +}; + +&usb_1_dwc3 { + dr_mode = "otg"; + usb-role-switch; + maximum-speed = "high-speed"; +}; + +&usb_1_dwc3_hs { + remote-endpoint = <&pm6150_role_switch_in>; +}; + +&usb_1_hsphy { + vdd-supply = <&vreg_l4a_0p88>; + vdda-pll-supply = <&vreg_l11a_1p8>; + vdda-phy-dpdm-supply = <&vreg_l17a_3p1>; + status = "okay"; +}; + +&venus { + firmware-name = "qcom/sm7150/a715f/venus.mbn"; +}; + +// TODO: wifi is disabled until it doesn't crash the modem remote processor anymore. +&wifi { + vdd-0.8-cx-mx-supply = <&vreg_l9a_0p8>; + vdd-1.8-xo-supply = <&vreg_l1c_1p8>; + vdd-1.3-rfa-supply = <&vreg_l2c_1p3>; + vdd-3.3-ch0-supply = <&vreg_l10c_3p3>; + // vdd-3.3-ch1-supply; + vdd-3.3-ch1-supply = <&vreg_l11c_3p3>; // NOTE: downstream does not define any supply for ch1 + // firmware-name = "qcom/sm7150/a715f/wlanmdsp.mbn"; + status = "disabled"; +};