Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp1538053rdb; Sat, 20 Jan 2024 03:21:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IGg0lBpQRMsCohlpIM9FXwNkf7COw2QqtuDKnDYaqGWpIONb5S+V2+w4A3xfa4MkmULy5C9 X-Received: by 2002:a6b:6b07:0:b0:7bf:7e09:c0c0 with SMTP id g7-20020a6b6b07000000b007bf7e09c0c0mr1526615ioc.34.1705749689672; Sat, 20 Jan 2024 03:21:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705749689; cv=pass; d=google.com; s=arc-20160816; b=PtP3GcFjLXgmYhw0r7riZCzoodHk9mes6g/KgZlCsrWHN3wg3Ww8fn4caXXFbjVOH3 ABWaOp/pyNy42FGiTuDlZSk80jRWNbQRAm0biEJ7hoLeCYMcRGf4yheBmP7L/ZHP/wJV KN5TwlSUdGls8B0CLaZEmbdquunusVz/czjgrgvn8a4E16/0OSw8nZLX6D9mISeI/AeI ttjfVGBnp4IyAWreaHq89a4Elwxw/34F6jmT3rTbBOwAgVGdptpfxxRs/uKUv8dsfZjx Bl0VM+5wr3g6Lud0yVYPP7WQ6FrpsEXRnLqKYHN+P7GeS/Pmrr3eMLEa1JvvfKubQqY/ R4bA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:subject:cc:to:from:dkim-signature; bh=zvMn6sx6QAeXlTZWaI1EwsfMy/pABV7n7RhDItQ16Tw=; fh=mF/j1fuuvhcZjnlL9JGOwqvkzu2Q10sC1Ch7emVavKo=; b=DOqikKP/bQxRlAvhtfowZPLuYWOuqC1Um1zi7ZuQGiOPnq2JBtsWDGV3YV/knJ4tgd vexqebd7o+vl8ZX6lOmHToK4PcY2yY5oY8lXTuRSGwsqIjtIOjsjF0uV5uh4a6KGYEbG XcSzLiu/ImtcwJWkXBzfB34mI/vXXdfOXWJu67HJH4Uz8ALFcdSEZzSk3fxXtlW4E0u3 qUPlUFUaGtF4pv5ag2q0a6siK5yKegAYjsHHysJyT2T8N3RScXDmTDrj+MrZ3StTYi9N g4xJdN/6DuJ+NVd3IVgcgN4n67WGP+lnvZt/w/98j6kLJq6Np3X/w2OKBGRBh4HEQHac viQQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=HAhICGxJ; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-31777-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31777-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id ja5-20020a170902efc500b001d724e5e1e4si2200250plb.572.2024.01.20.03.21.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Jan 2024 03:21:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-31777-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=HAhICGxJ; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-31777-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31777-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 4E9E22825AC for ; Sat, 20 Jan 2024 11:21:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 935ABDDA8; Sat, 20 Jan 2024 11:21:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="HAhICGxJ" Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1EFAADDAD; Sat, 20 Jan 2024 11:21:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705749676; cv=none; b=A3xGjlCPOgy1ZW8eflzqR0ntp+uWNsL3qAnvkryARffsKwsBx7iX6BIdys3BBefezQixW3iEX6ABdqTnpglNYZFojpmzK3BfdnkU2fbWeR49JYU8oQbLcEKhmT7J8ypszndfANazd9ME7z9mz3tFreWSfw7YOJY3ZkkX/vdTYps= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705749676; c=relaxed/simple; bh=2dcc0Yyrj14lg85ApEViidIZ5aShvEHIjZ0J7cIXKJY=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=d/L7mvLtidSP0+uOGCpbeQXvE+zFL5zhg28+JT0Ays6htS1cJVIOVy/Dt0gqAbPSOVdg+zfbTsSlHcJlmhLFgSQsurJRYA+LBbhsh9hu4CbkmyiLihPv3RgVI0S2/7tEFovE4lpzF2UIll5FbTHC5pUF5tSe0D4YqhloxcolU+0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=HAhICGxJ; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40KBKXuQ018175; Sat, 20 Jan 2024 11:21:11 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:mime-version:content-type; s= qcppdkim1; bh=zvMn6sx6QAeXlTZWaI1EwsfMy/pABV7n7RhDItQ16Tw=; b=HA hICGxJK6XXAJ/aZ10xh5YakeIh+6ERouBW2s3gdJPcrfAAYnhqIoO546rc3RkBHh fpnL82H94QSxFWXwN0eUXnQgOgKxldiROOZxFp3i8boTXxxRDfv/Qi9JdLX+635m ecdIEIMyA4L/kK3zTjRkZn4JmNmtJHCfiNCmbCNUL8mxTidpaWzsap0LtGG9E4Py XI/jlkVSW5HDlbzfDw0RuWhNJz4CnU2DTWCe7A49ZPc6qbIFCXC4RO53NsdqjaEs pVPN4tLAkxc9eMOlHVUxq7JDtqCtaSmjMPuuy6KYjoqleq1kz6XuvjfsezEs4NcX iLpBn1W4bfb5C9zawB5Q== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vr6xn0dmq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 20 Jan 2024 11:21:11 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 40KBLA5I029786 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 20 Jan 2024 11:21:10 GMT Received: from hu-amrianan-hyd.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Sat, 20 Jan 2024 03:21:04 -0800 From: Amrit Anand To: , , , , , CC: , , , , Amrit Anand Subject: [PATCH 0/2] Add board-id support for multiple DT selection Date: Sat, 20 Jan 2024 16:50:47 +0530 Message-ID: <1705749649-4708-1-git-send-email-quic_amrianan@quicinc.com> X-Mailer: git-send-email 2.7.4 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: UkIywPEtXl5UCY0aLF4TeZU-cP1wl5VU X-Proofpoint-ORIG-GUID: UkIywPEtXl5UCY0aLF4TeZU-cP1wl5VU X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-20_04,2024-01-19_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 clxscore=1011 mlxscore=0 impostorscore=0 spamscore=0 lowpriorityscore=0 phishscore=0 malwarescore=0 suspectscore=0 bulkscore=0 mlxlogscore=656 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2401200092 Device manufacturers frequently ship multiple boards or SKUs under a single software package. These software packages will ship multiple devicetree blobs and require some mechanism to pick the correct DTB for the board the software package was deployed. Introduce a common definition for adding board identifiers to device trees. board-id provides a mechanism for bootloaders to select the appropriate DTB which is vendor/OEM-agnostic. Isn't that what the compatible property is for? ----------------------------------------------- The compatible property can be used for board matching, but requires bootloaders and/or firmware to maintain a database of possible strings to match against or have complex compatible string matching. Compatible string matching becomes complicated when there are multiple versions of board: the device tree selector should recognize a DTB that cares to distinguish between v1/v2 and a DTB that doesn't make the distinction. An eeprom either needs to store the compatible strings that could match against the board or the bootloader needs to have vendor-specific decoding logic for the compatible string. Neither increasing eeprom storage nor adding vendor-specific decoding logic is desirable. The solution proposed here is simpler to implement and doesn't require updating firmware or bootloader for every new board. How is this better than Qualcomm's qcom,msm-id/qcom,board-id? ------------------------------------------------------------- The selection process for devicetrees was Qualcomm-specific and not useful for other devices and bootloaders that were not developed by Qualcomm because a complex algorithm was used to implement. Board-ids provide a matching solution that can be implemented by bootloaders without introducing vendor-specific code. Qualcomm uses three devicetree properties: msm-id (interchangeably: soc-id), board-id, and pmic-id. This does not scale well for use casese which use identifiers, for example, to distinguish between a display panel. For a display panel, an approach could be to add a new property: display-id, but now bootloaders need to be updated to also read this property. We want to avoid requiring to update bootloaders with new hardware identifiers: a bootloader need only recognize the identifiers it can handle. Amrit Anand (1): dt-bindings: hwinfo: Add Qualcomm's board-id types Elliot Berman (1): dt-bindings: hwinfo: Introduce board-id .../devicetree/bindings/hwinfo/board-id.yaml | 53 +++++++++++++ .../devicetree/bindings/hwinfo/qcom,board-id.yaml | 86 ++++++++++++++++++++++ include/dt-bindings/arm/qcom,ids.h | 68 +++++++++++++++-- 3 files changed, 199 insertions(+), 8 deletions(-) create mode 100644 Documentation/devicetree/bindings/hwinfo/board-id.yaml create mode 100644 Documentation/devicetree/bindings/hwinfo/qcom,board-id.yaml -- 2.7.4