arm64: dts: mediatek: mt8195-demo: fix the memory size to 8GB
Subsystems (3)
PATCH 1/4 arm64: dts: mediatek: mt8195-demo: fix the memory size to 8GB
The onboard dram of mt8195-demo board is 8GB.
--- arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/mediatek/mt8195-demo.dts +1 -1
@@ -48,7 +48,7 @@ memory@40000000 { device_type = "memory"; - reg = <0 0x40000000 0 0x80000000>; + reg = <0 0x40000000 0x2 0x00000000>; }; reserved-memory {
Signature · 1 line
2.18.0
PATCH 2/4 arm64: dts: mediatek: mt8195-demo: update and reorder reserved memory regions
The dts file of the MediaTek MT8195 demo board has been updated to include new reserved memory regions.
These reserved memory regions are:
- SCP
- VPU,
- Sound DMA
- APU.
These regions are defined with the "shared-dma-pool" compatible property. In addition, the existing reserved memory regions have been reordered by their addresses to improve readability and maintainability of the DTS file.
--- arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 38 ++++++++++++++++---- 1 file changed, 32 insertions(+), 6 deletions(-)
arch/arm64/boot/dts/mediatek/mt8195-demo.dts +32 -6
@@ -56,12 +56,6 @@ #size-cells = <2>; ranges; - /* 2 MiB reserved for ARM Trusted Firmware (BL31) */ - bl31_secmon_reserved: secmon@54600000 { - no-map; - reg = <0 0x54600000 0x0 0x200000>; - }; - /* 12 MiB reserved for OP-TEE (BL32) * +-----------------------+ 0x43e0_0000 * | SHMEM 2MiB |
@@ -75,6 +69,38 @@ no-map; reg = <0 0x43200000 0 0x00c00000>; }; + + scp_mem: memory@50000000 { + compatible = "shared-dma-pool"; + reg = <0 0x50000000 0 0x2900000>; + no-map; + }; + + vpu_mem: memory@53000000 { + compatible = "shared-dma-pool"; + size = <0 0x1400000>; /* 20 MB */ + alignment = <0 0x10000>; + reg = <0 0x53000000 0 0x1400000>; + }; + + /* 2 MiB reserved for ARM Trusted Firmware (BL31) */ + bl31_secmon_mem: memory@54600000 { + no-map; + reg = <0 0x54600000 0x0 0x200000>; + }; + + snd_dma_mem: memory@60000000 { + compatible = "shared-dma-pool"; + reg = <0 0x60000000 0 0x1100000>; + no-map; + }; + + apu_mem: memory@62000000 { + compatible = "shared-dma-pool"; + size = <0 0x1400000>; /* 20 MB */ + alignment = <0 0x10000>; + reg = <0 0x62000000 0 0x1400000>; + }; }; };
Signature · 1 line
2.18.0
PATCH 3/4 arm64: dts: mediatek: mt6360: add PMIC MT6360 related nodes
In reply to Macpaul LinMT6360 is the secondary PMIC for MT8195.
It supports USB Type-C and PD functions.
Add MT6360 related common nodes which is used for MT8195 platform, includes
- charger
- ADC
- LED
- regulators
--- arch/arm64/boot/dts/mediatek/mt6360.dtsi | 112 +++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 arch/arm64/boot/dts/mediatek/mt6360.dtsi
arch/arm64/boot/dts/mediatek/mt6360.dtsi new file +112 -0
@@ -0,0 +1,112 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) +/* + * Copyright (C) 2023 MediaTek Inc. + */ + +#include <dt-bindings/regulator/mediatek,mt6360-regulator.h> + +&mt6360 { + interrupt-controller; + interrupt-parent = <&pio>; + interrupt-names = "IRQB"; + + charger { + compatible = "mediatek,mt6360-chg"; + richtek,vinovp-microvolt = <14500000>; + + otg_vbus_regulator: usb-otg-vbus-regulator { + regulator-compatible = "usb-otg-vbus"; + regulator-name = "usb-otg-vbus"; + regulator-min-microvolt = <4425000>; + regulator-max-microvolt = <5825000>; + }; + }; + + adc { + compatible = "mediatek,mt6360-adc"; + #io-channel-cells = <1>; + }; + + led { + compatible = "mediatek,mt6360-led"; + }; + + regulator { + compatible = "mediatek,mt6360-regulator"; + LDO_VIN3-supply = <&mt6360_buck2>; + + mt6360_buck1: buck1 { + regulator-compatible = "BUCK1"; + regulator-name = "mt6360,buck1"; + regulator-min-microvolt = <300000>; + regulator-max-microvolt = <1300000>; + regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP + MT6360_OPMODE_ULP>; + }; + + mt6360_buck2: buck2 { + regulator-compatible = "BUCK2"; + regulator-name = "mt6360,buck2"; + regulator-min-microvolt = <300000>; + regulator-max-microvolt = <1300000>; + regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP + MT6360_OPMODE_ULP>; + }; + + mt6360_ldo1: ldo1 { + regulator-compatible = "LDO1"; + regulator-name = "mt6360,ldo1"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <3600000>; + regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP>; + }; + + mt6360_ldo2: ldo2 { + regulator-compatible = "LDO2"; + regulator-name = "mt6360,ldo2"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <3600000>; + regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP>; + }; + + mt6360_ldo3: ldo3 { + regulator-compatible = "LDO3"; + regulator-name = "mt6360,ldo3"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <3600000>; + regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP>; + }; + + mt6360_ldo5: ldo5 { + regulator-compatible = "LDO5"; + regulator-name = "mt6360,ldo5"; + regulator-min-microvolt = <2700000>; + regulator-max-microvolt = <3600000>; + regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP>; + }; + + mt6360_ldo6: ldo6 { + regulator-compatible = "LDO6"; + regulator-name = "mt6360,ldo6"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <2100000>; + regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP>; + }; + + mt6360_ldo7: ldo7 { + regulator-compatible = "LDO7"; + regulator-name = "mt6360,ldo7"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <2100000>; + regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP>; + }; + }; +};
Signature · 1 line
2.18.0
Re: [PATCH 3/4] arm64: dts: mediatek: mt6360: add PMIC MT6360 related nodes
Quoted 51 lines · Macpaul Lin
MT6360 is the secondary PMIC for MT8195.
It supports USB Type-C and PD functions.
Add MT6360 related common nodes which is used for MT8195 platform, includes
- charger
- ADC
- LED
- regulatorsSigned-off-by Macpaul Lin <[email protected]>--- arch/arm64/boot/dts/mediatek/mt6360.dtsi | 112 +++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 arch/arm64/boot/dts/mediatek/mt6360.dtsiarch/arm64/boot/dts/mediatek/mt6360.dtsi new file +30
-0@@ -0,0 +1,112 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) +/* + * Copyright (C) 2023 MediaTek Inc. + */ + +#include <dt-bindings/regulator/mediatek,mt6360-regulator.h> + +&mt6360 { + interrupt-controller; + interrupt-parent = <&pio>; + interrupt-names = "IRQB"; + + charger { + compatible = "mediatek,mt6360-chg"; + richtek,vinovp-microvolt = <14500000>; + + otg_vbus_regulator: usb-otg-vbus-regulator { + regulator-compatible = "usb-otg-vbus"; + regulator-name = "usb-otg-vbus"; + regulator-min-microvolt = <4425000>; + regulator-max-microvolt = <5825000>; + }; + }; + + adc { + compatible = "mediatek,mt6360-adc"; + #io-channel-cells = <1>; + }; + + led {
arch/arm64/boot/dts/mediatek/mt6360.dtsi line 40
Quoted 10 lines
arch/arm64/boot/dts/mediatek/mt6360.dtsi new file +10
-0+ compatible = "mediatek,mt6360-led"; + }; + + regulator { + compatible = "mediatek,mt6360-regulator"; + LDO_VIN3-supply = <&mt6360_buck2>; + + mt6360_buck1: buck1 { + regulator-compatible = "BUCK1"; + regulator-name = "mt6360,buck1";
Normally there's no need to provide a default name. Any used regulator should have been named to match the power rail name from the board's schematics.
arch/arm64/boot/dts/mediatek/mt6360.dtsi line 42
Quoted 2 lines
arch/arm64/boot/dts/mediatek/mt6360.dtsi new file +2
-0+ regulator-min-microvolt = <300000>; + regulator-max-microvolt = <1300000>;
These values correspond to the regulator's range. They make no sense as regulator constraints. The min/max values are supposed to be the most restrictive set of voltages of the regulator consumers. If what is fed by this regulator can only take 0.7V ~ 1.1V, then it should save 0.7V and 1.1V here. If the regulator is unused, then there are no constraints, and these can be left out.
Just leave them out of the file.
Both comments apply to all the regulators.
ChenYu
Quoted 74 lines
arch/arm64/boot/dts/mediatek/mt6360.dtsi new file +70
-1+ regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP + MT6360_OPMODE_ULP>; + }; + + mt6360_buck2: buck2 { + regulator-compatible = "BUCK2"; + regulator-name = "mt6360,buck2"; + regulator-min-microvolt = <300000>; + regulator-max-microvolt = <1300000>; + regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP + MT6360_OPMODE_ULP>; + }; + + mt6360_ldo1: ldo1 { + regulator-compatible = "LDO1"; + regulator-name = "mt6360,ldo1"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <3600000>; + regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP>; + }; + + mt6360_ldo2: ldo2 { + regulator-compatible = "LDO2"; + regulator-name = "mt6360,ldo2"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <3600000>; + regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP>; + }; + + mt6360_ldo3: ldo3 { + regulator-compatible = "LDO3"; + regulator-name = "mt6360,ldo3"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <3600000>; + regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP>; + }; + + mt6360_ldo5: ldo5 { + regulator-compatible = "LDO5"; + regulator-name = "mt6360,ldo5"; + regulator-min-microvolt = <2700000>; + regulator-max-microvolt = <3600000>; + regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP>; + }; + + mt6360_ldo6: ldo6 { + regulator-compatible = "LDO6"; + regulator-name = "mt6360,ldo6"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <2100000>; + regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP>; + }; + + mt6360_ldo7: ldo7 { + regulator-compatible = "LDO7"; + regulator-name = "mt6360,ldo7"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <2100000>; + regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP>; + }; + }; +}; --2.18.0
Re: [PATCH 3/4] arm64: dts: mediatek: mt6360: add PMIC MT6360 related nodes
Quoted 17 lines · Chen-Yu Tsai
External email : Please do not click links or open attachments until you have verified the sender or the content.
Quoted 12 lines · Macpaul Lin
MT6360 is the secondary PMIC for MT8195.
It supports USB Type-C and PD functions.
Add MT6360 related common nodes which is used for MT8195 platform, includes
- charger
- ADC
- LED
- regulatorsSigned-off-by Macpaul Lin <[email protected]>--- arch/arm64/boot/dts/mediatek/mt6360.dtsi | 112 +++++++++++++++++++++++
[snip..]
Quoted 8 lines
arch/arm64/boot/dts/mediatek/mt6360.dtsi line 40
Quoted 7 lines
arch/arm64/boot/dts/mediatek/mt6360.dtsi new file +7
-0+ regulator { + compatible = "mediatek,mt6360-regulator"; + LDO_VIN3-supply = <&mt6360_buck2>; + + mt6360_buck1: buck1 { + regulator-compatible = "BUCK1"; + regulator-name = "mt6360,buck1";
Quoted 4 lines
Normally there's no need to provide a default name. Any used regulator should have been named to match the power rail name from the board's schematics.
I have 2 schematics on hand. One is mt8195-demo board and the other is genio-1200-evk board. There are 2 PMIC used on these board with "the same" sub power rail name for "BUCK1~BUCK4". One is mt6315, and the other is mt6360.
I've also inspected other dtsi of the regulators, such as mt6357 and mt6359. They have regulator nodes with named for their purpose. For the
schematics of mt8195-demo and genio-1200-evk boards, there are no explicit usage for "BUCK1~BUCK4" for both mt6135 and mt6360. In order to specify the sub power rail for mt6360, MediaTek chooses name like "mt6360,buck1" instead of simple name "buck1" for distinguish with "buck1" of mt6351.
Quoted 10 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+ regulator-min-microvolt = <300000>; + regulator-max-microvolt = <1300000>;These values correspond to the regulator's range. They make no sense as regulator constraints. The min/max values are supposed to be the most restrictive set of voltages of the regulator consumers. If what is fed by this regulator can only take 0.7V ~ 1.1V, then it should save 0.7V and 1.1V here. If the regulator is unused, then there are no constraints, and these can be left out.
Quoted 5 lines
Just leave them out of the file.
Both comments apply to all the regulators.
ChenYu
There are some common circuit design for these regulators like mt6359, mt6360 and mt6315 used on many products. MediaTek put the most common and expected default values in their dtsi. However, some changes still need to be applied to derivative boards according to product's requirements. The actual value be used will be applied in board's dts file to override the default settings in dtsi.
The regulator node "mt6360,ldo6" is not used by mt8195-demo and genio-1200-evk. I'll remove it in the next version. Thanks for the review.
Quoted 65 lines
Quoted 65 lines
arch/arm64/boot/dts/mediatek/mt6360.dtsi new file +65
-0+ regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP + MT6360_OPMODE_ULP>; + }; + + mt6360_buck2: buck2 { + regulator-compatible = "BUCK2"; + regulator-name = "mt6360,buck2"; + regulator-min-microvolt = <300000>; + regulator-max-microvolt = <1300000>; + regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP + MT6360_OPMODE_ULP>; + }; + + mt6360_ldo1: ldo1 { + regulator-compatible = "LDO1"; + regulator-name = "mt6360,ldo1"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <3600000>; + regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP>; + }; + + mt6360_ldo2: ldo2 { + regulator-compatible = "LDO2"; + regulator-name = "mt6360,ldo2"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <3600000>; + regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP>; + }; + + mt6360_ldo3: ldo3 { + regulator-compatible = "LDO3"; + regulator-name = "mt6360,ldo3"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <3600000>; + regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP>; + }; + + mt6360_ldo5: ldo5 { + regulator-compatible = "LDO5"; + regulator-name = "mt6360,ldo5"; + regulator-min-microvolt = <2700000>; + regulator-max-microvolt = <3600000>; + regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP>; + }; + + mt6360_ldo6: ldo6 { + regulator-compatible = "LDO6"; + regulator-name = "mt6360,ldo6"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <2100000>; + regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP>; + }; + + mt6360_ldo7: ldo7 { + regulator-compatible = "LDO7"; + regulator-name = "mt6360,ldo7"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <2100000>;
Quoted 8 lines
Quoted 8 lines
arch/arm64/boot/dts/mediatek/mt6360.dtsi new file +5
-1+ regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP>; + }; + }; +}; --2.18.0
Best regards,
Macpaul Lin.
Re: [PATCH 3/4] arm64: dts: mediatek: mt6360: add PMIC MT6360 related nodes
Quoted 37 lines · Macpaul Lin
Quoted 18 lines · Chen-Yu Tsai
External email : Please do not click links or open attachments until you have verified the sender or the content.
Quoted 12 lines · Macpaul Lin
MT6360 is the secondary PMIC for MT8195.
It supports USB Type-C and PD functions.
Add MT6360 related common nodes which is used for MT8195 platform, includes
- charger
- ADC
- LED
- regulatorsSigned-off-by Macpaul Lin <[email protected]>--- arch/arm64/boot/dts/mediatek/mt6360.dtsi | 112 +++++++++++++++++++++++[snip..]
Quoted 8 lines
arch/arm64/boot/dts/mediatek/mt6360.dtsi line 40
Quoted 7 lines
arch/arm64/boot/dts/mediatek/mt6360.dtsi new file +7
-0+ regulator { + compatible = "mediatek,mt6360-regulator"; + LDO_VIN3-supply = <&mt6360_buck2>; + + mt6360_buck1: buck1 { + regulator-compatible = "BUCK1"; + regulator-name = "mt6360,buck1";Quoted 4 lines
Normally there's no need to provide a default name. Any used regulator should have been named to match the power rail name from the board's schematics.
Quoted 4 lines
I have 2 schematics on hand. One is mt8195-demo board and the other is genio-1200-evk board. There are 2 PMIC used on these board with "the same" sub power rail name for "BUCK1~BUCK4". One is mt6315, and the other is mt6360.
This is more of an board level integration thing. Regulator names are expected to be named after the actual power rail names. For example, take a look at Rock Pi 4 schematics [1], the power rail from BUCK1 of the RK808 PMIC is named "VDD_CENTER". And in the dts file [1] we can see the regulator is named that as well (albeit with some style changes).
Now if a project really chooses meaningless names like BUCKx or LDOy for their power rails, then so be it. However those are board level decisions. The names are there to help with integration debugging, so it makes sense to have names that match the power rail names in the schematics. Default names rarely make sense.
[1] https://dl.radxa.com/rockpi4/docs/hw/rockpi4/rockpi4_v13_sch_20181112.pdf
[2] https://elixir.bootlin.com/linux/latest/source/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi#L267
Quoted 22 lines
I've also inspected other dtsi of the regulators, such as mt6357 and mt6359. They have regulator nodes with named for their purpose. For the schematics of mt8195-demo and genio-1200-evk boards, there are no explicit usage for "BUCK1~BUCK4" for both mt6135 and mt6360. In order to specify the sub power rail for mt6360, MediaTek chooses name like "mt6360,buck1" instead of simple name "buck1" for distinguish with "buck1" of mt6351.
Quoted 14 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+ regulator-min-microvolt = <300000>; + regulator-max-microvolt = <1300000>;These values correspond to the regulator's range. They make no sense as regulator constraints. The min/max values are supposed to be the most restrictive set of voltages of the regulator consumers. If what is fed by this regulator can only take 0.7V ~ 1.1V, then it should save 0.7V and 1.1V here. If the regulator is unused, then there are no constraints, and these can be left out.
Just leave them out of the file.
Both comments apply to all the regulators.
Quoted 8 lines
Quoted 1 line
ChenYu
There are some common circuit design for these regulators like mt6359, mt6360 and mt6315 used on many products. MediaTek put the most common and expected default values in their dtsi. However, some changes still need to be applied to derivative boards according to product's requirements. The actual value be used will be applied in board's dts file to override the default settings in dtsi.
The values here are definitely not some product's expected values. They are the full range of output voltages supported, as seen in the driver.
The regulator binding says:
regulator-min-microvolt:
description: smallest voltage consumers may set
regulator-max-microvolt:
description: largest voltage consumers may set
The constraints given in the regulator node are those of the consumers, not the PMIC regulator itself. As you mentioned, a board may need to adjust the range based on its design, i.e. what the board has connected to the regulator.
So either something is connected, and the consumer's constraints are set by overriding the default in the board .dts file; or, nothing is connected and the constraints don't matter, as nothing is going to set the voltage or enable the regulator. So there's no reason to give a default. For unused regulator outputs, their device nodes don't even have to exist.
I'm trying to get people to _not_ write default values, as they don't make any sense. The full voltage range is already implied by the compatible string.
ChenYu
Quoted 80 lines
The regulator node "mt6360,ldo6" is not used by mt8195-demo and genio-1200-evk. I'll remove it in the next version. Thanks for the review.
Quoted 65 lines
Quoted 65 lines
arch/arm64/boot/dts/mediatek/mt6360.dtsi new file +65
-0+ regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP + MT6360_OPMODE_ULP>; + }; + + mt6360_buck2: buck2 { + regulator-compatible = "BUCK2"; + regulator-name = "mt6360,buck2"; + regulator-min-microvolt = <300000>; + regulator-max-microvolt = <1300000>; + regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP + MT6360_OPMODE_ULP>; + }; + + mt6360_ldo1: ldo1 { + regulator-compatible = "LDO1"; + regulator-name = "mt6360,ldo1"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <3600000>; + regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP>; + }; + + mt6360_ldo2: ldo2 { + regulator-compatible = "LDO2"; + regulator-name = "mt6360,ldo2"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <3600000>; + regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP>; + }; + + mt6360_ldo3: ldo3 { + regulator-compatible = "LDO3"; + regulator-name = "mt6360,ldo3"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <3600000>; + regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP>; + }; + + mt6360_ldo5: ldo5 { + regulator-compatible = "LDO5"; + regulator-name = "mt6360,ldo5"; + regulator-min-microvolt = <2700000>; + regulator-max-microvolt = <3600000>; + regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP>; + }; + + mt6360_ldo6: ldo6 { + regulator-compatible = "LDO6"; + regulator-name = "mt6360,ldo6"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <2100000>; + regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP>; + }; + + mt6360_ldo7: ldo7 { + regulator-compatible = "LDO7"; + regulator-name = "mt6360,ldo7"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <2100000>;Quoted 8 lines
Quoted 8 lines
arch/arm64/boot/dts/mediatek/mt6360.dtsi new file +5
-1+ regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP>; + }; + }; +}; --2.18.0
Best regards,
Macpaul Lin.
Re: [PATCH 3/4] arm64: dts: mediatek: mt6360: add PMIC MT6360 related nodes
Quoted 116 lines · Chen-Yu Tsai
External email : Please do not click links or open attachments until you have verified the sender or the content.
Quoted 37 lines · Macpaul Lin
Quoted 18 lines · Chen-Yu Tsai
External email : Please do not click links or open attachments until you have verified the sender or the content.
Quoted 12 lines · Macpaul Lin
MT6360 is the secondary PMIC for MT8195.
It supports USB Type-C and PD functions.
Add MT6360 related common nodes which is used for MT8195 platform, includes
- charger
- ADC
- LED
- regulatorsSigned-off-by Macpaul Lin <[email protected]>--- arch/arm64/boot/dts/mediatek/mt6360.dtsi | 112 +++++++++++++++++++++++[snip..]
Quoted 8 lines
arch/arm64/boot/dts/mediatek/mt6360.dtsi line 40
Quoted 7 lines
arch/arm64/boot/dts/mediatek/mt6360.dtsi new file +7
-0+ regulator { + compatible = "mediatek,mt6360-regulator"; + LDO_VIN3-supply = <&mt6360_buck2>; + + mt6360_buck1: buck1 { + regulator-compatible = "BUCK1"; + regulator-name = "mt6360,buck1";Quoted 4 lines
Normally there's no need to provide a default name. Any used regulator should have been named to match the power rail name from the board's schematics.
Quoted 4 lines
I have 2 schematics on hand. One is mt8195-demo board and the other is genio-1200-evk board. There are 2 PMIC used on these board with "the same" sub power rail name for "BUCK1~BUCK4". One is mt6315, and the other is mt6360.
This is more of an board level integration thing. Regulator names are expected to be named after the actual power rail names. For example, take a look at Rock Pi 4 schematics [1], the power rail from BUCK1 of the RK808 PMIC is named "
VDD_CENTER". And in the dts file [1] we can see the regulator is named that as well (albeit with some style changes).Now if a project really chooses meaningless names like BUCKx or LDOy for their power rails, then so be it. However those are board level decisions. The names are there to help with integration debugging, so it makes sense to have names that match the power rail names in the schematics. Default names rarely make sense.
[1]https://dl.radxa.com/rockpi4/docs/hw/rockpi4/rockpi4_v13_sch_20181112.pdf <https://urldefense.com/v3/__https://dl.radxa.com/rockpi4/docs/hw/rockpi4/rockpi4_v13_sch_20181112.pdf__;!!CTRNKA9wMg0ARbw!g4T6kWfnETA38Kc_yc6dx6gYi7zzW2m6YU0ybNN5vbTWjK5SfapEQEQMrtxg8E9xRNdpJm678Rj3uLrWHeM$>
[2]https://elixir.bootlin.com/linux/latest/source/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi#L267 <https://urldefense.com/v3/__https://elixir.bootlin.com/linux/latest/source/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi*L267__;Iw!!CTRNKA9wMg0ARbw!g4T6kWfnETA38Kc_yc6dx6gYi7zzW2m6YU0ybNN5vbTWjK5SfapEQEQMrtxg8E9xRNdpJm678Rj3hdwm0VA$>Quoted 22 lines
I've also inspected other dtsi of the regulators, such as mt6357 and mt6359. They have regulator nodes with named for their purpose. For the schematics of mt8195-demo and genio-1200-evk boards, there are no explicit usage for "BUCK1~BUCK4" for both mt6135 and mt6360. In order to specify the sub power rail for mt6360, MediaTek chooses name like "mt6360,buck1" instead of simple name "buck1" for distinguish with "buck1" of mt6351.
Quoted 14 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+ regulator-min-microvolt = <300000>; + regulator-max-microvolt = <1300000>;These values correspond to the regulator's range. They make no sense as regulator constraints. The min/max values are supposed to be the most restrictive set of voltages of the regulator consumers. If what is fed by this regulator can only take 0.7V ~ 1.1V, then it should save 0.7V and 1.1V here. If the regulator is unused, then there are no constraints, and these can be left out.
Just leave them out of the file.
Alexandre Mergnat <[email protected]>
Both comments apply to all the regulators.Quoted 8 lines
Quoted 1 line
ChenYu
There are some common circuit design for these regulators like mt6359, mt6360 and mt6315 used on many products. MediaTek put the most common and expected default values in their dtsi. However, some changes still need to be applied to derivative boards according to product's requirements. The actual value be used will be applied in board's dts file to override the default settings in dtsi.
The values here are definitely not some product's expected values. They are the full range of output voltages supported, as seen in the driver.
The regulator binding says:
regulator-min-microvolt:
description: smallest voltage consumers may setregulator-max-microvolt:
description: largest voltage consumers may setThe constraints given in the regulator node are those of the consumers, not the PMIC regulator itself. As you mentioned, a board may need to adjust the range based on its design, i.e. what the board has connected to the regulator.
So either something is connected, and the consumer's constraints are set by overriding the default in the board .dts file; or, nothing is connected and the constraints don't matter, as nothing is going to set the voltage or enable the regulator. So there's no reason to give a default. For unused regulator outputs, their device nodes don't even have to exist.
Quoted 5 lines
I'm trying to get people to _not_ write default values, as they don't make any sense. The full voltage range is already implied by the compatible string.
ChenYu
Thanks for the explanation in detail.
I'll update the patch v2 for these modification.
Best regards,
Macpaul Lin
PATCH 4/4 arm64: dts: mediatek: mt8195-demo: simplify mt6360 nodes
In reply to Macpaul LinThe dts file for the MediaTek MT8195 demo board has been refactored to improve the configuration of the MT6360 multi-function PMIC.
The changes include:
- Addition of the mt6360.dtsi include file, which contains the common configuration of the MT6360 for all mt8195 boards.
- Removal of the direct inclusion of the mt6360-regulator.h file.
- Removal of the detailed configuration of the MT6360 PMIC since the included mt6360.dtsi is used.
--- arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 136 ++++++------------- 1 file changed, 39 insertions(+), 97 deletions(-)
arch/arm64/boot/dts/mediatek/mt8195-demo.dts +39 -97
@@ -11,7 +11,6 @@ #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/input/input.h> #include <dt-bindings/pinctrl/mt8195-pinfunc.h> -#include <dt-bindings/regulator/mediatek,mt6360-regulator.h> / { model = "MediaTek MT8195 demo board";
@@ -130,103 +129,9 @@ mt6360: pmic@34 { compatible = "mediatek,mt6360"; reg = <0x34>; - interrupt-controller; + pinctrl-0 = <&mt6360_pins>; + pinctrl-names = "default"; interrupts-extended = <&pio 101 IRQ_TYPE_EDGE_FALLING>; - interrupt-names = "IRQB"; - - charger { - compatible = "mediatek,mt6360-chg"; - richtek,vinovp-microvolt = <14500000>; - - otg_vbus_regulator: usb-otg-vbus-regulator { - regulator-compatible = "usb-otg-vbus"; - regulator-name = "usb-otg-vbus"; - regulator-min-microvolt = <4425000>; - regulator-max-microvolt = <5825000>; - }; - }; - - regulator { - compatible = "mediatek,mt6360-regulator"; - LDO_VIN3-supply = <&mt6360_buck2>; - - mt6360_buck1: buck1 { - regulator-compatible = "BUCK1"; - regulator-name = "mt6360,buck1"; - regulator-min-microvolt = <300000>; - regulator-max-microvolt = <1300000>; - regulator-allowed-modes = <MT6360_OPMODE_NORMAL - MT6360_OPMODE_LP - MT6360_OPMODE_ULP>; - regulator-always-on; - }; - - mt6360_buck2: buck2 { - regulator-compatible = "BUCK2"; - regulator-name = "mt6360,buck2"; - regulator-min-microvolt = <300000>; - regulator-max-microvolt = <1300000>; - regulator-allowed-modes = <MT6360_OPMODE_NORMAL - MT6360_OPMODE_LP - MT6360_OPMODE_ULP>; - regulator-always-on; - }; - - mt6360_ldo1: ldo1 { - regulator-compatible = "LDO1"; - regulator-name = "mt6360,ldo1"; - regulator-min-microvolt = <1200000>; - regulator-max-microvolt = <3600000>; - regulator-allowed-modes = <MT6360_OPMODE_NORMAL - MT6360_OPMODE_LP>; - }; - - mt6360_ldo2: ldo2 { - regulator-compatible = "LDO2"; - regulator-name = "mt6360,ldo2"; - regulator-min-microvolt = <1200000>; - regulator-max-microvolt = <3600000>; - regulator-allowed-modes = <MT6360_OPMODE_NORMAL - MT6360_OPMODE_LP>; - }; - - mt6360_ldo3: ldo3 { - regulator-compatible = "LDO3"; - regulator-name = "mt6360,ldo3"; - regulator-min-microvolt = <1200000>; - regulator-max-microvolt = <3600000>; - regulator-allowed-modes = <MT6360_OPMODE_NORMAL - MT6360_OPMODE_LP>; - }; - - mt6360_ldo5: ldo5 { - regulator-compatible = "LDO5"; - regulator-name = "mt6360,ldo5"; - regulator-min-microvolt = <2700000>; - regulator-max-microvolt = <3600000>; - regulator-allowed-modes = <MT6360_OPMODE_NORMAL - MT6360_OPMODE_LP>; - }; - - mt6360_ldo6: ldo6 { - regulator-compatible = "LDO6"; - regulator-name = "mt6360,ldo6"; - regulator-min-microvolt = <500000>; - regulator-max-microvolt = <2100000>; - regulator-allowed-modes = <MT6360_OPMODE_NORMAL - MT6360_OPMODE_LP>; - }; - - mt6360_ldo7: ldo7 { - regulator-compatible = "LDO7"; - regulator-name = "mt6360,ldo7"; - regulator-min-microvolt = <500000>; - regulator-max-microvolt = <2100000>; - regulator-allowed-modes = <MT6360_OPMODE_NORMAL - MT6360_OPMODE_LP>; - regulator-always-on; - }; - }; }; };
@@ -300,6 +205,34 @@ regulator-always-on; }; +#include "mt6360.dtsi" + +/* For EMI_VDD2 */ +&mt6360_buck1 { + regulator-always-on; +}; + +/* For EMI_VDDQ */ +&mt6360_buck2 { + regulator-always-on; +}; + +&mt6360_ldo1 { + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + regulator-always-on; +}; + +&mt6360_ldo2 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; +}; + +/* For EMI_VMDDR_EN */ +&mt6360_ldo7 { + regulator-always-on; +}; + &pio { eth_default_pins: eth-default-pins { pins-txd {
@@ -496,6 +429,15 @@ <PINMUX_GPIO103__FUNC_URXD1>; }; }; + + mt6360_pins: mt6360-pins { + pins { + pinmux = <PINMUX_GPIO100__FUNC_GPIO100>, + <PINMUX_GPIO101__FUNC_GPIO101>; + input-enable; + bias-pull-up; + }; + }; };
Signature · 1 line
2.18.0
PATCH v2 1/4 arm64: dts: mediatek: mt8195-demo: fix the memory size to 8GB
In reply to Macpaul LinThe onboard dram of mt8195-demo board is 8GB.
--- arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Changes for v2:
- No change.
arch/arm64/boot/dts/mediatek/mt8195-demo.dts +1 -1
@@ -48,7 +48,7 @@ memory@40000000 { device_type = "memory"; - reg = <0 0x40000000 0 0x80000000>; + reg = <0 0x40000000 0x2 0x00000000>; }; reserved-memory {
Signature · 1 line
2.18.0
PATCH v2 2/4 arm64: dts: mediatek: mt8195-demo: update and reorder reserved memory regions
The dts file of the MediaTek MT8195 demo board has been updated to include new reserved memory regions.
These reserved memory regions are:
- SCP
- VPU,
- Sound DMA
- APU.
These regions are defined with the "shared-dma-pool" compatible property. In addition, the existing reserved memory regions have been reordered by their addresses to improve readability and maintainability of the DTS file.
--- arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 38 ++++++++++++++++---- 1 file changed, 32 insertions(+), 6 deletions(-)
Changes for v2:
- No change.
arch/arm64/boot/dts/mediatek/mt8195-demo.dts +32 -6
@@ -56,12 +56,6 @@ #size-cells = <2>; ranges; - /* 2 MiB reserved for ARM Trusted Firmware (BL31) */ - bl31_secmon_reserved: secmon@54600000 { - no-map; - reg = <0 0x54600000 0x0 0x200000>; - }; - /* 12 MiB reserved for OP-TEE (BL32) * +-----------------------+ 0x43e0_0000 * | SHMEM 2MiB |
@@ -75,6 +69,38 @@ no-map; reg = <0 0x43200000 0 0x00c00000>; }; + + scp_mem: memory@50000000 { + compatible = "shared-dma-pool"; + reg = <0 0x50000000 0 0x2900000>; + no-map; + }; + + vpu_mem: memory@53000000 { + compatible = "shared-dma-pool"; + size = <0 0x1400000>; /* 20 MB */ + alignment = <0 0x10000>; + reg = <0 0x53000000 0 0x1400000>; + }; + + /* 2 MiB reserved for ARM Trusted Firmware (BL31) */ + bl31_secmon_mem: memory@54600000 { + no-map; + reg = <0 0x54600000 0x0 0x200000>; + }; + + snd_dma_mem: memory@60000000 { + compatible = "shared-dma-pool"; + reg = <0 0x60000000 0 0x1100000>; + no-map; + }; + + apu_mem: memory@62000000 { + compatible = "shared-dma-pool"; + size = <0 0x1400000>; /* 20 MB */ + alignment = <0 0x10000>; + reg = <0 0x62000000 0 0x1400000>; + }; }; };
Signature · 1 line
2.18.0
PATCH v2 3/4 arm64: dts: mediatek: mt6360: add PMIC MT6360 related nodes
In reply to Macpaul LinMT6360 is the secondary PMIC for MT8195.
It supports USB Type-C and PD functions.
Add MT6360 related common nodes which is used for MT8195 platform, includes
- charger
- ADC
- LED
- regulators
--- arch/arm64/boot/dts/mediatek/mt6360.dtsi | 85 ++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 arch/arm64/boot/dts/mediatek/mt6360.dtsi
Change for v2:
- Remove the following properties according to Chen-Yu Tsai's suggestion
- regulator-name
- regulator-min-microvolt
- regulator-max-microvolt
arch/arm64/boot/dts/mediatek/mt6360.dtsi new file +85 -0
@@ -0,0 +1,85 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) +/* + * Copyright (C) 2023 MediaTek Inc. + */ + +#include <dt-bindings/regulator/mediatek,mt6360-regulator.h> + +&mt6360 { + interrupt-controller; + interrupt-parent = <&pio>; + interrupt-names = "IRQB"; + + charger { + compatible = "mediatek,mt6360-chg"; + richtek,vinovp-microvolt = <14500000>; + + otg_vbus_regulator: usb-otg-vbus-regulator { + regulator-compatible = "usb-otg-vbus"; + }; + }; + + adc { + compatible = "mediatek,mt6360-adc"; + #io-channel-cells = <1>; + }; + + led { + compatible = "mediatek,mt6360-led"; + }; + + regulator { + compatible = "mediatek,mt6360-regulator"; + LDO_VIN3-supply = <&mt6360_emi_vddq_buck2_reg>; + + mt6360_emi_vdd2_buck1_reg: buck1-emi-vdd2 { + regulator-compatible = "BUCK1"; + regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP + MT6360_OPMODE_ULP>; + }; + + mt6360_emi_vddq_buck2_reg: buck2-emi-vddq { + regulator-compatible = "BUCK2"; + regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP + MT6360_OPMODE_ULP>; + }; + + mt6360_tp1_p3v0_ldo1_reg: ldo1-tp1-p3v0 { + regulator-compatible = "LDO1"; + regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP>; + }; + + mt6360_panel1_p1v8_ldo2_reg: ldo2-panel1-p1v8 { + regulator-compatible = "LDO2"; + regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP>; + }; + + mt6360_vmc_pmu_ldo3_reg: ldo3-vmc-pmu { + regulator-compatible = "LDO3"; + regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP>; + }; + + mt6360_vmch_pmu_ldo5_reg: ldo5-vmch-pmu { + regulator-compatible = "LDO5"; + regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP>; + }; + + mt6360_ldo6_reg: ldo6-mt6360 { + regulator-compatible = "LDO6"; + regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP>; + }; + + mt6360_emi_vmddr_en_ldo7_reg: ldo7-emi-vmddr-en { + regulator-compatible = "LDO7"; + regulator-allowed-modes = <MT6360_OPMODE_NORMAL + MT6360_OPMODE_LP>; + }; + }; +};
Signature · 1 line
2.18.0
Re: [PATCH v2 3/4] arm64: dts: mediatek: mt6360: add PMIC MT6360 related nodes
arch/arm64/boot/dts/mediatek/mt6360.dtsi line 35
Quoted 10 lines · Macpaul Lin
arch/arm64/boot/dts/mediatek/mt6360.dtsi new file +10
-0+ + led { + compatible = "mediatek,mt6360-led"; + }; + + regulator { + compatible = "mediatek,mt6360-regulator"; + LDO_VIN3-supply = <&mt6360_emi_vddq_buck2_reg>; + + mt6360_emi_vdd2_buck1_reg: buck1-emi-vdd2 {
It does not look like you tested the DTS against bindings. Please run make dtbs_check W=1 (see Documentation/devicetree/bindings/writing-schema.rst or
https://www.linaro.org/blog/tips-and-tricks-for-validating-devicetree-sources-with-the-devicetree-schema/
for instructions).
Best regards,
Krzysztof
Re: [PATCH v2 3/4] arm64: dts: mediatek: mt6360: add PMIC MT6360 related nodes
Quoted 22 lines · Krzysztof Kozlowski
External email : Please do not click links or open attachments until you have verified the sender or the content.
arch/arm64/boot/dts/mediatek/mt6360.dtsi line 35
Quoted 10 lines · Macpaul Lin
arch/arm64/boot/dts/mediatek/mt6360.dtsi new file +10
-0+ +led { +compatible = "mediatek,mt6360-led"; +}; + +regulator { +compatible = "mediatek,mt6360-regulator"; +LDO_VIN3-supply = <&mt6360_emi_vddq_buck2_reg>; + +mt6360_emi_vdd2_buck1_reg: buck1-emi-vdd2 {It does not look like you tested the DTS against bindings. Please run
make dtbs_check W=1(seeDocumentation/devicetree/bindings/writing-schema.rstor
https://www.linaro.org/blog/tips-and-tricks-for-validating-devicetree-sources-with-the-devicetree-schema/ <https://urldefense.com/v3/__https://www.linaro.org/blog/tips-and-tricks-for-validating-devicetree-sources-with-the-devicetree-schema/__;!!CTRNKA9wMg0ARbw!nP-6nVffZXG2NCdjcl06my5g9HAohnT-GF-EIGrMWpegsBvwmqgOjfVQba5Ub13z_AWAJwGOlsQ3DSIWGo0ojHlPvDZ74WE$>
for instructions).
Quoted 4 lines
Best regards,
Krzysztof
Thanks for the review.
Since next patch 4/4 of the patch set to modify mt6360 nodes in mt8195-demo.dts is no longer required, please drop this patch, too.
Thanks
Macpaul Lin
PATCH v2 4/4 arm64: dts: mediatek: mt8195-demo: simplify mt6360 nodes
In reply to Macpaul LinThe dts file for the MediaTek MT8195 demo board has been refactored to improve the configuration of the MT6360 multi-function PMIC.
The changes include:
- Addition of the mt6360.dtsi include file, which contains the common configuration of the MT6360 for all mt8195 boards.
- Removal of the direct inclusion of the mt6360-regulator.h file.
- Removal of the common configuration of the MT6360 PMIC since the included mt6360.dtsi is used.
- Add names according to the schematic of mt8195-demo board for mt6360 nodes.
--- arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 173 ++++++++----------- 1 file changed, 74 insertions(+), 99 deletions(-)
arch/arm64/boot/dts/mediatek/mt8195-demo.dts +74 -99
@@ -11,7 +11,6 @@ #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/input/input.h> #include <dt-bindings/pinctrl/mt8195-pinfunc.h> -#include <dt-bindings/regulator/mediatek,mt6360-regulator.h> / { model = "MediaTek MT8195 demo board";
@@ -130,103 +129,9 @@ mt6360: pmic@34 { compatible = "mediatek,mt6360"; reg = <0x34>; - interrupt-controller; + pinctrl-0 = <&mt6360_pins>; + pinctrl-names = "default"; interrupts-extended = <&pio 101 IRQ_TYPE_EDGE_FALLING>; - interrupt-names = "IRQB"; - - charger { - compatible = "mediatek,mt6360-chg"; - richtek,vinovp-microvolt = <14500000>; - - otg_vbus_regulator: usb-otg-vbus-regulator { - regulator-compatible = "usb-otg-vbus"; - regulator-name = "usb-otg-vbus"; - regulator-min-microvolt = <4425000>; - regulator-max-microvolt = <5825000>; - }; - }; - - regulator { - compatible = "mediatek,mt6360-regulator"; - LDO_VIN3-supply = <&mt6360_buck2>; - - mt6360_buck1: buck1 { - regulator-compatible = "BUCK1"; - regulator-name = "mt6360,buck1"; - regulator-min-microvolt = <300000>; - regulator-max-microvolt = <1300000>; - regulator-allowed-modes = <MT6360_OPMODE_NORMAL - MT6360_OPMODE_LP - MT6360_OPMODE_ULP>; - regulator-always-on; - }; - - mt6360_buck2: buck2 { - regulator-compatible = "BUCK2"; - regulator-name = "mt6360,buck2"; - regulator-min-microvolt = <300000>; - regulator-max-microvolt = <1300000>; - regulator-allowed-modes = <MT6360_OPMODE_NORMAL - MT6360_OPMODE_LP - MT6360_OPMODE_ULP>; - regulator-always-on; - }; - - mt6360_ldo1: ldo1 { - regulator-compatible = "LDO1"; - regulator-name = "mt6360,ldo1"; - regulator-min-microvolt = <1200000>; - regulator-max-microvolt = <3600000>; - regulator-allowed-modes = <MT6360_OPMODE_NORMAL - MT6360_OPMODE_LP>; - }; - - mt6360_ldo2: ldo2 { - regulator-compatible = "LDO2"; - regulator-name = "mt6360,ldo2"; - regulator-min-microvolt = <1200000>; - regulator-max-microvolt = <3600000>; - regulator-allowed-modes = <MT6360_OPMODE_NORMAL - MT6360_OPMODE_LP>; - }; - - mt6360_ldo3: ldo3 { - regulator-compatible = "LDO3"; - regulator-name = "mt6360,ldo3"; - regulator-min-microvolt = <1200000>; - regulator-max-microvolt = <3600000>; - regulator-allowed-modes = <MT6360_OPMODE_NORMAL - MT6360_OPMODE_LP>; - }; - - mt6360_ldo5: ldo5 { - regulator-compatible = "LDO5"; - regulator-name = "mt6360,ldo5"; - regulator-min-microvolt = <2700000>; - regulator-max-microvolt = <3600000>; - regulator-allowed-modes = <MT6360_OPMODE_NORMAL - MT6360_OPMODE_LP>; - }; - - mt6360_ldo6: ldo6 { - regulator-compatible = "LDO6"; - regulator-name = "mt6360,ldo6"; - regulator-min-microvolt = <500000>; - regulator-max-microvolt = <2100000>; - regulator-allowed-modes = <MT6360_OPMODE_NORMAL - MT6360_OPMODE_LP>; - }; - - mt6360_ldo7: ldo7 { - regulator-compatible = "LDO7"; - regulator-name = "mt6360,ldo7"; - regulator-min-microvolt = <500000>; - regulator-max-microvolt = <2100000>; - regulator-allowed-modes = <MT6360_OPMODE_NORMAL - MT6360_OPMODE_LP>; - regulator-always-on; - }; - }; }; };
@@ -259,8 +164,8 @@ cap-sd-highspeed; sd-uhs-sdr50; sd-uhs-sdr104; - vmmc-supply = <&mt6360_ldo5>; - vqmmc-supply = <&mt6360_ldo3>; + vmmc-supply = <&mt6360_vmch_pmu_ldo5_reg>; + vqmmc-supply = <&mt6360_vmc_pmu_ldo3_reg>; status = "okay"; };
@@ -300,6 +205,67 @@ regulator-always-on; }; +#include "mt6360.dtsi" + +&otg_vbus_regulator { + regulator-name = "usb-otg-vbus"; + regulator-min-microvolt = <4425000>; + regulator-max-microvolt = <5825000>; +}; + +&mt6360_emi_vdd2_buck1_reg { + regulator-name = "emi_vdd2"; + regulator-min-microvolt = <300000>; + regulator-max-microvolt = <1300000>; + regulator-always-on; +}; + +&mt6360_emi_vddq_buck2_reg { + regulator-name = "emi_vddq"; + regulator-min-microvolt = <300000>; + regulator-max-microvolt = <1300000>; + regulator-always-on; +}; + +&mt6360_tp1_p3v0_ldo1_reg { + regulator-name = "tp1_p3v0"; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + regulator-always-on; +}; + +&mt6360_panel1_p1v8_ldo2_reg { + regulator-name = "panel1_p1v8"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; +}; + +&mt6360_vmc_pmu_ldo3_reg { + regulator-name = "vmc_pmu"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <3600000>; +}; + +&mt6360_vmch_pmu_ldo5_reg { + regulator-name = "vmch_pmu"; + regulator-min-microvolt = <2700000>; + regulator-max-microvolt = <3600000>; +}; + +/* measure point on board */ +&mt6360_ldo6_reg { + regulator-name = "mt6360_ldo6"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <2100000>; +}; + +&mt6360_emi_vmddr_en_ldo7_reg { + regulator-name = "emi_vmddr_en"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <2100000>; + regulator-always-on; +}; + &pio { eth_default_pins: eth-default-pins { pins-txd {
@@ -496,6 +462,15 @@ <PINMUX_GPIO103__FUNC_URXD1>; }; }; + + mt6360_pins: mt6360-pins { + pins { + pinmux = <PINMUX_GPIO100__FUNC_GPIO100>, + <PINMUX_GPIO101__FUNC_GPIO101>; + input-enable; + bias-pull-up; + }; + }; };
Signature · 1 line
2.18.0
Re: [PATCH v2 4/4] arm64: dts: mediatek: mt8195-demo: simplify mt6360 nodes
Quoted 46 lines · Macpaul Lin
The dts file for the MediaTek MT8195 demo board has been refactored to improve the configuration of the MT6360 multi-function PMIC.
The changes include:
- Addition of themt6360.dtsiinclude file, which contains the common configuration of the MT6360 for all mt8195 boards.
- Removal of the direct inclusion of themt6360-regulator.hfile.
- Removal of the common configuration of the MT6360 PMIC since the includedmt6360.dtsiis used.
- Add names according to the schematic of mt8195-demo board for mt6360 nodes.Signed-off-by Macpaul Lin <[email protected]>--- arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 173 ++++++++----------- 1 file changed, 74 insertions(+), 99 deletions(-)arch/arm64/boot/dts/mediatek/mt8195-demo.dts +2
-11@@ -11,7 +11,6 @@ #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/input/input.h> #include <dt-bindings/pinctrl/mt8195-pinfunc.h> -#include <dt-bindings/regulator/mediatek,mt6360-regulator.h> / { model = "MediaTek MT8195 demo board";@@ -130,103 +129,9 @@ mt6360: pmic@34 { compatible = "mediatek,mt6360"; reg = <0x34>; - interrupt-controller; + pinctrl-0 = <&mt6360_pins>; + pinctrl-names = "default"; interrupts-extended = <&pio 101 IRQ_TYPE_EDGE_FALLING>; - interrupt-names = "IRQB"; - - charger { - compatible = "mediatek,mt6360-chg"; - richtek,vinovp-microvolt = <14500000>; - - otg_vbus_regulator: usb-otg-vbus-regulator { - regulator-compatible = "usb-otg-vbus"; - regulator-name = "usb-otg-vbus";
arch/arm64/boot/dts/mediatek/mt8195-demo.dts line 153
Quoted 10 lines
arch/arm64/boot/dts/mediatek/mt8195-demo.dts +0
-10- regulator-min-microvolt = <4425000>; - regulator-max-microvolt = <5825000>; - }; - }; - - regulator { - compatible = "mediatek,mt6360-regulator"; - LDO_VIN3-supply = <&mt6360_buck2>; - - mt6360_buck1: buck1 {
Your patchset does not look bisectable. Does not look tested, either... Why having duplicated regulators (?) and then removing correct regulators and keeping wrong ones?
Quoted 9 lines
arch/arm64/boot/dts/mediatek/mt8195-demo.dts +0
-9- regulator-compatible = "BUCK1"; - regulator-name = "mt6360,buck1"; - regulator-min-microvolt = <300000>; - regulator-max-microvolt = <1300000>; - regulator-allowed-modes = <MT6360_OPMODE_NORMAL - MT6360_OPMODE_LP - MT6360_OPMODE_ULP>; - regulator-always-on; - };
...
Quoted 15 lines
arch/arm64/boot/dts/mediatek/mt8195-demo.dts +2
-2}; };@@ -259,8 +164,8 @@ cap-sd-highspeed; sd-uhs-sdr50; sd-uhs-sdr104; - vmmc-supply = <&mt6360_ldo5>; - vqmmc-supply = <&mt6360_ldo3>; + vmmc-supply = <&mt6360_vmch_pmu_ldo5_reg>; + vqmmc-supply = <&mt6360_vmc_pmu_ldo3_reg>; status = "okay"; };
arch/arm64/boot/dts/mediatek/mt8195-demo.dts line 208
Quoted 4 lines
arch/arm64/boot/dts/mediatek/mt8195-demo.dts +1
-0@@ -300,6 +205,67 @@ regulator-always-on; }; +#include "mt6360.dtsi"
Includes are in the top part of the DTS. Sometimes bottom, but never in the middle.
Best regards,
Krzysztof
Re: [PATCH v2 4/4] arm64: dts: mediatek: mt8195-demo: simplify mt6360 nodes
Quoted 96 lines · Krzysztof Kozlowski
External email : Please do not click links or open attachments until you have verified the sender or the content.
Quoted 46 lines · Macpaul Lin
The dts file for the MediaTek MT8195 demo board has been refactored to improve the configuration of the MT6360 multi-function PMIC.
The changes include:
- Addition of themt6360.dtsiinclude file, which contains the common configuration of the MT6360 for all mt8195 boards.
- Removal of the direct inclusion of themt6360-regulator.hfile.
- Removal of the common configuration of the MT6360 PMIC since the includedmt6360.dtsiis used.
- Add names according to the schematic of mt8195-demo board for mt6360 nodes.Signed-off-by Macpaul Lin <[email protected]>--- arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 173 ++++++++----------- 1 file changed, 74 insertions(+), 99 deletions(-)arch/arm64/boot/dts/mediatek/mt8195-demo.dts +2
-11@@ -11,7 +11,6 @@ #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/input/input.h> #include <dt-bindings/pinctrl/mt8195-pinfunc.h> -#include <dt-bindings/regulator/mediatek,mt6360-regulator.h> / { model = "MediaTek MT8195 demo board";@@ -130,103 +129,9 @@ mt6360: pmic@34 { compatible = "mediatek,mt6360"; reg = <0x34>; -interrupt-controller; +pinctrl-0 = <&mt6360_pins>; +pinctrl-names = "default"; interrupts-extended = <&pio 101 IRQ_TYPE_EDGE_FALLING>; -interrupt-names = "IRQB"; - -charger { -compatible = "mediatek,mt6360-chg"; -richtek,vinovp-microvolt = <14500000>; - -otg_vbus_regulator: usb-otg-vbus-regulator { -regulator-compatible = "usb-otg-vbus"; -regulator-name = "usb-otg-vbus";arch/arm64/boot/dts/mediatek/mt8195-demo.dts line 153
Quoted 10 lines
arch/arm64/boot/dts/mediatek/mt8195-demo.dts +0
-10-regulator-min-microvolt = <4425000>; -regulator-max-microvolt = <5825000>; -}; -}; - -regulator { -compatible = "mediatek,mt6360-regulator"; -LDO_VIN3-supply = <&mt6360_buck2>; - -mt6360_buck1: buck1 {Your patchset does not look bisectable. Does not look tested, either... Why having duplicated regulators (?) and then removing correct regulators and keeping wrong ones?
Quoted 9 lines
arch/arm64/boot/dts/mediatek/mt8195-demo.dts +0
-9-regulator-compatible = "BUCK1"; -regulator-name = "mt6360,buck1"; -regulator-min-microvolt = <300000>; -regulator-max-microvolt = <1300000>; -regulator-allowed-modes = <MT6360_OPMODE_NORMAL - MT6360_OPMODE_LP - MT6360_OPMODE_ULP>; -regulator-always-on; -};...
Quoted 18 lines
};
};arch/arm64/boot/dts/mediatek/mt8195-demo.dts +2
-2@@ -259,8 +164,8 @@ cap-sd-highspeed; sd-uhs-sdr50; sd-uhs-sdr104; -vmmc-supply = <&mt6360_ldo5>; -vqmmc-supply = <&mt6360_ldo3>; +vmmc-supply = <&mt6360_vmch_pmu_ldo5_reg>; +vqmmc-supply = <&mt6360_vmc_pmu_ldo3_reg>; status = "okay"; };@@ -300,6 +205,67 @@ regulator-always-on; };
Quoted 9 lines
arch/arm64/boot/dts/mediatek/mt8195-demo.dts line 208
Quoted 1 line
arch/arm64/boot/dts/mediatek/mt8195-demo.dts +1
-0+#include "mt6360.dtsi"Includes are in the top part of the DTS. Sometimes bottom, but never in the middle.
Best regards,
Krzysztof
MT6360 is an external component controlled by I2C.
On some mt8195 boards, it is connected to I2C6.
But on some smart phone boards, they are connected to I2C5. I agree to put the includes in the top or in the bottom, but it to include I2C node together in mt6360.dtsi will be necessary to avoid build error. It might introduce mt6360-i2c5.dtsi or mt6360-i2c6.dtsi in the future.
I think the better approach is to expand the common nodes in the board's dts, rather than organizing them into dtsi.
Please drop these 2 patches for adding mt6360.dtsi and modification for mt8195-demo.dts (patch 3/4 and 4/4) for the patch set.
Thanks for the review. :)
Macpaul Lin
PATCH v3 1/2 arm64: dts: mediatek: mt8195-demo: fix the memory size to 8GB
In reply to Macpaul LinThe onboard dram of mt8195-demo board is 8GB.
--- arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Changes for v2:
Changes for v3:
- No change.
arch/arm64/boot/dts/mediatek/mt8195-demo.dts +1 -1
@@ -48,7 +48,7 @@ memory@40000000 { device_type = "memory"; - reg = <0 0x40000000 0 0x80000000>; + reg = <0 0x40000000 0x2 0x00000000>; }; reserved-memory {
Signature · 1 line
2.18.0
PATCH v3 2/2 arm64: dts: mediatek: mt8195-demo: update and reorder reserved memory regions
The dts file of the MediaTek MT8195 demo board has been updated to include new reserved memory regions.
These reserved memory regions are:
- SCP
- VPU,
- Sound DMA
- APU.
These regions are defined with the "shared-dma-pool" compatible property. In addition, the existing reserved memory regions have been reordered by their addresses to improve readability and maintainability of the DTS file.
--- arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 37 ++++++++++++++++---- 1 file changed, 30 insertions(+), 7 deletions(-)
Changes for v2:
- No change.
Changes for v3:
- Fix vpu_mem and apu_mem node according to the result of "make dtbs_check W=1"
- Fix comment style to Linux for optee node.
arch/arm64/boot/dts/mediatek/mt8195-demo.dts +30 -7
@@ -56,13 +56,8 @@ #size-cells = <2>; ranges; - /* 2 MiB reserved for ARM Trusted Firmware (BL31) */ - bl31_secmon_reserved: secmon@54600000 { - no-map; - reg = <0 0x54600000 0x0 0x200000>; - }; - - /* 12 MiB reserved for OP-TEE (BL32) + /* + * 12 MiB reserved for OP-TEE (BL32) * +-----------------------+ 0x43e0_0000 * | SHMEM 2MiB | * +-----------------------+ 0x43c0_0000
@@ -75,6 +70,34 @@ no-map; reg = <0 0x43200000 0 0x00c00000>; }; + + scp_mem: memory@50000000 { + compatible = "shared-dma-pool"; + reg = <0 0x50000000 0 0x2900000>; + no-map; + }; + + vpu_mem: memory@53000000 { + compatible = "shared-dma-pool"; + reg = <0 0x53000000 0 0x1400000>; /* 20 MB */ + }; + + /* 2 MiB reserved for ARM Trusted Firmware (BL31) */ + bl31_secmon_mem: memory@54600000 { + no-map; + reg = <0 0x54600000 0x0 0x200000>; + }; + + snd_dma_mem: memory@60000000 { + compatible = "shared-dma-pool"; + reg = <0 0x60000000 0 0x1100000>; + no-map; + }; + + apu_mem: memory@62000000 { + compatible = "shared-dma-pool"; + reg = <0 0x62000000 0 0x1400000>; /* 20 MB */ + }; }; };
Signature · 1 line
2.18.0
Re: [PATCH v3 2/2] arm64: dts: mediatek: mt8195-demo: update and reorder reserved memory regions
Il 05/09/23 05:45, Macpaul Lin ha scritto:
Quoted 8 lines
The dts file of the MediaTek MT8195 demo board has been updated to include new reserved memory regions.
These reserved memory regions are:
- SCP
- VPU,
- Sound DMA
- APU.
Quoted 8 lines
These regions are defined with the "shared-dma-pool" compatible property. In addition, the existing reserved memory regions have been reordered by their addresses to improve readability and maintainability of the DTS file.
Cc [email protected] # 6.1, 6.4, 6.5Fixes e4a417520101 ("arm64: dts: mediatek: mt8195-demo: fix the memory size of node secmon")Signed-off-by Macpaul Lin <[email protected]>
AngeloGioacchino Del Regno
maintainerIl 05/09/23 05:45, Macpaul Lin ha scritto:
Quoted 18 lines
The onboard dram of mt8195-demo board is 8GB.
Cc [email protected] # 6.1, 6.4, 6.5Fixes 6147314aeedc ("arm64: dts: mediatek: Add device-tree for MT8195 Demo board")Signed-off-by Macpaul Lin <[email protected]>--- arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Changes for v2:
Changes for v3:
- No change.arch/arm64/boot/dts/mediatek/mt8195-demo.dts +0
-0
arch/arm64/boot/dts/mediatek/mt8195-demo.dts line 51
Quoted 5 lines
arch/arm64/boot/dts/mediatek/mt8195-demo.dts +1
-1@@ -48,7 +48,7 @@ memory@40000000 { device_type = "memory"; - reg = <0 0x40000000 0 0x80000000>; + reg = <0 0x40000000 0x2 0x00000000>;
Shouldn't this get automatically filled in by the bootloader? Usually, that's the case: if it is, then the right thing to do here is to change this property to
/* The bootloader will fill in the size */ reg = <0x0 0x40000000 0x0 0x0>;
Regards,
Angelo
Quoted 3 lines
arch/arm64/boot/dts/mediatek/mt8195-demo.dts +0
-0}; reserved-memory {
Quoted 28 lines · AngeloGioacchino Del Regno
Il 05/09/23 05:45, Macpaul Lin ha scritto:
Quoted 18 lines
The onboard dram of mt8195-demo board is 8GB.
Cc [email protected] # 6.1, 6.4, 6.5Fixes 6147314aeedc ("arm64: dts: mediatek: Add device-tree for MT8195 Demo board")Signed-off-by Macpaul Lin <[email protected]>---
arch/arm64/boot/dts/mediatek/mt8195-demo.dts| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)Changes for v2:
Changes for v3:
- No change.arch/arm64/boot/dts/mediatek/mt8195-demo.dts +0
-0arch/arm64/boot/dts/mediatek/mt8195-demo.dts line 50
Quoted 4 lines
arch/arm64/boot/dts/mediatek/mt8195-demo.dts +1
-1@@ -48,7 +48,7 @@ memory@40000000 { device_type = "memory"; - reg = <0 0x40000000 0 0x80000000>; + reg = <0 0x40000000 0x2 0x00000000>;Shouldn't this get automatically filled in by the bootloader? Usually, that's the case: if it is, then the right thing to do here is to change this property to
Quoted 6 lines
/* The bootloader will fill in the size */ reg = <
0x00x400000000x00x0>;Regards,
Angelo
Thanks for the review. However, this value seems depends on the boot method. Take u-boot as the example, the total memory size which Linux kernel get will be different via EBBR boot or fitImage boot.
It the system is booted through EBBR, the memory size should be filled by u-boot's UEFI variables, which is from u-boot's dts file. If the system is booted from fitImage, the memory size should be filled by kernel's dts file which is usually packed with fitImage. That's why we still need this fix.
Quoted 4 lines
arch/arm64/boot/dts/mediatek/mt8195-demo.dts line 54
Quoted 2 lines
arch/arm64/boot/dts/mediatek/mt8195-demo.dts +0
-0}; reserved-memory {
Thanks.
Macpaul Lin
Il 05/09/23 05:45, Macpaul Lin ha scritto:
Quoted 5 lines
The onboard dram of mt8195-demo board is 8GB.
Cc [email protected] # 6.1, 6.4, 6.5Fixes 6147314aeedc ("arm64: dts: mediatek: Add device-tree for MT8195 Demo board")Signed-off-by Macpaul Lin <[email protected]>
Quoted 21 lines
--- arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Changes for v2:
Changes for v3:
- No change.arch/arm64/boot/dts/mediatek/mt8195-demo.dts +1
-1@@ -48,7 +48,7 @@ memory@40000000 { device_type = "memory"; - reg = <0 0x40000000 0 0x80000000>; + reg = <0 0x40000000 0x2 0x00000000>; }; reserved-memory {