From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f179.google.com (mail-qk1-f179.google.com [209.85.222.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 666911FF1C7 for ; Fri, 15 Aug 2025 21:22:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755292965; cv=none; b=O3bCcYvoBj9+usgPaK2ftAPLcNGlato05WbH+HvzvvvrBogpxHqBZOrpISzMtxX+yS6CeMHyTWyf92qTg+idFnwLfPNuih0nL5nlmt8i2kjeqD8wxp7D/r3i0+U+Hv9jatm0r6+GQxHFGxcj2eEGZbzP1vosWCSM7WnqSe9HHzw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755292965; c=relaxed/simple; bh=tbNrbbxz33YIC14fjQwOzIXwofKRc168Ypdx9Z8IPfU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=iz4G57UYwwvy9vo4Scd0GAltf7ytfDVsTBGBF9QeboD/kafZEK98iR39Pbq+ryQJBocZGX3paDanbQa4PE4azQfX/lz07S0lNUBFg+AwIC+8wkQHDPj0TkKew/XLZrlysVL1sfQghue2B1ZC/1dBO8BU4r3LH5e1PgB2HT4nHwY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=apu3m6Xb; arc=none smtp.client-ip=209.85.222.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="apu3m6Xb" Received: by mail-qk1-f179.google.com with SMTP id af79cd13be357-7e87068760bso280715785a.3 for ; Fri, 15 Aug 2025 14:22:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1755292961; x=1755897761; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=yFO9JNDJtAEz1XcsMaClD4jgQZO2qiePHkbNZBiq2Uo=; b=apu3m6XbWQlXuqBD+mAW6dYcZtfZKwgMUElbDo4pN3V/Tv2kBQI1LM8ZzUkooFRDUm J7WkT5FOCN01z/vLwk8S0Sc1/m0y7wKq2SYyLC+fZJMHrkIL2vINbnzGdYikyy+qCK+N GV1yUczTXgBmWED3qH4x4UM4YwjK4IXS8Tz9E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755292961; x=1755897761; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=yFO9JNDJtAEz1XcsMaClD4jgQZO2qiePHkbNZBiq2Uo=; b=KPgL5Bry7Lh15H4i/yoRUHiFYWJyMBRXIBNKcRIi5U6c7wSIJVWKZ5l+xawowWpE1D JWPxa/rSjyG+pNdtpU+dzl4qOA2v4S+fRaxFl6ZFFxULDEWWI1IaPb0vGNHRy3D3VU4B RlxNLUR/mGEn9rvCo7JwA5XwhkpuRjKphhDNWGD5sDd2Jc/KaiEtr7cAQhv0JH+hxpoy X5hACc3oJbssL+HRqockI15F60gbJyZ4lt8Ha4K4hjVSousx9V2LKjRQyaH9md5R5M7H Qo/bgkFR2fJTAklMSWHJ8RtVRzxcKZjqJrk3vXvcyRMihCkVwmdQlh0oXP8MAVeD24hP HTjQ== X-Forwarded-Encrypted: i=1; AJvYcCWI6vRuyihdPulf0LbThFVhR3HIYJm9UMzMPOYTG8CUq19hCxaVJRrKFjbGmeyGD0l4bOaN4i+dIw==@vger.kernel.org X-Gm-Message-State: AOJu0Yw1j+cGKrp9yUHTa+aKobDfoItfZjah+tRKDo1AOrNC89tQbJSW 6CaivabYJOU40i1iFyV85gQg09n/JSXisRZAIZG47OpvZ32kjqfaKfNd6M8c1BgpGQ== X-Gm-Gg: ASbGncv3lp0AH7jeI/KEoLNc0yMObmDUsZJuGwVAscrXoEEon2pav8OXe4TiPpWTTB9 pOl5fl9N+/pMZ+rbjaZ1wJPj3XhPyN2Nyxee05VoMNvQcbJVsHUANU++cGD5p+S51AWXREPFBap 6Fw6TJnPkE//PUACLJMAWclRfL7zUVJn3iM/ABtVCHWE2icJQ/27Fu7FdENv1ZyDTMTmR8epyFU MbduvhlFs1WJufswGt/S4MLejybc8ObawJt7dggOUbZob2vnNV0pdNFX4cmlO+d7E6fvRFCEUkf m9WBU+imaNOL4xsdEARha/iecNlW/rPpUgzUe37cn7oCxHKSUtzTjsJAfdlttqTWJ4yVirlj9M8 ndEqnJJWodSsGUGwb4AkHcPPoGZJSiR2FdFwrsfnCx1/DiHC54UVBThyMREMjBHUNRnGIQ3CxSr XO+zEJqx8= X-Google-Smtp-Source: AGHT+IG5/wy7olanUD0/3s8raSF3C2tVecAtdouylTy8v/DZAJb47CuKQ8lqePsd2KKCCqrNMJZ27Q== X-Received: by 2002:a05:620a:f11:b0:7e0:9f9b:c1f9 with SMTP id af79cd13be357-7e87df695d6mr488733385a.3.1755292961252; Fri, 15 Aug 2025 14:22:41 -0700 (PDT) Received: from [10.67.48.245] ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7e87e06a913sm173610585a.26.2025.08.15.14.22.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 15 Aug 2025 14:22:40 -0700 (PDT) Message-ID: <02e181ae-ee76-4f38-a217-a8ba9296e72f@broadcom.com> Date: Fri, 15 Aug 2025 14:22:34 -0700 Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v14 00/10] Implement vendor resets for PSCI SYSTEM_RESET2 To: Shivendra Pratap , Bartosz Golaszewski , Bjorn Andersson , Sebastian Reichel , Rob Herring , Sudeep Holla , Souvik Chakravarty , Krzysztof Kozlowski , Conor Dooley , Andy Yan , Mark Rutland , Lorenzo Pieralisi , Arnd Bergmann , Konrad Dybcio , cros-qcom-dts-watchers@chromium.org, Vinod Koul , Catalin Marinas , Will Deacon Cc: Dmitry Baryshkov , Mukesh Ojha , Stephen Boyd , Andre Draszik , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Elliot Berman , Srinivas Kandagatla , Elliot Berman , Konrad Dybcio References: <20250815-arm-psci-system_reset2-vendor-reboots-v14-0-37d29f59ac9a@oss.qualcomm.com> Content-Language: en-US From: Florian Fainelli Autocrypt: addr=florian.fainelli@broadcom.com; keydata= xsBNBFPAG8ABCAC3EO02urEwipgbUNJ1r6oI2Vr/+uE389lSEShN2PmL3MVnzhViSAtrYxeT M0Txqn1tOWoIc4QUl6Ggqf5KP6FoRkCrgMMTnUAINsINYXK+3OLe7HjP10h2jDRX4Ajs4Ghs JrZOBru6rH0YrgAhr6O5gG7NE1jhly+EsOa2MpwOiXO4DE/YKZGuVe6Bh87WqmILs9KvnNrQ PcycQnYKTVpqE95d4M824M5cuRB6D1GrYovCsjA9uxo22kPdOoQRAu5gBBn3AdtALFyQj9DQ KQuc39/i/Kt6XLZ/RsBc6qLs+p+JnEuPJngTSfWvzGjpx0nkwCMi4yBb+xk7Hki4kEslABEB AAHNMEZsb3JpYW4gRmFpbmVsbGkgPGZsb3JpYW4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KwUCU8AbwgUbDAAAAMBdIAQZAQgABgUCU8AbwQAKCRCTYAaomC8PVQ0VCACWk3n+ obFABEp5Rg6Qvspi9kWXcwCcfZV41OIYWhXMoc57ssjCand5noZi8bKg0bxw4qsg+9cNgZ3P N/DFWcNKcAT3Z2/4fTnJqdJS//YcEhlr8uGs+ZWFcqAPbteFCM4dGDRruo69IrHfyyQGx16s CcFlrN8vD066RKevFepb/ml7eYEdN5SRALyEdQMKeCSf3mectdoECEqdF/MWpfWIYQ1hEfdm C2Kztm+h3Nkt9ZQLqc3wsPJZmbD9T0c9Rphfypgw/SfTf2/CHoYVkKqwUIzI59itl5Lze+R5 wDByhWHx2Ud2R7SudmT9XK1e0x7W7a5z11Q6vrzuED5nQvkhAAoJEIExtcQpvGagugcIAJd5 EYe6KM6Y6RvI6TvHp+QgbU5dxvjqSiSvam0Ms3QrLidCtantcGT2Wz/2PlbZqkoJxMQc40rb fXa4xQSvJYj0GWpadrDJUvUu3LEsunDCxdWrmbmwGRKqZraV2oG7YEddmDqOe0Xm/NxeSobc MIlnaE6V0U8f5zNHB7Y46yJjjYT/Ds1TJo3pvwevDWPvv6rdBeV07D9s43frUS6xYd1uFxHC 7dZYWJjZmyUf5evr1W1gCgwLXG0PEi9n3qmz1lelQ8lSocmvxBKtMbX/OKhAfuP/iIwnTsww 95A2SaPiQZA51NywV8OFgsN0ITl2PlZ4Tp9hHERDe6nQCsNI/Us= In-Reply-To: <20250815-arm-psci-system_reset2-vendor-reboots-v14-0-37d29f59ac9a@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 8/15/25 07:35, Shivendra Pratap wrote: > The PSCI SYSTEM_RESET2 call allows vendor firmware to define > additional reset types which could be mapped to the reboot > argument. > > User-space should be able to reboot a device into different > operational boot-states supported by underlying bootloader and > firmware. Generally, some HW registers need to be written, based > on which the bootloader and firmware decide the next boot state > of device, after the reset. For example, a requirement on > Qualcomm platforms may state that reboot with "bootloader" > command, should reboot the device into bootloader flashing mode > and reboot with “edl” command, should reboot the device into an > Emergency flashing mode. Setting up such reboots on Qualcomm > devices can be inconsistent across SoC platforms and may require > setting different HW registers, where some of these registers may > not be accessible to HLOS. These knobs evolve over product > generations and require more drivers. PSCI defines a > vendor-specific reset in SYSTEM_RESET2 spec, which enables the > firmware to take care of underlying setting for any such > supported vendor-specific reboot. Qualcomm firmwares are > beginning to support and expose PSCI SYSTEM_RESET2 > vendor-specific reset types to simplify driver requirements from > Linux. With such support added in the firmware, we now need a > Linux interface which can make use of the firmware calls for PSCI > vendor-specific resets. This will align such reboot requirement > across platforms and vendors. > > The current psci driver supports two types of resets – > SYSTEM_RESET2 Arch warm-reset and SYSTEM_RESET cold-reset. The > patchset introduces the PSCI SYSTEM_RESET2 vendor-specific reset > into the reset path of the psci driver and aligns it to work with > reboot system call - LINUX_REBOOT_CMD_RESTART2, when used along > with a supported string-based command in “*arg”. > > The patchset uses reboot-mode based commands, to define the > supported vendor reset-types commands in psci device tree node > and registers these commands with the reboot-mode framework. > > The PSCI vendor-specific reset takes two arguments, being, > reset_type and cookie as defined by the spec. To accommodate this > requirement, enhance the reboot-mode framework to support two > 32-bit arguments by switching to 64-bit magic values. > > Along this line, the patchset also extends the reboot-mode > framework to add a non-device-based registration function, which > will allow drivers to register using device tree node, while > keeping backward compatibility for existing users of reboot-mode. > This will enable psci driver to register for reboot-mode and > implement a write function, which will save the magic and then > use it in psci reset path to make a vendor-specific reset call > into the firmware. In addition, the patchset will expose a sysfs > entry interface within reboot-mode which can be used by userspace > to view the supported reboot-mode commands. > > The list of vendor-specific reset commands remains open due to > divergent requirements across vendors, but this can be > streamlined and standardized through dedicated device tree > bindings. > > Currently three drivers register with reboot-mode framework - > syscon-reboot-mode, nvmem-reboot-mode and qcom-pon. Consolidated > list of commands currently added across various vendor DTs: > mode-loader > mode-normal > mode-bootloader > mode-charge > mode-fastboot > mode-reboot-ab-update > mode-recovery > mode-rescue > mode-shutdown-thermal > mode-shutdown-thermal-battery > > On gs101 we also pass kernel-generated modes from kernel_restart() > or panic(), specifically DM verity's 'dm-verity device corrupted': > mode-dm-verity-device-corrupted = <0x50>; > > - thanks Andre' for providing this. > > Detailed list of commands being used by syscon-reboot-mode: > arm64/boot/dts/exynos/exynosautov9.dtsi: > mode-bootloader = ; > mode-fastboot = ; > mode-recovery = ; > > arm64/boot/dts/exynos/google/gs101.dtsi: > mode-bootloader = <0xfc>; > mode-charge = <0x0a>; > mode-fastboot = <0xfa>; > mode-reboot-ab-update = <0x52>; > mode-recovery = <0xff>; > mode-rescue = <0xf9>; > mode-shutdown-thermal = <0x51>; > mode-shutdown-thermal-battery = <0x51>; > > arm64/boot/dts/hisilicon/hi3660-hikey960.dts: > mode-normal = <0x77665501>; > mode-bootloader = <0x77665500>; > mode-recovery = <0x77665502>; > > arm64/boot/dts/hisilicon/hi6220-hikey.dts: > mode-normal = <0x77665501>; > mode-bootloader = <0x77665500>; > mode-recovery = <0x77665502>; > > arm64/boot/dts/rockchip/px30.dtsi: > mode-bootloader = ; > mode-fastboot = ; > mode-loader = ; > mode-normal = ; > mode-recovery = ; > > arm64/boot/dts/rockchip/rk3308.dtsi: > mode-bootloader = ; > mode-loader = ; > mode-normal = ; > mode-recovery = ; > mode-fastboot = ; > > arm64/boot/dts/rockchip/rk3566-lckfb-tspi.dts: > mode-normal = ; > mode-loader = ; > mode-recovery = ; > mode-bootloader = ; > > Detailed list of commands being used by nvmem-reboot-mode: > arm64/boot/dts/qcom/pmXXXX.dtsi:(multiple qcom DTs) > mode-recovery = <0x01>; > mode-bootloader = <0x02>; > > Previous discussions around SYSTEM_RESET2: > - https://lore.kernel.org/lkml/20230724223057.1208122-2-quic_eberman@quicinc.com/T/ > - https://lore.kernel.org/all/4a679542-b48d-7e11-f33a-63535a5c68cb@quicinc.com/ > > Signed-off-by: Elliot Berman > Signed-off-by: Shivendra Pratap On ARCH_BRCMSTB: Tested-by: Florian Fainelli Thanks! -- Florian