lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <062E9FFE-633E-46F1-A914-37A370722D49@public-files.de>
Date:   Thu, 26 Oct 2023 11:01:24 +0200
From:   Frank Wunderlich <frank-w@...lic-files.de>
To:     AngeloGioacchino Del Regno 
        <angelogioacchino.delregno@...labora.com>,
        Frank Wunderlich <linux@...web.de>,
        linux-mediatek@...ts.infradead.org
CC:     Matthias Brugger <matthias.bgg@...il.com>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Conor Dooley <conor+dt@...nel.org>,
        Daniel Golle <daniel@...rotopia.org>,
        linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        Eric Woudstra <ericwouds@...il.com>
Subject: Re: [PATCH v2 5/5] arm64: dts: mt7986: add overlay for SATA power socket on BPI-R3

Hi Angelo

Bpi-r3 can boot with only 1 mmc device and 1 spi-device. Some users may not use the sata overlay. Using overlays in fit have the advantage to probe hardware in uboot and load the required overlays instead of loading a full dtb.

Am 26. Oktober 2023 10:03:08 MESZ schrieb AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>:
>Il 25/10/23 19:08, Frank Wunderlich ha scritto:
>> From: Frank Wunderlich <frank-w@...lic-files.de>
>> 
>> Bananapi R3 has a Power socket entended for using external SATA drives.
>> This Socket is off by default but can be switched with gpio 8.
>> 
>> Add an overlay to activate it.
>> 
>> Signed-off-by: Frank Wunderlich <frank-w@...lic-files.de>
>> ---
>> v2:
>> - rebase on the patch "add dtbs with applied overlays for bpi-r3"
>> - add sata-overlay to the full dtbs
>> ---
>>   arch/arm64/boot/dts/mediatek/Makefile         | 13 +++++--
>>   .../mt7986a-bananapi-bpi-r3-sata.dtso         | 39 +++++++++++++++++++
>>   2 files changed, 48 insertions(+), 4 deletions(-)
>>   create mode 100644 arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-sata.dtso
>> 
>> diff --git a/arch/arm64/boot/dts/mediatek/Makefile b/arch/arm64/boot/dts/mediatek/Makefile
>> index 24eeba0703ce..c3b236a47513 100644
>> --- a/arch/arm64/boot/dts/mediatek/Makefile
>> +++ b/arch/arm64/boot/dts/mediatek/Makefile
>> @@ -13,26 +13,31 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3.dtb
>>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-emmc.dtbo
>>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-nand.dtbo
>>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-nor.dtbo
>> +dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sata.dtbo
>>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sd.dtbo
>
>The devicetree overlays make no sense without a base devicetree, right? :-)

The base-dtb is needed,but i prefer have 1 base-dt and overlays (in 1 fit image dynamically load in uboot) instead of 4+ full dtbs,but some people prefer using the full dtbs.

>dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-nor.dtbo <-- makes no sense!

Depends on users preference :) full dtb is easier to load,but less flexible.

>Check how it's done in freescale (nxp) and renesas... and there's also one instance
>of overlays in qualcomm.

>In short:
> - Remove all of the dtb-$(CONFIG_ARCH_MEDIATEK) += blah.dtbo
> - xxxx-dtbs:= blah.dtb blah-overlay.dtbo, dtb-$(CONFIG_ARCH_MEDIATEK) += xxxx.dtb
>   is correct.

That will break my current way :( openwrt uses same.

>>   mt7986a-bananapi-bpi-r3-emmc-nand-dtbs := \
>>   	mt7986a-bananapi-bpi-r3.dtb \
>>   	mt7986a-bananapi-bpi-r3-emmc.dtbo \
>> -	mt7986a-bananapi-bpi-r3-nand.dtbo
>> +	mt7986a-bananapi-bpi-r3-nand.dtbo \
>> +	mt7986a-bananapi-bpi-r3-sata.dtbo
>>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-emmc-nand.dtb
>>   mt7986a-bananapi-bpi-r3-emmc-nor-dtbs := \
>>   	mt7986a-bananapi-bpi-r3.dtb \
>>   	mt7986a-bananapi-bpi-r3-emmc.dtbo \
>> -	mt7986a-bananapi-bpi-r3-nor.dtbo
>> +	mt7986a-bananapi-bpi-r3-nor.dtbo \
>> +	mt7986a-bananapi-bpi-r3-sata.dtbo
>>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-emmc-nor.dtb
>>   mt7986a-bananapi-bpi-r3-sd-nand-dtbs := \
>>   	mt7986a-bananapi-bpi-r3.dtb \
>>   	mt7986a-bananapi-bpi-r3-sd.dtbo \
>> -	mt7986a-bananapi-bpi-r3-nand.dtbo
>> +	mt7986a-bananapi-bpi-r3-nand.dtbo \
>> +	mt7986a-bananapi-bpi-r3-sata.dtbo
>>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sd-nand.dtb
>>   mt7986a-bananapi-bpi-r3-sd-nor-dtbs := \
>>   	mt7986a-bananapi-bpi-r3.dtb \
>>   	mt7986a-bananapi-bpi-r3-sd.dtbo \
>> -	mt7986a-bananapi-bpi-r3-nor.dtbo
>> +	mt7986a-bananapi-bpi-r3-nor.dtbo \
>> +	mt7986a-bananapi-bpi-r3-sata.dtbo
>>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sd-nor.dtb
>>     dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-rfb.dtb
>> diff --git a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-sata.dtso b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-sata.dtso
>> new file mode 100644
>> index 000000000000..6ab06813412a
>> --- /dev/null
>> +++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-sata.dtso
>> @@ -0,0 +1,39 @@
>> +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
>> +/*
>> + * Copyright (C) 2021 MediaTek Inc.
>> + * Author: Frank Wunderlich <frank-w@...lic-files.de>
>> + */
>> +
>> +/dts-v1/;
>> +/plugin/;
>> +
>> +#include <dt-bindings/gpio/gpio.h>
>> +
>> +/ {
>> +	compatible = "bananapi,bpi-r3", "mediatek,mt7986a";
>> +
>> +	fragment@0 {
>> +		target-path = "/";
>> +		__overlay__ {
>
>This could be easier, I think.
>
>&{/} {
>
>	reg_sata12v: regulator-sata12v {
>		....
>	};
>
>	something_else: something-else { ... };
>};

Need to try this.

>Regards,
>Angelo
>
>> +			reg_sata12v: regulator-sata12v {
>> +				compatible = "regulator-fixed";
>> +				regulator-name = "sata12v";
>> +				regulator-min-microvolt = <12000000>;
>> +				regulator-max-microvolt = <12000000>;
>> +				gpio = <&pio 8 GPIO_ACTIVE_HIGH>;
>> +				enable-active-high;
>> +				regulator-always-on;
>> +			};
>> +
>> +			reg_sata5v: regulator-sata5v {
>> +				compatible = "regulator-fixed";
>> +				regulator-name = "sata5v";
>> +				regulator-min-microvolt = <5000000>;
>> +				regulator-max-microvolt = <5000000>;
>> +				regulator-always-on;
>> +				vin-supply = <&reg_sata12v>;
>> +			};
>> +		};
>> +	};
>> +};
>> +
>


regards Frank

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ