From nobody Wed Nov 27 19:27:21 2024 Received: from DU2PR03CU002.outbound.protection.outlook.com (mail-northeuropeazon11012011.outbound.protection.outlook.com [52.101.66.11]) (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 E7A591E04B7 for ; Tue, 8 Oct 2024 15:18:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.66.11 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728400737; cv=fail; b=MLsbZCrd5BDs3T/8Jh80j71MBp5nQq2gR2S50HSyz9u0HdtIl+97BjsfhHI8dwKz3kyGxB0ULmdProxgLq6l8GNq4GP+UdwpsXd0/6SQ26mVIPcigV/Hmg57VLkb21h6hnaNXx7WK14gp1YfZ88NFKmusFnfO5HsCgFRxEmKwr4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728400737; c=relaxed/simple; bh=DM49R5v8+YMNDR9//TMHOLBKzBjtV69ySuusFjVM3qY=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=vAZOrXokIsqANpteRhQ2twXbpiFrpoHdByhg8yDpdI6Vm5pbiNR6cwuIXp0t3rGsdi8WjCFk5kQrYjez28bjNGfMaqp3h2TvyRjT5ElEt/mRC5UXxpSNvahpixu8MqPz2u281AP7ubGtF05sNbRz/YHykgIRIbI6X9LkZLfCoCY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=S0sc6oP+; arc=fail smtp.client-ip=52.101.66.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="S0sc6oP+" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HGreRLiFMWsTP2plL6yEGXGK2OMRE/WOj5M4zmOfgrawzjqy9h/tKvFOHmsRarN4wzNjbUr3HwIr0vc54WEXJUJ1nMjmmCTTUv5gd9EHRFEcJM4qv68omoBYN5yAc+j7lUXVX9rxkUNTei8jmGCLtB2ntifBheRUHEaa1yf0pabExgKetgskufYIVGR0hMqIzAvBHP8oEyZ6I7n+3PCJMjN/1O0Sw98u506eDS3IFb0lXSn9pZeD93+qzaFSlB71MlsDDEkPLEGtf6v9Y9f3XEXNyMbf/g9el+Hoh4InEW8TObCo/3sSuHLxOfZNNsHDRZ8sCiwp7TObdhluz7Wf+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=08TqXfMeHDz+1O9efCr97YY0qpO561DtJ9QcljgnDAw=; b=ARwXktwgsQdGZFloA04YHGUl17okMYFF2oyugjB+IO2o2xpBRw1I2aZDypsCTJyTRPw/e5ygmrNtY0Y8R37zyyifK7Ab8BCJe6t/Z5zrFWv+7fRf75g4BR4bOt7T361nRQ24r2xirLhJRC47V2r+fJWfxLmDzCbZPSY3bbW4rxWdcvdEKYsoiEHbpYFnCZFgENQZJtXTdUp3AtibZ63feeawCBEydQfbYckFz/SciJXxoqVFnCcTvRB5pfy4osM7j6ZTFz1uA5IryXLBu+wjrgiMt5249XpjpYvPliPvsvMieb/mctol0bxJpUik+yGlDu4UJeFdshskFU2LbkgJPA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=08TqXfMeHDz+1O9efCr97YY0qpO561DtJ9QcljgnDAw=; b=S0sc6oP+IiLDsmXL7w/UOdobBdHR2y3beiar0Hee0BJBRjAk36UriAGXAGU5Yik5xGybKXx0jPEa1KjtkNGNnfK7G10lcf5/sUbjsfoEuz3kPHLNzkeGoA/A0Wf7akDizIhNgKrflEoEXgDyg5vIoR/a8jdJFZ0k5claPReXE7h1blaO9sp3ea1Mb0GpeGjhg5bofOJ1MLZ4KGJ3TVdHIJ/gMSJFhc049tEeRKiHMzoY7Hp8ly7eNNR4hQlzpNYjySIokNKjbvosdS7xkEpyhjzyMCbaOHf9X+BFA6nsttealP6Cl/m2GUNdYJT//Ji9HNiKEJAIeMJh3dPq1IAEOQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DB9PR04MB9626.eurprd04.prod.outlook.com (2603:10a6:10:309::18) by GV1PR04MB9151.eurprd04.prod.outlook.com (2603:10a6:150:26::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.16; Tue, 8 Oct 2024 15:18:50 +0000 Received: from DB9PR04MB9626.eurprd04.prod.outlook.com ([fe80::e81:b393:ebc5:bc3d]) by DB9PR04MB9626.eurprd04.prod.outlook.com ([fe80::e81:b393:ebc5:bc3d%3]) with mapi id 15.20.8026.019; Tue, 8 Oct 2024 15:18:50 +0000 From: Frank Li Date: Tue, 08 Oct 2024 11:18:25 -0400 Subject: [PATCH v7 2/3] i3c: master: Extend address status bit to 4 and add I3C_ADDR_SLOT_EXT_DESIRED Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241008-i3c_dts_assign-v7-2-96ec93d1f34c@nxp.com> References: <20241008-i3c_dts_assign-v7-0-96ec93d1f34c@nxp.com> In-Reply-To: <20241008-i3c_dts_assign-v7-0-96ec93d1f34c@nxp.com> To: Alexandre Belloni Cc: linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org, arnd@arndb.de, bbrezillon@kernel.org, boris.brezillon@collabora.com, conor.culhane@silvaco.com, gregkh@linuxfoundation.org, imx@lists.linux.dev, miquel.raynal@bootlin.com, pthombar@cadence.com, ravindra.yashvant.shinde@nxp.com, Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1728400720; l=9439; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=DM49R5v8+YMNDR9//TMHOLBKzBjtV69ySuusFjVM3qY=; b=Y/5zhBvg8X6/Qsayadwo5NAKGThxoscxMRhH+p4wkb8KLg+9IwTPxgB5IvDzYkMViMwicvkBc aEgBOYryRubDxlAQ21oYyKlQGt/iMC68Szt/8mE1L4gZR772P74L46N X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: BYAPR11CA0101.namprd11.prod.outlook.com (2603:10b6:a03:f4::42) To DB9PR04MB9626.eurprd04.prod.outlook.com (2603:10a6:10:309::18) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB9PR04MB9626:EE_|GV1PR04MB9151:EE_ X-MS-Office365-Filtering-Correlation-Id: 75433974-652d-4c6e-05ad-08dce7ac835c X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|7416014|366016|376014|1800799024|38350700014; X-Microsoft-Antispam-Message-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ZWovRFZZQ09wNk8wYUl5cVgwTGlLM2JFNGlrSUtC?= =?utf-8?B?NUtrVm5GMkhldGVkR3BSdz09?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR04MB9626.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(7416014)(366016)(376014)(1800799024)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?d1ZsMFh2KzFsVGVHT3Erc25aYlBicHBBUE1zNmFzUCtLUEtyeEFPTDNBa2V3?= =?utf-8?B?YitBbTdnS0tuSXpDZFpvLzlpN2dJcnFsdTY0a09VYm16bFdNL0J5Q05razhB?= =?utf-8?B?MG9oZTVkR3dCRlBBb2Y1bFhwRXFCNWxhU3lkT2FXZlppalRyT09zZDZ3QW1F?= =?utf-8?B?SnNTbk02TWc5VFhtUFZIbEIwRHNPR1JFVFZ2RTVpc1JTb2Zmd0NLQnJzNDcv?= =?utf-8?B?U3NWNTRsYkd1MHhtcW1saGFLN05VemFrQS9tYVpXb01neXVQQzFoRTVCOWFL?= =?utf-8?B?YzE3dDZVSGV3YUhiNWdUbktrYjlWWS9zZFNUYnBnWUVFUFp3RlB1YzQ0RVpn?= =?utf-8?B?bjB2Q3cyMWVuYnNYSFdma0NyQ25PeERkZWZkQk5SdlRaMC9lWGd1ZjBrZkFa?= =?utf-8?B?Z0tnL2EyNHZHNTJtK2RzTDFJZHNMNE5RSUxnMnZUZDNWRElZSHAzeGVSaW5t?= =?utf-8?B?WkgxMTR0ME1Oc3VaWVNHQjNsQ3JNM3pBZm41UldId01uaGJrSEF4WFRuRUJE?= =?utf-8?B?VlRJZ29PejE5YWpSNVFQS2hONWxSOHZsQlB2SnJoUjhOOTdpUmtoVkhTU1da?= =?utf-8?B?RmJna3lzOGVxQU9PRW5PSlZZTmMwYW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VTYTdJQXFOTzVlMWUxbzhqbUhnVXdWL3ZmUVVm?= =?utf-8?B?R0VWSWtrbWwzVGJkUUUvUmdkU1NIeHdHckVKVU84NXp4b2dWZFFDRHpwUWgx?= =?utf-8?B?K2FOYkZmbm1uTXh0bU1udWVURWJPODYwalVHbEJvcXd3SHdSZCtmeWhubGJJ?= =?utf-8?B?bGVoVEMySjZvSVdQSzhrbVI1OGsvVWZzekhDVVdEQ0xwSEVROHdLb1c4cDFB?= =?utf-8?B?dVhoeVc3aHJJMDYzeXRQemNERHMwQUdKMUtGM1dEUGtPa1VGcU0wTEZGRGg0?= =?utf-8?B?TWpjd0JTSGhhNHhXQU52RjlFQmM3cHc4c1dGTHF1em5WQmMxOElvSEFVWFI1?= =?utf-8?B?ZXA5cFRkZkdUYmFkWFVWbm1VTkhnZ2dKRTVoT2p6MHJObWpwVjEyWmV5eGo0?= =?utf-8?B?SDE1eW1TTVRGUHBvOExBYnRJMElqR1d2RDRtL0ZSSTlMVWdVN1lBTi9iT0NZ?= =?utf-8?B?STdOYmo5V2h2a2VXeVZKR2JVaDZ3VVc5OHRoUU93ZlBrQjFSakEzallub3dM?= =?utf-8?B?eU1tQUpYSEhqejNZTmc1M1gwSTdRK2RsNFBjMktYZGRac0VJYlhxazFoZXpL?= =?utf-8?Q?1LwU=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 75433974-652d-4c6e-05ad-08dce7ac835c X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB9626.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2024 15:18:50.4993 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Wbt7H1okrLvUtjQKUkve1STdF9THYaOShL/9FHvedbXdSQB81BuERBg7eRXqmtRwLybTqbePVKdlqXwg/0Fysg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR04MB9151 Extend the address status bit to 4 and introduce the I3C_ADDR_SLOT_EXT_DESIRED macro to indicate that a device prefers a specific address. This is generally set by the 'assigned-address' in the device tree source (dts) file. =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=AC=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=AC=E2=94=80=E2=94=80=E2=94=80=E2=94=AC=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=AC=E2=94=80=E2=94=80=E2=94=80=E2=94=90 =E2=94=82S/Sr=E2=94=82 7'h7E RnW=3D0 =E2=94=82ACK=E2=94=82 ENTDAA =E2=94= =82 T =E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=90 =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=B4=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=B4=E2=94=80=E2=94=80=E2=94=80=E2=94=B4=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=B4=E2=94=80=E2=94=80=E2=94=80=E2=94=98 =E2=94=82 =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=98 =E2=94=82 =E2=94=8C=E2=94=80=E2=94=80=E2=94=AC=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=AC=E2=94=80=E2=94=80=E2=94=80=E2=94=AC=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=AC=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=AC= =E2=94=80=E2=94=80=E2=94=80=E2=94=AC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=90 =E2=94=94=E2=94=80=E2=96=BA=E2=94=82Sr=E2=94=827'h7E RnW=3D1 =E2=94=82ACK= =E2=94=8248bit UID BCR DCR=E2=94=82Assign 7bit Addr=E2=94=82PAR=E2=94=82 AC= K/NACK=E2=94=82 =E2=94=94=E2=94=80=E2=94=80=E2=94=B4=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=B4=E2=94=80=E2=94=80=E2=94=80=E2=94=B4=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=B4=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=B4=E2=94= =80=E2=94=80=E2=94=80=E2=94=B4=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=98 Some master controllers (such as HCI) need to prepare the entire above transaction before sending it out to the I3C bus. This means that a 7-bit dynamic address needs to be allocated before knowing the target device's UID information. However, some I3C targets may request specific addresses (called as "init_dyn_addr"), which is typically specified by the DT-'s assigned-address property. Lower addresses having higher IBI priority. If it is available, i3c_bus_get_free_addr() preferably return a free address that is not in the list of desired addresses (called as "init_dyn_addr"). This allows the device with the "init_dyn_addr" to switch to its "init_dyn_addr" when it hot-joins the I3C bus. Otherwise, if the "init_dyn_addr" is already in use by another I3C device, the target device will not be able to switch to its desired address. If the previous step fails, fallback returning one of the remaining unassigned address, regardless of its state in the desired list. Signed-off-by: Frank Li Reviewed-by: Miquel Raynal --- Change from v6 to v7 - always use i3c_bus_get_addr_slot_status_mask() in i3c_bus_get_free_addr - ((unsigned long)status & mask) in i3c_bus_set_addr_slot_status_mask() incase status bigger than mask; Change from v5 to v6 - fix version number, should start v5 - change to I3C_ADDR_SLOT_EXT_DESIRED - remove _ext function and direct use _mask function - rework commit message and comments according to Miqu=C3=A8l's feedback. - change mask type to u32 change from v3 to v4 - rewrite commit message and comment for i3c_bus_get_free_addr() --- drivers/i3c/master.c | 65 ++++++++++++++++++++++++++++++++++++++----= ---- include/linux/i3c/master.h | 7 +++-- 2 files changed, 59 insertions(+), 13 deletions(-) diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c index dcf8d23c5941a..e0962a17de7f0 100644 --- a/drivers/i3c/master.c +++ b/drivers/i3c/master.c @@ -345,7 +345,7 @@ const struct bus_type i3c_bus_type =3D { EXPORT_SYMBOL_GPL(i3c_bus_type); =20 static enum i3c_addr_slot_status -i3c_bus_get_addr_slot_status(struct i3c_bus *bus, u16 addr) +i3c_bus_get_addr_slot_status_mask(struct i3c_bus *bus, u16 addr, u32 mask) { unsigned long status; int bitpos =3D addr * I3C_ADDR_SLOT_STATUS_BITS; @@ -356,11 +356,17 @@ i3c_bus_get_addr_slot_status(struct i3c_bus *bus, u16= addr) status =3D bus->addrslots[bitpos / BITS_PER_LONG]; status >>=3D bitpos % BITS_PER_LONG; =20 - return status & I3C_ADDR_SLOT_STATUS_MASK; + return status & mask; } =20 -static void i3c_bus_set_addr_slot_status(struct i3c_bus *bus, u16 addr, - enum i3c_addr_slot_status status) +static enum i3c_addr_slot_status +i3c_bus_get_addr_slot_status(struct i3c_bus *bus, u16 addr) +{ + return i3c_bus_get_addr_slot_status_mask(bus, addr, I3C_ADDR_SLOT_STATUS_= MASK); +} + +static void i3c_bus_set_addr_slot_status_mask(struct i3c_bus *bus, u16 add= r, + enum i3c_addr_slot_status status, u32 mask) { int bitpos =3D addr * I3C_ADDR_SLOT_STATUS_BITS; unsigned long *ptr; @@ -369,9 +375,14 @@ static void i3c_bus_set_addr_slot_status(struct i3c_bu= s *bus, u16 addr, return; =20 ptr =3D bus->addrslots + (bitpos / BITS_PER_LONG); - *ptr &=3D ~((unsigned long)I3C_ADDR_SLOT_STATUS_MASK << - (bitpos % BITS_PER_LONG)); - *ptr |=3D (unsigned long)status << (bitpos % BITS_PER_LONG); + *ptr &=3D ~((unsigned long)mask << (bitpos % BITS_PER_LONG)); + *ptr |=3D ((unsigned long)status & mask) << (bitpos % BITS_PER_LONG); +} + +static void i3c_bus_set_addr_slot_status(struct i3c_bus *bus, u16 addr, + enum i3c_addr_slot_status status) +{ + i3c_bus_set_addr_slot_status_mask(bus, addr, status, I3C_ADDR_SLOT_STATUS= _MASK); } =20 static bool i3c_bus_dev_addr_is_avail(struct i3c_bus *bus, u8 addr) @@ -383,13 +394,44 @@ static bool i3c_bus_dev_addr_is_avail(struct i3c_bus = *bus, u8 addr) return status =3D=3D I3C_ADDR_SLOT_FREE; } =20 +/* + * =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=AC=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=AC=E2=94=80=E2=94=80=E2=94=80=E2=94=AC=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=AC=E2=94=80=E2=94=80=E2=94=80=E2=94=90 + * =E2=94=82S/Sr=E2=94=82 7'h7E RnW=3D0 =E2=94=82ACK=E2=94=82 ENTDAA =E2= =94=82 T =E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=90 + * =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=B4=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=B4=E2=94=80=E2=94=80=E2=94=80=E2=94=B4=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=B4=E2=94=80=E2=94=80=E2=94=80=E2=94=98 =E2=94=82 + * =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=98 + * =E2=94=82 =E2=94=8C=E2=94=80=E2=94=80=E2=94=AC=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=AC=E2=94=80=E2=94=80=E2=94=80=E2=94=AC=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=AC= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =AC=E2=94=80=E2=94=80=E2=94=80=E2=94=AC=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=90 + * =E2=94=94=E2=94=80=E2=96=BA=E2=94=82Sr=E2=94=827'h7E RnW=3D1 =E2=94=82= ACK=E2=94=8248bit UID BCR DCR=E2=94=82Assign 7bit Addr=E2=94=82PAR=E2=94=82= ACK/NACK=E2=94=82 + * =E2=94=94=E2=94=80=E2=94=80=E2=94=B4=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=B4=E2=94=80=E2=94=80=E2=94=80=E2=94=B4=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=B4=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=B4=E2= =94=80=E2=94=80=E2=94=80=E2=94=B4=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=98 + * Some master controllers (such as HCI) need to prepare the entire above = transaction before + * sending it out to the I3C bus. This means that a 7-bit dynamic address = needs to be allocated + * before knowing the target device's UID information. + * + * However, some I3C targets may request specific addresses (called as "in= it_dyn_addr"), which is + * typically specified by the DT-'s assigned-address property. Lower addre= sses having higher IBI + * priority. If it is available, i3c_bus_get_free_addr() preferably return= a free address that is + * not in the list of desired addresses (called as "init_dyn_addr"). This = allows the device with + * the "init_dyn_addr" to switch to its "init_dyn_addr" when it hot-joins = the I3C bus. Otherwise, + * if the "init_dyn_addr" is already in use by another I3C device, the tar= get device will not be + * able to switch to its desired address. + * + * If the previous step fails, fallback returning one of the remaining una= ssigned address, + * regardless of its state in the desired list. + */ static int i3c_bus_get_free_addr(struct i3c_bus *bus, u8 start_addr) { enum i3c_addr_slot_status status; u8 addr; =20 for (addr =3D start_addr; addr < I3C_MAX_ADDR; addr++) { - status =3D i3c_bus_get_addr_slot_status(bus, addr); + status =3D i3c_bus_get_addr_slot_status_mask(bus, addr, + I3C_ADDR_SLOT_EXT_STATUS_MASK); + if (status =3D=3D I3C_ADDR_SLOT_FREE) + return addr; + } + + for (addr =3D start_addr; addr < I3C_MAX_ADDR; addr++) { + status =3D i3c_bus_get_addr_slot_status_mask(bus, addr, + I3C_ADDR_SLOT_STATUS_MASK); if (status =3D=3D I3C_ADDR_SLOT_FREE) return addr; } @@ -1918,9 +1960,10 @@ static int i3c_master_bus_init(struct i3c_master_con= troller *master) goto err_rstdaa; } =20 - i3c_bus_set_addr_slot_status(&master->bus, - i3cboardinfo->init_dyn_addr, - I3C_ADDR_SLOT_I3C_DEV); + i3c_bus_set_addr_slot_status_mask(&master->bus, + i3cboardinfo->init_dyn_addr, + I3C_ADDR_SLOT_I3C_DEV | I3C_ADDR_SLOT_EXT_DESIRED, + I3C_ADDR_SLOT_EXT_STATUS_MASK); =20 /* * Only try to create/attach devices that have a static diff --git a/include/linux/i3c/master.h b/include/linux/i3c/master.h index 2100547b2d8d2..6e5328c6c6afd 100644 --- a/include/linux/i3c/master.h +++ b/include/linux/i3c/master.h @@ -298,7 +298,8 @@ enum i3c_open_drain_speed { * @I3C_ADDR_SLOT_I2C_DEV: address is assigned to an I2C device * @I3C_ADDR_SLOT_I3C_DEV: address is assigned to an I3C device * @I3C_ADDR_SLOT_STATUS_MASK: address slot mask - * + * @I3C_ADDR_SLOT_EXT_DESIRED: the bitmask represents addresses that are p= referred by some devices, + * such as the "assigned-address" property in a device tree sourc= e. * On an I3C bus, addresses are assigned dynamically, and we need to know = which * addresses are free to use and which ones are already assigned. * @@ -311,9 +312,11 @@ enum i3c_addr_slot_status { I3C_ADDR_SLOT_I2C_DEV, I3C_ADDR_SLOT_I3C_DEV, I3C_ADDR_SLOT_STATUS_MASK =3D 3, + I3C_ADDR_SLOT_EXT_STATUS_MASK =3D 7, + I3C_ADDR_SLOT_EXT_DESIRED =3D BIT(2), }; =20 -#define I3C_ADDR_SLOT_STATUS_BITS 2 +#define I3C_ADDR_SLOT_STATUS_BITS 4 =20 /** * struct i3c_bus - I3C bus object --=20 2.34.1