From patchwork Fri Oct 16 13:43:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Zhang X-Patchwork-Id: 298902 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.9 required=3.0 tests=BAYES_00, DATE_IN_FUTURE_06_12,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46C60C43457 for ; Fri, 16 Oct 2020 05:43:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DA0692067D for ; Fri, 16 Oct 2020 05:43:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="W1wcKSr2" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389671AbgJPFnG (ORCPT ); Fri, 16 Oct 2020 01:43:06 -0400 Received: from mail-am6eur05on2045.outbound.protection.outlook.com ([40.107.22.45]:8065 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388851AbgJPFnF (ORCPT ); Fri, 16 Oct 2020 01:43:05 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YnvS750N7Nfq5isWvZqrUE7WE7XyEsD6frH0AzrOe0uOwB1XkhZYO4rAErT2oU5n2aD14Bqn0Xv8LDs8liC4e/qp3hqUVWrCeyjNuP3DaJAeXnRVjWtANMpIpswzLZ7MB/sim5S0it3oZScNssm/Gif4ggDYJhaQbM95vj1ir6G583MD9vIvyN8Z3amfHcN2z80JVprzwJJsW8rV6V0Cgg4Ox0/06TauE2xRuJ3M6AuBVBRaWlKhrW9RHfs6GoGDcsFxjKcjo9NqxhND8So1qFSt2QOUWvBaUymed9jh0NjdbI1ihDJG9/mxmRZqEMwyy1RWx5uSV+v8lsE9ObwNVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tDbAwQnA5enTI3i2f5XQgOnhhQ23eN6woNIFu1j7SmI=; b=XOdfQ8zoUPVu9osYZ/BBsOJbRRv9mz8EnWUH5AXIqxa5jHxRQi3V4kTzYLX2nTX2MhMe5s7GvZUS+cmjh0d8BifIvNKbzT4L/Zz7UAcckMVnc77AqPCGYMhbsj0uIgkEx7vSSfqNwvnIZIQRM3dofPB4059s7CbxxahQh3dZcHq6x8SAT4J74AfnufFrEbfdfhpmTefKJTJaCNOLmDx9kjN65tig+Z8Z87Z1VtpC/Q8+cSas//CjXevItIZADzDGrQVlklqul228+GL4Ljlz4uPIuE9hp6c2IHNi0WUWj6NGmwryV5PnE/Nfv6gmk6HmAxtmtWW7rqu7V1I28V/kMw== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tDbAwQnA5enTI3i2f5XQgOnhhQ23eN6woNIFu1j7SmI=; b=W1wcKSr2snvI49D5qRdva/Gf6czTl4c2EhjKV0wWCg9Wv271p1gj5ktLzF4HkEhY6fEnc0FR2sCgth65cqz7N1pwM54gE9sgQ4DpSQNB4P+ttCk2J31S1uTLWwUIMwIG8SeFcLU7KjTyr5Hw1dAfZK1GYuSB41VP+0E5mh0R/MU= Authentication-Results: pengutronix.de; dkim=none (message not signed) header.d=none; pengutronix.de; dmarc=none action=none header.from=nxp.com; Received: from DB8PR04MB6795.eurprd04.prod.outlook.com (2603:10a6:10:fa::15) by DBAPR04MB7333.eurprd04.prod.outlook.com (2603:10a6:10:1b2::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.21; Fri, 16 Oct 2020 05:43:00 +0000 Received: from DB8PR04MB6795.eurprd04.prod.outlook.com ([fe80::3c3a:58b9:a1cc:cbcc]) by DB8PR04MB6795.eurprd04.prod.outlook.com ([fe80::3c3a:58b9:a1cc:cbcc%9]) with mapi id 15.20.3477.021; Fri, 16 Oct 2020 05:43:00 +0000 From: Joakim Zhang To: mkl@pengutronix.de, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, linux-imx@nxp.com, victor.liu@nxp.com, peng.fan@nxp.com, linux-can@vger.kernel.org, pankaj.bansal@nxp.com, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/6] firmware: imx: always export SCU symbols Date: Fri, 16 Oct 2020 21:43:15 +0800 Message-Id: <20201016134320.20321-2-qiangqing.zhang@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201016134320.20321-1-qiangqing.zhang@nxp.com> References: <20201016134320.20321-1-qiangqing.zhang@nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR02CA0068.apcprd02.prod.outlook.com (2603:1096:4:54::32) To DB8PR04MB6795.eurprd04.prod.outlook.com (2603:10a6:10:fa::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.71) by SG2PR02CA0068.apcprd02.prod.outlook.com (2603:1096:4:54::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.21 via Frontend Transport; Fri, 16 Oct 2020 05:42:57 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 13a9bd34-94cd-47c8-9123-08d8719657dc X-MS-TrafficTypeDiagnostic: DBAPR04MB7333: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:751; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WDKD7XcFlt/ar03cH+EJ7/oQK2PgHVjz7Pe1ymw2mJaDS8jGfxobxim1Pm/qkqBSe7yVKlOjiwcQ4adUczJnOV6b84uWmCXk9gzIQRu8LS75iWwgsU2gDcrYQww8kj6sd0YFM0vpySJEjsTpeKT5fsRZD4f77/YSo1rU0c5IdYy/Zeumh9+8ntep+arprEK8gqc5z09h2h01N2dKt0Wq+OzgIuR8HLIA0ykoPbEgzBn57u/gMCi38xVFco96aiiLHUq1AucN8BfWJ0QoI3/KfjG75rWAx1HNRxdkaKgRrKHqTDYZJ0rGegYjGqb+7haaZM1pW2bOn2bj8KsyBUtMjBUZj7BTHrGSfJ2QTSUO1P1ddh8E8dlsqPrhihuOFT/gCXkHSbDd/aoM0nz/kcdiRMbN8CT+E/q37rd18VvFEoA= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB8PR04MB6795.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(346002)(376002)(39860400002)(366004)(136003)(34490700002)(2906002)(316002)(6512007)(8936002)(86362001)(5660300002)(1076003)(69590400008)(478600001)(52116002)(6506007)(6486002)(66556008)(83380400001)(36756003)(4326008)(6666004)(26005)(186003)(2616005)(956004)(16526019)(8676002)(66946007)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: Nn2OuamZEOff9hTH15XcBFljwAYmY5JlX3D6tLIOSuHkpDwBXZMAxXVzTkUoIuC3qnDLiEd5XxMYugI6HRmOB6c9SARLdP45QWTU36QZtU3bAWMGzyq6Uk0wpsvD2UCcmODitcOhiMInpHGG5w37DEn7HTySLJIAyK732j1E30Hc0ktWx+J6bdsEiWpp6QVlM1AQzdt1BasR03c3peqcv6HBqWTpD8FzfvsNrfpPL5a07bSD67n2Vf1x/zC24gQsYtUyIf/7mYPv0PvJF0W9fo+VFvG52w6J1IplAduuKAFBgBkrBsgvS1pZ0sCG+/Kfy9X7FK3KHDhGp3SENLH9z7nlp4qACTEznEVzXeH0bdLDYtoxoWTHlOGwDOXgp/3TYdNPOv1Lhk7EauDHeZ/th984KUOdlbQN7hfDvibpqbQ6ypfHjF8JjnITOrhXqOst+TMo7klfOVdliIQ90OVyhESQgYr+xlefr0oZQ/Iqn7FpvvQcJDNQJS4Yma+m+03EAPQmtxPpzDsli/mu/VRGVhTae/ENvBsiTRIwTwPQOeGwKlU6ZPuo4bHu90RMOK0loghJwx1Ac4b2nCyQY6j+b5nr+/ATAkkedrEZJ1h/j+FtfLaRHRvsEoqM+XkXiZ0dMmY9tdK01mUyxTgH2avoZw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 13a9bd34-94cd-47c8-9123-08d8719657dc X-MS-Exchange-CrossTenant-AuthSource: DB8PR04MB6795.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2020 05:43:00.8420 (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: SHkB26GYl2BjizHcB8eYHSfdvBmuMemH+uXmMKLkcqxT5+Jwg7KK8bzLF+ULBdT5vAb9sgZEnk4ePavUcABIsg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7333 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Liu Ying Always export SCU symbols for both SCU SoCs and non-SCU SoCs to avoid build error. Signed-off-by: Liu Ying Signed-off-by: Peng Fan Signed-off-by: Joakim Zhang --- include/linux/firmware/imx/ipc.h | 15 +++++++++++++++ include/linux/firmware/imx/svc/misc.h | 23 +++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/include/linux/firmware/imx/ipc.h b/include/linux/firmware/imx/ipc.h index 891057434858..300fa253fc30 100644 --- a/include/linux/firmware/imx/ipc.h +++ b/include/linux/firmware/imx/ipc.h @@ -34,6 +34,7 @@ struct imx_sc_rpc_msg { uint8_t func; }; +#if IS_ENABLED(CONFIG_IMX_SCU) /* * This is an function to send an RPC message over an IPC channel. * It is called by client-side SCFW API function shims. @@ -55,4 +56,18 @@ int imx_scu_call_rpc(struct imx_sc_ipc *ipc, void *msg, bool have_resp); * @return Returns an error code (0 = success, failed if < 0) */ int imx_scu_get_handle(struct imx_sc_ipc **ipc); + +#else +static inline int +imx_scu_call_rpc(struct imx_sc_ipc *ipc, void *msg, bool have_resp) +{ + return -EIO; +} + +static inline int imx_scu_get_handle(struct imx_sc_ipc **ipc) +{ + return -EIO; +} +#endif + #endif /* _SC_IPC_H */ diff --git a/include/linux/firmware/imx/svc/misc.h b/include/linux/firmware/imx/svc/misc.h index 031dd4d3c766..d255048f17de 100644 --- a/include/linux/firmware/imx/svc/misc.h +++ b/include/linux/firmware/imx/svc/misc.h @@ -46,6 +46,7 @@ enum imx_misc_func { * Control Functions */ +#if IS_ENABLED(CONFIG_IMX_SCU) int imx_sc_misc_set_control(struct imx_sc_ipc *ipc, u32 resource, u8 ctrl, u32 val); @@ -55,4 +56,26 @@ int imx_sc_misc_get_control(struct imx_sc_ipc *ipc, u32 resource, int imx_sc_pm_cpu_start(struct imx_sc_ipc *ipc, u32 resource, bool enable, u64 phys_addr); +#else +static inline int +imx_sc_misc_set_control(struct imx_sc_ipc *ipc, u32 resource, + u8 ctrl, u32 val) +{ + return -EIO; +} + +static inline int +imx_sc_misc_get_control(struct imx_sc_ipc *ipc, u32 resource, + u8 ctrl, u32 *val) +{ + return -EIO; +} + +static inline int imx_sc_pm_cpu_start(struct imx_sc_ipc *ipc, u32 resource, + bool enable, u64 phys_addr) +{ + return -EIO; +} +#endif + #endif /* _SC_MISC_API_H */ From patchwork Fri Oct 16 13:43:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Zhang X-Patchwork-Id: 288413 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.9 required=3.0 tests=BAYES_00, DATE_IN_FUTURE_06_12,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C55DC43457 for ; Fri, 16 Oct 2020 05:43:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3B86D2067D for ; Fri, 16 Oct 2020 05:43:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="M2Pb+wRy" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389967AbgJPFnS (ORCPT ); Fri, 16 Oct 2020 01:43:18 -0400 Received: from mail-am6eur05on2083.outbound.protection.outlook.com ([40.107.22.83]:33504 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388851AbgJPFnN (ORCPT ); Fri, 16 Oct 2020 01:43:13 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W/HwZpWucY6PG+0mJNoDanZ+mMHizRP8galko1goM4SMhPSmJ7eqUmCh4+Un3BKSD/hIjHpcs0x1Lzl9gS32KLoAgOBrIy8m/GVfh9/UeLjWRplppWioGqeqRmvQ5r11WFDPYo1geasH4i/6kMWcUULBIWtAKuxZJu2pNTx5H2kIY39y9iiPlwMtGgeNliGTxhTc18vqQ66VYKDdAedZp1LRQsl0QSYMHdy4daVzE6cnofhek4b6nt5/PhAhnIu/nkYNUqlc3EGheHKjmHca6wD3bhV/kupv0Z+3NrQCtChe78J/Vy8VwdYPSrjDDI9g462eFAeCfKrtKVVWvGWVxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ur08Q6AfFGrPIwCDQuAKK4njckBVmBZasrWQCnYHC5c=; b=DOrKXfPCmWt7qX0Agq7oXPb/PcnX9k/WK37AwUfD+ifdCrmUQP0J3+L+FoMHZF2HSjMPFdxHLDOpviyjX4d7k8IznvxwSaiyHtiN19CoJfed+ZcZ88h7ceq8hpNHfVZ04n8mtcc19KJdcXNYv9kTC/NZ+GIVsgD/sJbaywQ0emGaODvs9WXdUYy5qgrSz1di9PZCXCYnxWteuSizFD+vakamrWGDbqDwBZtOO7Q/PBkpwc4nGb3lT8Jtn32Hbi/hl0h50RhhceSpLKZ1uKrvO0+lCzE9w4DzJaViTaUE0nwIS1Suzm/bK6aCNdUxYNfXhV+L0yZyggBITKFnSDxXzA== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ur08Q6AfFGrPIwCDQuAKK4njckBVmBZasrWQCnYHC5c=; b=M2Pb+wRyeB9W7oEwakHlpHMuYGje74xf40p+hM4i6UvldUkx4FVQLgBD0uFLINxb9zfef4HKPkx+N+7InlOaYAbRh/GyorHO9R3vLm2SXVbhpY91dhxkxpUOUqhWKKFPO+dj4o9Tk/7RHZMdN94K3IMlsnmcVw4723+J+e0cGNk= Authentication-Results: pengutronix.de; dkim=none (message not signed) header.d=none; pengutronix.de; dmarc=none action=none header.from=nxp.com; Received: from DB8PR04MB6795.eurprd04.prod.outlook.com (2603:10a6:10:fa::15) by DBAPR04MB7333.eurprd04.prod.outlook.com (2603:10a6:10:1b2::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.21; Fri, 16 Oct 2020 05:43:05 +0000 Received: from DB8PR04MB6795.eurprd04.prod.outlook.com ([fe80::3c3a:58b9:a1cc:cbcc]) by DB8PR04MB6795.eurprd04.prod.outlook.com ([fe80::3c3a:58b9:a1cc:cbcc%9]) with mapi id 15.20.3477.021; Fri, 16 Oct 2020 05:43:05 +0000 From: Joakim Zhang To: mkl@pengutronix.de, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, linux-imx@nxp.com, victor.liu@nxp.com, peng.fan@nxp.com, linux-can@vger.kernel.org, pankaj.bansal@nxp.com, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/6] dt-bindings: can: flexcan: fix fsl,clk-source property Date: Fri, 16 Oct 2020 21:43:16 +0800 Message-Id: <20201016134320.20321-3-qiangqing.zhang@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201016134320.20321-1-qiangqing.zhang@nxp.com> References: <20201016134320.20321-1-qiangqing.zhang@nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR02CA0068.apcprd02.prod.outlook.com (2603:1096:4:54::32) To DB8PR04MB6795.eurprd04.prod.outlook.com (2603:10a6:10:fa::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.71) by SG2PR02CA0068.apcprd02.prod.outlook.com (2603:1096:4:54::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.21 via Frontend Transport; Fri, 16 Oct 2020 05:43:01 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 3013073c-aba1-49f7-ceef-08d871965a58 X-MS-TrafficTypeDiagnostic: DBAPR04MB7333: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2733; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: E5Pcp7WTAXp1/IiIaZ5vCo8nLTl8tljx1ijDHGy9aL3h+GH8uac2RZpbevj8AiCo4ARkPXECvD+1A6z0EIzS8pjAForCruM+EEV/LRmnf+6k2hPDvnVdyqKmdiwyFROH8o7WL3pCxNzY/pw171xaKw1fH4vzvEXwJnSLHLmNLokg31pmhOyuPZrQW4PPyhUyMdem/RrbEBtdVewnPIfgG7ogSZrof4U2ij3lLLWkiDBYjlz4kcp1s2Zv7Rl3RLWmesARHz9nkUaIekKLWHTE4TZckxOpCl3DC+rVL7QBzlFXMs7JEH0jo9y+/1hyvGGoRsJeTcenQtC75rqjg2Y95GKc5XWv8D7/gw5hzysgyrmuRf0xIcqXtMWeBifI5fsHVcbIKqiWWmRozttptYip5FNVXdDKBLU0mu1s5J9TkF8= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB8PR04MB6795.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(346002)(376002)(39860400002)(366004)(136003)(34490700002)(2906002)(316002)(6512007)(8936002)(86362001)(5660300002)(4744005)(1076003)(69590400008)(478600001)(52116002)(6506007)(6486002)(66556008)(83380400001)(36756003)(4326008)(6666004)(26005)(186003)(2616005)(956004)(16526019)(8676002)(66946007)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: Rghswu2eGu5ENgqmPSFM4e1hpO/tEusRsy8qlbKLgX1FWiIsbKzVOZF/z6QDfAdjwsJlcIPTkTZSTF8aE5SoCpOl5ShoNUf/ggMFolSPdPQZZ2x83FKeO7Gqb7n75Me9Lsp4do574lvD/URQiQh9aEOzvhWXY98e8418eQ6wJevzn+pigZNsY/mtXyNuYNx/NrrtCcb7/Yscyv4N7BlGtm9RQwOXjXTbaAtSXINs1UJfZxYrigvAyoQ15fHsEMcHHi7R+3NQ9GZXV3G20g/tsNxuMpggMkjvllXRSrEsTyXkBUaJ9v1zSKxd+pbDhOMaidvz7NNIw2sFcYOjd5JA7I+rHlsOgFz6f9qL6aIL55ZDHsJ/+XiALkS8sZ1DyvwdJTGooOluXLVUIn2kyypfS21DdO20s2Ga2jrxWQJ5iOBTU79wVBDTX5z6MZ2VyfDGvpLNxLIKegh0LxpW75xueOYTlETGrOrY7FXoeXpGK/Re8hA0LsZx9OnJ7x8v+d2FtnxXwTvFlMb7qgJty0Xx+vwmYsymISvZJg4e6pSK7fvIGgQzgByNgr/45GFEmrnfcBSMUQ5n/IclU4ZimIgm5B8T37YUkY7mQHrTXSp4HJndpnHKOpdDVlw9hIWEnXeq+y9VpfAAPW7eYyYLfkJehA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3013073c-aba1-49f7-ceef-08d871965a58 X-MS-Exchange-CrossTenant-AuthSource: DB8PR04MB6795.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2020 05:43:05.1431 (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: lwqJOi3ubtXqzqJkeG69uJY1VcM2Zg/ClUOMuxZ/NLF6Rnqi0ybmpoPMfzbikgiv781e/WuaBpKETH9V2RKPXw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7333 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Correct fsl,clk-source example since flexcan driver uses "of_property_read_u8" to get this property. Fixes: 9d733992772d ("dt-bindings: can: flexcan: add PE clock source property to device tree") Signed-off-by: Joakim Zhang --- Documentation/devicetree/bindings/net/can/fsl-flexcan.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt b/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt index e10b6eb955e1..6af67f5e581c 100644 --- a/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt +++ b/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt @@ -53,5 +53,5 @@ Example: interrupts = <48 0x2>; interrupt-parent = <&mpic>; clock-frequency = <200000000>; // filled in by bootloader - fsl,clk-source = <0>; // select clock source 0 for PE + fsl,clk-source = /bits/ 8 <0>; // select clock source 0 for PE }; From patchwork Fri Oct 16 13:43:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Zhang X-Patchwork-Id: 298901 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.9 required=3.0 tests=BAYES_00, DATE_IN_FUTURE_06_12,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9AADC433DF for ; Fri, 16 Oct 2020 05:43:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7BF542080A for ; Fri, 16 Oct 2020 05:43:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="DtsWcDp8" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388851AbgJPFnT (ORCPT ); Fri, 16 Oct 2020 01:43:19 -0400 Received: from mail-am6eur05on2083.outbound.protection.outlook.com ([40.107.22.83]:33504 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2389786AbgJPFnS (ORCPT ); Fri, 16 Oct 2020 01:43:18 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eNP+uSgk5wIpUfVPlK19fK8poI8c2Dn7BC2YmnvP0xv1jWpnKY6KkvzKaZc1Vr8W0IIMp9r9zPzKrPTYWAzG//pnUlUkm3MdsOLIK5SuwnyR7+RKwvy6s+hMbwPdQ2VP/9q6wefvBczpS6/C4fwKY6bT/pd80AjJwRO1LTwphD5jQ+sJP6z1I5dbjK5Nr3axhK8A5a80EBZjv9mcubDJoW766/bdAoijxuYeG4UnG/3n2wvxovrsD7bGTZGqzt3vujchH/5RHTszu8dAn9NGtMl5si68guq1t0HD8ZV2Gsf+wbaXdBViJEBEx4LH5J5CGEpye+zMGvlCNLxelOiBqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hS+++hXzQHOHWS1Go95Fv0Zz3XGkSwcC+5QAcYja7Nk=; b=S/8zmr0osnrw1RUqGbjsv0sxGz/bma0epBdsfLEvr9vgSx7X4Cot/YCJdubIkaP90mPS+yt+91qhHum+hGIf2DwDoldk4MtAMjg9TtSjW4yWXhlokioCFaLza6aaDgz8miId0cwsa2GkVN8HiQKmO2hK0E046pyK2Fjlt3oEWEmbHldQXiKfY+vfdQycsdvaAT/poXQYWLscJ2KTmZst50gbHvYq4CqAHyHNYxXVf0WcvPFO5kQRA5ZF4bNkW2XuvwsmEyvIjylZbqzCYV9t/998DepyfRfeurySc8spue8HYSK2hdjFI0Rj6kVtbqJI3RvDHt9HUScHuIJ7aFHwcQ== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hS+++hXzQHOHWS1Go95Fv0Zz3XGkSwcC+5QAcYja7Nk=; b=DtsWcDp87uyZ4h8FHMzLSol9hfybdpCk07QG0ubRfFJYMDP9nZpOQsAm7IqesT7PbJpwh0uQT3VMUmakj2ciL7g1/9FdBLR+KB6JgSVzox/1XXBSZ576oz9Qxgq0BIUzjXwmTJ5Y3GnJYMAnEWaZyBZmphF7vvLTU2LvE9UHGm8= Authentication-Results: pengutronix.de; dkim=none (message not signed) header.d=none; pengutronix.de; dmarc=none action=none header.from=nxp.com; Received: from DB8PR04MB6795.eurprd04.prod.outlook.com (2603:10a6:10:fa::15) by DBAPR04MB7333.eurprd04.prod.outlook.com (2603:10a6:10:1b2::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.21; Fri, 16 Oct 2020 05:43:09 +0000 Received: from DB8PR04MB6795.eurprd04.prod.outlook.com ([fe80::3c3a:58b9:a1cc:cbcc]) by DB8PR04MB6795.eurprd04.prod.outlook.com ([fe80::3c3a:58b9:a1cc:cbcc%9]) with mapi id 15.20.3477.021; Fri, 16 Oct 2020 05:43:09 +0000 From: Joakim Zhang To: mkl@pengutronix.de, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, linux-imx@nxp.com, victor.liu@nxp.com, peng.fan@nxp.com, linux-can@vger.kernel.org, pankaj.bansal@nxp.com, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/6] dt-bindings: can: flexcan: add fsl, can-index property to indicate a resource Date: Fri, 16 Oct 2020 21:43:17 +0800 Message-Id: <20201016134320.20321-4-qiangqing.zhang@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201016134320.20321-1-qiangqing.zhang@nxp.com> References: <20201016134320.20321-1-qiangqing.zhang@nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR02CA0068.apcprd02.prod.outlook.com (2603:1096:4:54::32) To DB8PR04MB6795.eurprd04.prod.outlook.com (2603:10a6:10:fa::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.71) by SG2PR02CA0068.apcprd02.prod.outlook.com (2603:1096:4:54::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.21 via Frontend Transport; Fri, 16 Oct 2020 05:43:05 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 4405f036-5568-473a-170b-08d871965ce4 X-MS-TrafficTypeDiagnostic: DBAPR04MB7333: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3173; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +3iDj8LMJMxLEFw4x97/vgiL4zNHPxWbx6IdX9roFjUXkS3IZLABGtmIe0Y/YQA9jGs/MxBIgJPUj/E5Y1d8wlDjeda4tsMtlAKJis6mtvKjBNQa+PbCGdX5alg+WbTxp/+2kh4AsPrzlTYyfAn7U8w+7CaCAK1qtFKjR4u4DYF7Au+dxverCjybuTAukJkavC69fYY+xSyoS8/AI20KzCxBeqy6bBe+wQCRpZh/UuukTAsBjjqurA2uw4nCIDXX28E968Fw1liga0znqBVYSSGiHPBO5G3BkBgMC66ZnUjCcLbzg4iUsWZ8sIExp0BkiHSV0V9pGIPPc05nMhUDH4CRB9YFTRDYO5hDTy8zZYOkdeU/J/O4ZFfydAX//QCgBBXlPdfXv58pNHwPkprcKn/HXcPpwJP5NKif2qSkruU= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB8PR04MB6795.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(346002)(376002)(39860400002)(366004)(136003)(34490700002)(2906002)(316002)(6512007)(8936002)(86362001)(5660300002)(1076003)(69590400008)(478600001)(52116002)(6506007)(6486002)(66556008)(83380400001)(36756003)(4326008)(6666004)(26005)(186003)(2616005)(956004)(16526019)(8676002)(66946007)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: lHwFkqt8u6vbduuO9aAkEiUCaNeaqwCpTM+aMPVXmgQFzOLmC70gjCGdIQHfN3hsz4qUiPTJiVJ9W2MXerk92i9KaOfJMbynA6I9pbBqSKrnC24C6UchuSx5FxadZUOMFmJsa77xSHq9p/Ee80bh4hEG1F8iL3ZUm2E5ilEnKBOZHux2SgKeAGT9hCEVbm7Noc/Wmx+UonYHqgF0P0Rh3fOdey7GopQMSjyszLkglC7DwoQQe99c/6g/JzRe6H1Gc8/KwH6eX0jqwhVM3gtaUM2L0s8YdqPk2fsL5de7HRCv1IjNh03ZopCLcPbaPDSNgDLGMku1mzhkMgGfCB4pukuiAkyribuGzWRIUVEdgqfLuB+fnNHDKidScO042wx/2LT6Dwotn3wozLeyXrlqp1t+SCpt2kzyc8JvI9ZZTXSvULywRzNr4sZgXLl8OI2q4we3+QhmLt0Vv/A9g9E36idJMP+ndQpOjPuoVwmiYEV2e0Hi9aKX0fax3M1CmWgoqlPf8tmPiUKdRtO9TUYh/ll8omLJbmTjs5nKRjcZa0HXVRPoSvc7nXHlrU95rQLLuIIeuzbnY2dI1mp1mzkVKDL+Jf4oBNf2MerDKuMSuRIiMtIbDY43FpfMebblZu4Q2T2I8NXM89qgpyc5dDpS9w== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4405f036-5568-473a-170b-08d871965ce4 X-MS-Exchange-CrossTenant-AuthSource: DB8PR04MB6795.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2020 05:43:09.4173 (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: PWCtVDDwrDmg3hyzWQp/lWQL1ZTPCnHpqhdTh1uLv7DDBbGd3IadL4/Pxt6eL7Y8oLUR4kKaNfRnXqR0tC2Tzw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7333 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org For SoCs with SCU support, need setup stop mode via SCU firmware, so this property can help indicate a resource. Signed-off-by: Joakim Zhang --- Documentation/devicetree/bindings/net/can/fsl-flexcan.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt b/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt index 6af67f5e581c..839c0c0064a2 100644 --- a/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt +++ b/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt @@ -43,6 +43,10 @@ Optional properties: 0: clock source 0 (oscillator clock) 1: clock source 1 (peripheral clock) +- fsl,can-index: The index of CAN instance. + For SoCs with SCU support, need setup stop mode via SCU firmware, + so this property can help indicate a resource. + - wakeup-source: enable CAN remote wakeup Example: @@ -54,4 +58,5 @@ Example: interrupt-parent = <&mpic>; clock-frequency = <200000000>; // filled in by bootloader fsl,clk-source = /bits/ 8 <0>; // select clock source 0 for PE + fsl,can-index = /bits/ 8 <1>; // the second CAN instance }; From patchwork Fri Oct 16 13:43:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Zhang X-Patchwork-Id: 288412 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.9 required=3.0 tests=BAYES_00, DATE_IN_FUTURE_06_12,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4925C43467 for ; Fri, 16 Oct 2020 05:43:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4BE6E20829 for ; Fri, 16 Oct 2020 05:43:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="KtQJXOjG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390424AbgJPFnh (ORCPT ); Fri, 16 Oct 2020 01:43:37 -0400 Received: from mail-am6eur05on2083.outbound.protection.outlook.com ([40.107.22.83]:33504 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2389978AbgJPFnV (ORCPT ); Fri, 16 Oct 2020 01:43:21 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UP0GUlenMN31SpNa6dUWtGPxPeABCcmirbhfa8sfkHP+4b+dTBDePu69cCn45ehsRiJ6p213MTJwGFdqXq4hgNbvRgUPH24LFBTMft8M7xxcA0iLkjuAaMOtoFlzO18GsCZcU8RLNE8SJNExUL5ggtll8IbqQvzt0e0qBZskiOysgeS2IuaI7N6/hjKU6dy34KeFF3YSVhgP+BnxIumGm1A+WIHb8mu5oos4Qw2+AT8bZlhfRRLhGjUZV4+KENAK/mKTjRMDUbgzNv0xSpe29MdNAw8eMOlcJbbxEzxklDYpTSO4BNuWR/18hq/OGTYjFRVK89zIwYHBuodPPoMP7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dAsOfwr/51jOQ/yJM9ZhHR0Mks3JEnQV+TIO8/4hZ3E=; b=V3D8Pz0sijwL8R52qdW/w3kYwrqjy2GpcG9DeGW1LAB9iIkOX7Qsbh0z+p80vQTXJFgS5t9iFjO0EdmnlQiCJJDgqbj5XTnsOHxzqC0T4ZNBTwgtAmWdWAEFkFFk76PKY465l/ZhQS77dY1MwutaeKCr0100+LJ38KBiTATT6yqSWFl/nVin5+kMYQNmb5ZR30ddbQjMvHMFTvzpEW39lqZHCSFwJ2Zr+cVnMvqQl3u4TJmm/kDVFeGCnOXtEgkqVwZCC2EZJLVtAH2NUImcYj6etzZmaiLUTNkDsG1ovNl+9ztHVcZ3ET352G1noX0fJLp2eti/7XDvPuBhUTv35g== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dAsOfwr/51jOQ/yJM9ZhHR0Mks3JEnQV+TIO8/4hZ3E=; b=KtQJXOjGHXSMVwobVg//VzkjdPg2mrC5d/K4FHtC/Iep15d0HV3ykVgg9zjcBDZm1FB7DU/vW0gU8ByZHj5YYpzBhAvRkpPwVYeYPjxossFwN+wl6CvrSL1aSQamBBv1Wq3yVTXZ8538bLtJecXdrz9cfNhC6f9qJXiGPfmcmoo= Authentication-Results: pengutronix.de; dkim=none (message not signed) header.d=none; pengutronix.de; dmarc=none action=none header.from=nxp.com; Received: from DB8PR04MB6795.eurprd04.prod.outlook.com (2603:10a6:10:fa::15) by DBAPR04MB7333.eurprd04.prod.outlook.com (2603:10a6:10:1b2::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.21; Fri, 16 Oct 2020 05:43:14 +0000 Received: from DB8PR04MB6795.eurprd04.prod.outlook.com ([fe80::3c3a:58b9:a1cc:cbcc]) by DB8PR04MB6795.eurprd04.prod.outlook.com ([fe80::3c3a:58b9:a1cc:cbcc%9]) with mapi id 15.20.3477.021; Fri, 16 Oct 2020 05:43:14 +0000 From: Joakim Zhang To: mkl@pengutronix.de, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, linux-imx@nxp.com, victor.liu@nxp.com, peng.fan@nxp.com, linux-can@vger.kernel.org, pankaj.bansal@nxp.com, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/6] can: flexcan: rename macro FLEXCAN_QUIRK_SETUP_STOP_MODE -> FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR Date: Fri, 16 Oct 2020 21:43:18 +0800 Message-Id: <20201016134320.20321-5-qiangqing.zhang@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201016134320.20321-1-qiangqing.zhang@nxp.com> References: <20201016134320.20321-1-qiangqing.zhang@nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR02CA0068.apcprd02.prod.outlook.com (2603:1096:4:54::32) To DB8PR04MB6795.eurprd04.prod.outlook.com (2603:10a6:10:fa::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.71) by SG2PR02CA0068.apcprd02.prod.outlook.com (2603:1096:4:54::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.21 via Frontend Transport; Fri, 16 Oct 2020 05:43:09 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: eafbac88-e13b-4994-0bc7-08d871965fe4 X-MS-TrafficTypeDiagnostic: DBAPR04MB7333: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:372; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0TsC5FzAV24sospcTDttuimer/ptXC+sEvJaAu8VzVRfjuhl8ATuzAC2ounj6AIbqoLpjTuQCCVhR6RnY2xyvjmiDVqP4OvGTsDLl8NHuiH2wh5IUJeJfAwl1mIE5X1wvJ+L06UM7eeZcPJPQghoxBN08xpFWKUQWu2tpX8Wvv57O55BW8xW3himRZ1S/LQW9NJwwNcJldfFMSSBtz1JL0zuJYO7tU3qzgX4jKQdYpSps6Rf0B2ub6VCFFqBOdm45OHEIeOrnUgvvenUTX7oDWnD+xQB6BSKwJ1Jh2K30HxOaiKsdNzKLm5v/qlyfznNO9MBY3JK8mHdp/xaU6McJVCLkAiaPfSTKBzEKXDRreYQWgmuR+aA1NOr3BazGua1N3Jf41SE+CdiK58hCe9KMbQGh1mWK2xhDB5EXZNLCCI= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB8PR04MB6795.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(346002)(376002)(39860400002)(366004)(136003)(34490700002)(2906002)(316002)(6512007)(8936002)(86362001)(5660300002)(1076003)(69590400008)(478600001)(52116002)(6506007)(6486002)(66556008)(83380400001)(36756003)(4326008)(6666004)(26005)(186003)(2616005)(956004)(16526019)(8676002)(66946007)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: vWQkW+4AXkDds1yoUqlWb8lFPF7iVZucqBti59ZgQ792k5fOAl/6zWdUD4jnA5SoKPbAPWk0Rt0jLMJGBPzacawo4O5/kCV0Fxjzf2k0VqkeFGMhsmzls9Dl/L4IKr6h7/OxLugmoTM5kgkjuVhboa1mJuvswHX/4DurL95DmSYfKalq6y9tPXbuj/E23voH5BSOyPRmw8d8zQgpgcpiB3kU2svLe1RYywlEZXI9MaqJaRdJGhJcGCVvWSLew5EvujXDvAei+QMGaIETsMwxF6jvp7gqUaTV3mzIJpgmsFocpxA+K6fTe9nMW4dnYpOEtG6GifsCeKqA9+rnu9BurhvH5NgMcU6Ytx+DPS49kFg396ciaqBaeRK9smT4FcOcDop3vuyfmHkgxU18lqNOefOjBMye6TMoNvfkhQcxZDwPXIEt7kvv/FrLaX1WwhKqeKRCsUjLaA1dEfwBf5W2cozScAP2VZdqRninNGTCx8YPzbqq4G1RwrvHIq8/LXPvVxD0Q4ImCIyoklhyyYW/ZpZveZ56Kw594DV7WnIsK7N5VSxaYUdfKyEJZp9CwM5dKYIjDK9yl+uDZr3iY8oC6OPxFwlD9YQT55r+pZakdPcJl2NjZ0LGAGu/Rl8eOrig7r10gtt2fVWb7FlVRZO2Nw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: eafbac88-e13b-4994-0bc7-08d871965fe4 X-MS-Exchange-CrossTenant-AuthSource: DB8PR04MB6795.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2020 05:43:14.3297 (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: ilV5T0MAMbxWU7xnEmLg23Uz38RwON72vjk+vHs4bTEwg9PXERRsQWGKXLeo0uUydOlG66aFIGOquYtWpvN+vA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7333 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch intends to rename FLEXCAN_QUIRK_SETUP_STOP_MODE quirk to FLEXCAN_QUIRK_SETUP_STOP_MODE_GRP for non-scu SoCs, coming patch will add quirk for scu SoCs. For non-scu SoCs, setup stop mode with GPR register. For scu SoCs, setup stop mode with SCU firmware. Signed-off-by: Joakim Zhang --- drivers/net/can/flexcan.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c index 4d594e977497..e708e7bf28db 100644 --- a/drivers/net/can/flexcan.c +++ b/drivers/net/can/flexcan.c @@ -236,8 +236,8 @@ #define FLEXCAN_QUIRK_BROKEN_PERR_STATE BIT(6) /* default to BE register access */ #define FLEXCAN_QUIRK_DEFAULT_BIG_ENDIAN BIT(7) -/* Setup stop mode to support wakeup */ -#define FLEXCAN_QUIRK_SETUP_STOP_MODE BIT(8) +/* Setup stop mode with GPR to support wakeup */ +#define FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR BIT(8) /* Support CAN-FD mode */ #define FLEXCAN_QUIRK_SUPPORT_FD BIT(9) /* support memory detection and correction */ @@ -381,7 +381,7 @@ static const struct flexcan_devtype_data fsl_imx28_devtype_data = { static const struct flexcan_devtype_data fsl_imx6q_devtype_data = { .quirks = FLEXCAN_QUIRK_DISABLE_RXFG | FLEXCAN_QUIRK_ENABLE_EACEN_RRS | FLEXCAN_QUIRK_USE_OFF_TIMESTAMP | FLEXCAN_QUIRK_BROKEN_PERR_STATE | - FLEXCAN_QUIRK_SETUP_STOP_MODE, + FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR, }; static const struct flexcan_devtype_data fsl_imx8qm_devtype_data = { @@ -393,7 +393,7 @@ static const struct flexcan_devtype_data fsl_imx8qm_devtype_data = { static struct flexcan_devtype_data fsl_imx8mp_devtype_data = { .quirks = FLEXCAN_QUIRK_DISABLE_RXFG | FLEXCAN_QUIRK_ENABLE_EACEN_RRS | FLEXCAN_QUIRK_DISABLE_MECR | FLEXCAN_QUIRK_USE_OFF_TIMESTAMP | - FLEXCAN_QUIRK_BROKEN_PERR_STATE | FLEXCAN_QUIRK_SETUP_STOP_MODE | + FLEXCAN_QUIRK_BROKEN_PERR_STATE | FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR | FLEXCAN_QUIRK_SUPPORT_FD | FLEXCAN_QUIRK_SUPPORT_ECC, }; @@ -2043,7 +2043,7 @@ static int flexcan_probe(struct platform_device *pdev) of_can_transceiver(dev); devm_can_led_init(dev); - if (priv->devtype_data->quirks & FLEXCAN_QUIRK_SETUP_STOP_MODE) { + if (priv->devtype_data->quirks & FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR) { err = flexcan_setup_stop_mode(pdev); if (err) dev_dbg(&pdev->dev, "failed to setup stop-mode\n"); From patchwork Fri Oct 16 13:43:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Zhang X-Patchwork-Id: 298900 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.9 required=3.0 tests=BAYES_00, DATE_IN_FUTURE_06_12,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BAC30C43457 for ; Fri, 16 Oct 2020 05:43:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6D15720829 for ; Fri, 16 Oct 2020 05:43:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="D0cCHtd5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390534AbgJPFnv (ORCPT ); Fri, 16 Oct 2020 01:43:51 -0400 Received: from mail-am6eur05on2083.outbound.protection.outlook.com ([40.107.22.83]:33504 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2390203AbgJPFnk (ORCPT ); Fri, 16 Oct 2020 01:43:40 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OhgefIQKcVf+CJtigLgwDWa7HZkD5KWJJyLRTmE28Qwqb91hfVoNAvJcsnQTseXS0jJFgarYjEzDdmxdksiPl84Nq/PHBraDgqlYNsy4r+jY49sAg0mjJxz0513PyZB2BMR4KTI2wSQvZZUMDWUq1MxV2fmVEHK1NRvnQQJ/rSo6D4Sl/Ad0XPjBvwWPh8gYeIQ41zxTdrN0K57vL/XVmlPP82hrtTrxZzYPZk+XzCGE1oUQGbm7BHKsft3bsteweXwjf/cNo7R1/+h8T6sTKgi10L+F6WsQjDisVtAbZxpApKip1dE50uH/76KmIAyuHLQMCRw9eFQlmITJQllKaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gnHxx0jYmLyUOthalg5zK+SHUgy+o5xi82UreyPOqFs=; b=f5rv6I4aRVaUcWwTdExynlx/pem8QS7J3zhlhb0Kp8ctPKLOR6g63hY0GAwTVunoz4BJqnd2RSyM1B7kGWn4lnKyTCGXw1qxfNniAwi0vKv8CS6ocfKywABoe5jhSyz8Ksgp5n7uYY3ETML21bBFSxOxeAfBGE20luoEOV0nVcsZgZSpt1wq/rH+rD1CCqD3yECxq3e2JOrKfkQbNiNYI2s90GLCpULSPEmlqRR3f1gdVMwcKxk7lzMwC4DpHE3QNN1IoE+608M11lkq1gsRO+/P72wQvARfXpiDUgzdT0hBQbPAE77k7+j8rVKmtLlOqgA2BENjlj2nX3ndWcvGGw== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gnHxx0jYmLyUOthalg5zK+SHUgy+o5xi82UreyPOqFs=; b=D0cCHtd5p9xm1GdnbaUn5Bu92sbaWW2ZilSv05D12kIlhf++OoBx0yFlZRIcIfaB2lMHUiL4WM2J3RVDczM8wjv7MPwHdo9jpNr2rogPK+jilM9OqyYfEjYQo5/vt/mGwmNxm/kp3VXzRna7UnVaveurVleBIacGfnwb9bbd3mc= Authentication-Results: pengutronix.de; dkim=none (message not signed) header.d=none; pengutronix.de; dmarc=none action=none header.from=nxp.com; Received: from DB8PR04MB6795.eurprd04.prod.outlook.com (2603:10a6:10:fa::15) by DBAPR04MB7333.eurprd04.prod.outlook.com (2603:10a6:10:1b2::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.21; Fri, 16 Oct 2020 05:43:20 +0000 Received: from DB8PR04MB6795.eurprd04.prod.outlook.com ([fe80::3c3a:58b9:a1cc:cbcc]) by DB8PR04MB6795.eurprd04.prod.outlook.com ([fe80::3c3a:58b9:a1cc:cbcc%9]) with mapi id 15.20.3477.021; Fri, 16 Oct 2020 05:43:19 +0000 From: Joakim Zhang To: mkl@pengutronix.de, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, linux-imx@nxp.com, victor.liu@nxp.com, peng.fan@nxp.com, linux-can@vger.kernel.org, pankaj.bansal@nxp.com, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/6] can: flexcan: add CAN wakeup function for i.MX8QM Date: Fri, 16 Oct 2020 21:43:19 +0800 Message-Id: <20201016134320.20321-6-qiangqing.zhang@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201016134320.20321-1-qiangqing.zhang@nxp.com> References: <20201016134320.20321-1-qiangqing.zhang@nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR02CA0068.apcprd02.prod.outlook.com (2603:1096:4:54::32) To DB8PR04MB6795.eurprd04.prod.outlook.com (2603:10a6:10:fa::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.71) by SG2PR02CA0068.apcprd02.prod.outlook.com (2603:1096:4:54::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.21 via Frontend Transport; Fri, 16 Oct 2020 05:43:14 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: dd5c06f9-319e-4495-746c-08d871966327 X-MS-TrafficTypeDiagnostic: DBAPR04MB7333: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2657; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JBYqR3wcLNZLtvFIjhTfnNRjfNlM3PBJeXNqU6N88u0ByimLQ6NQA3G6OO2F5MXIeecZhWFWRXDbLKlJUpOAVZ4EDOjvIz/oeXh0ulUfQa+RpXfrXSbAj5wxhaaO6aQdLq4jpRB4Nd1xqKMeWVZu2cEHvZkLBQb11yE7p/DW7FX4CPuCfzXC+sR9w8kyy6nunk4+RfxaEc/r9e2goGPXpB4niwQuavheUG33zQ1/s2llLZCq1M++boUatGaag8A6NM1hXLwi3bRJWWM2N7TJhlF9XVIP51oanogwXtRe2IQk+OmmWwJ/OvfBFgMbCveOLgSso9OACloMT9XOUWMXCkAv/AN+GCCg/Wk0LYMCKTqAbHvvzwgRvZU27hzdMCtdbUpPoXPjW3piO3hSUspG0fHXB4tRoLuYAs1IhqKczQg= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB8PR04MB6795.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(346002)(376002)(39860400002)(366004)(136003)(34490700002)(2906002)(316002)(6512007)(8936002)(86362001)(5660300002)(1076003)(69590400008)(478600001)(52116002)(6506007)(6486002)(66556008)(83380400001)(36756003)(4326008)(26005)(186003)(2616005)(956004)(16526019)(8676002)(66946007)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: V7f/+5j5uBLQ9WccAzOGiCmeFkX7ifPJ3oZRuRDmy1I26+waLi/QIiGcAyYBEyk6m3kgBgS7XsjmO0plhGU5OPdNxMhwB4ExCvM4BJ/BQPWgUXB5lY6tjpcJyXLAEfxBMBGKRemYQHW109ovROuKuvriyc2YJkI9wSINSY71W8NUO2NJXEm/mMIHZUKjy2W9MUZxBBpJztOTQ38Aw8gp6T+518eMssoGPkf22ZIgkS+1aFaYklCiK+O+zvG/v19gxadMcr/baoMpaDtPaYXdrW9YfWLpERT3bgMAdLzTIiItnXitnaXxKf7GPKU95Zc49J6oGZWJV3uXm0ww5/X/YCx4hWWkQzmQci+OANxj4IhxudO4TtpNsX8F8ZyY0rCMNtVMjVTZAyr6oIGtg9fo5XTbzjtjZER6cdDfx0aem43ZNLvD9S3wV52mYGAtt6FP4M6lPTCkSpTCGEUuSkbSjr6M9GaPORi7BZe8kXjbTEKuf/ewUBWKdP6HJgqIfcxvqY5mKH6HhtEnVZJEvYUN3ZTRtlix51nf/ITRz+EH1iz3HOAFHx4v7u+t2z8rSM0ooqdV2/HpRAiGek03pXVsvYlSdDqYqdnuDMRIXdsSm5+owpw5jXV7l2q/rDWTkkgO58FlxO+FJeZTlsYwUVVIEQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: dd5c06f9-319e-4495-746c-08d871966327 X-MS-Exchange-CrossTenant-AuthSource: DB8PR04MB6795.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2020 05:43:19.8594 (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: Ewryjsx3hx+d8jbOivWfveTfXO6kRmV2XZZ8WAq5UfW4vMg3oAhLXBu3oPFIoYMycXtQWs9lEoW9/IjvBMbaaw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7333 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The System Controller Firmware (SCFW) is a low-level system function which runs on a dedicated Cortex-M core to provide power, clock, and resource management. It exists on some i.MX8 processors. e.g. i.MX8QM (QM, QP), and i.MX8QX (QXP, DX). SCU driver manages the IPC interface between host CPU and the SCU firmware running on M4. For i.MX8QM, stop mode request is controlled by System Controller Unit(SCU) firmware, this patch introduces FLEXCAN_QUIRK_SETUP_STOP_MODE_SCFW quirk for this function. Signed-off-by: Joakim Zhang --- drivers/net/can/flexcan.c | 125 ++++++++++++++++++++++++++++++++------ 1 file changed, 107 insertions(+), 18 deletions(-) diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c index e708e7bf28db..a55ea8f27f7c 100644 --- a/drivers/net/can/flexcan.c +++ b/drivers/net/can/flexcan.c @@ -9,6 +9,7 @@ // // Based on code originally by Andrey Volkov +#include #include #include #include @@ -17,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -242,6 +244,8 @@ #define FLEXCAN_QUIRK_SUPPORT_FD BIT(9) /* support memory detection and correction */ #define FLEXCAN_QUIRK_SUPPORT_ECC BIT(10) +/* Setup stop mode with SCU firmware to support wakeup */ +#define FLEXCAN_QUIRK_SETUP_STOP_MODE_SCFW BIT(11) /* Structure of the message buffer */ struct flexcan_mb { @@ -347,6 +351,7 @@ struct flexcan_priv { u8 mb_count; u8 mb_size; u8 clk_src; /* clock source of CAN Protocol Engine */ + u8 can_idx; u64 rx_mask; u64 tx_mask; @@ -358,6 +363,9 @@ struct flexcan_priv { struct regulator *reg_xceiver; struct flexcan_stop_mode stm; + /* IPC handle when setup stop mode by System Controller firmware(scfw) */ + struct imx_sc_ipc *sc_ipc_handle; + /* Read and Write APIs */ u32 (*read)(void __iomem *addr); void (*write)(u32 val, void __iomem *addr); @@ -387,7 +395,7 @@ static const struct flexcan_devtype_data fsl_imx6q_devtype_data = { static const struct flexcan_devtype_data fsl_imx8qm_devtype_data = { .quirks = FLEXCAN_QUIRK_DISABLE_RXFG | FLEXCAN_QUIRK_ENABLE_EACEN_RRS | FLEXCAN_QUIRK_USE_OFF_TIMESTAMP | FLEXCAN_QUIRK_BROKEN_PERR_STATE | - FLEXCAN_QUIRK_SUPPORT_FD, + FLEXCAN_QUIRK_SUPPORT_FD | FLEXCAN_QUIRK_SETUP_STOP_MODE_SCFW, }; static struct flexcan_devtype_data fsl_imx8mp_devtype_data = { @@ -546,18 +554,46 @@ static void flexcan_enable_wakeup_irq(struct flexcan_priv *priv, bool enable) priv->write(reg_mcr, ®s->mcr); } +static int flexcan_stop_mode_enable_scfw(struct flexcan_priv *priv, bool enabled) +{ + u8 idx = priv->can_idx; + u32 rsrc_id, val; + + if (idx == 0) + rsrc_id = IMX_SC_R_CAN_0; + else if (idx == 1) + rsrc_id = IMX_SC_R_CAN_1; + else + rsrc_id = IMX_SC_R_CAN_2; + + if (enabled) + val = 1; + else + val = 0; + + /* stop mode request via scu firmware */ + return imx_sc_misc_set_control(priv->sc_ipc_handle, rsrc_id, IMX_SC_C_IPG_STOP, val); +} + static inline int flexcan_enter_stop_mode(struct flexcan_priv *priv) { struct flexcan_regs __iomem *regs = priv->regs; u32 reg_mcr; + int ret; reg_mcr = priv->read(®s->mcr); reg_mcr |= FLEXCAN_MCR_SLF_WAK; priv->write(reg_mcr, ®s->mcr); /* enable stop request */ - regmap_update_bits(priv->stm.gpr, priv->stm.req_gpr, - 1 << priv->stm.req_bit, 1 << priv->stm.req_bit); + if (priv->devtype_data->quirks & FLEXCAN_QUIRK_SETUP_STOP_MODE_SCFW) { + ret = flexcan_stop_mode_enable_scfw(priv, true); + if (ret < 0) + return ret; + } else { + regmap_update_bits(priv->stm.gpr, priv->stm.req_gpr, + 1 << priv->stm.req_bit, 1 << priv->stm.req_bit); + } return flexcan_low_power_enter_ack(priv); } @@ -566,10 +602,17 @@ static inline int flexcan_exit_stop_mode(struct flexcan_priv *priv) { struct flexcan_regs __iomem *regs = priv->regs; u32 reg_mcr; + int ret; /* remove stop request */ - regmap_update_bits(priv->stm.gpr, priv->stm.req_gpr, - 1 << priv->stm.req_bit, 0); + if (priv->devtype_data->quirks & FLEXCAN_QUIRK_SETUP_STOP_MODE_SCFW) { + ret = flexcan_stop_mode_enable_scfw(priv, false); + if (ret < 0) + return ret; + } else { + regmap_update_bits(priv->stm.gpr, priv->stm.req_gpr, + 1 << priv->stm.req_bit, 0); + } reg_mcr = priv->read(®s->mcr); reg_mcr &= ~FLEXCAN_MCR_SLF_WAK; @@ -1838,7 +1881,7 @@ static void unregister_flexcandev(struct net_device *dev) unregister_candev(dev); } -static int flexcan_setup_stop_mode(struct platform_device *pdev) +static int flexcan_setup_stop_mode_gpr(struct platform_device *pdev) { struct net_device *dev = platform_get_drvdata(pdev); struct device_node *np = pdev->dev.of_node; @@ -1883,11 +1926,6 @@ static int flexcan_setup_stop_mode(struct platform_device *pdev) "gpr %s req_gpr=0x02%x req_bit=%u\n", gpr_np->full_name, priv->stm.req_gpr, priv->stm.req_bit); - device_set_wakeup_capable(&pdev->dev, true); - - if (of_property_read_bool(np, "wakeup-source")) - device_set_wakeup_enable(&pdev->dev, true); - return 0; out_put_node: @@ -1895,6 +1933,56 @@ static int flexcan_setup_stop_mode(struct platform_device *pdev) return ret; } +static int flexcan_setup_stop_mode_scfw(struct platform_device *pdev) +{ + struct net_device *dev = platform_get_drvdata(pdev); + struct flexcan_priv *priv; + int ret; + + priv = netdev_priv(dev); + + /* this function could be defer probe, return -EPROBE_DEFER */ + ret = imx_scu_get_handle(&priv->sc_ipc_handle); + if (ret < 0) + dev_dbg(&pdev->dev, "get ipc handle used by SCU failed\n"); + + return ret; +} + +/* flexcan_setup_stop_mode - Setup stop mode + * + * Return: 0 setup stop mode successfully or doesn't support this feature + * -EPROBE_DEFER defer probe + * < 0 fail to setup stop mode + */ +static int flexcan_setup_stop_mode(struct platform_device *pdev) +{ + struct net_device *dev = platform_get_drvdata(pdev); + struct flexcan_priv *priv; + int ret; + + priv = netdev_priv(dev); + + if (priv->devtype_data->quirks & FLEXCAN_QUIRK_SETUP_STOP_MODE_SCFW) + ret = flexcan_setup_stop_mode_scfw(pdev); + else if (priv->devtype_data->quirks & FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR) + ret = flexcan_setup_stop_mode_gpr(pdev); + else + /* return 0 directly if stop mode is unsupport */ + return 0; + + if (ret) { + dev_warn(&pdev->dev, "failed to setup stop mode\n"); + } else { + device_set_wakeup_capable(&pdev->dev, true); + + if (of_property_read_bool(pdev->dev.of_node, "wakeup-source")) + device_set_wakeup_enable(&pdev->dev, true); + } + + return ret; +} + static const struct of_device_id flexcan_of_match[] = { { .compatible = "fsl,imx8qm-flexcan", .data = &fsl_imx8qm_devtype_data, }, { .compatible = "fsl,imx8mp-flexcan", .data = &fsl_imx8mp_devtype_data, }, @@ -1927,7 +2015,7 @@ static int flexcan_probe(struct platform_device *pdev) struct clk *clk_ipg = NULL, *clk_per = NULL; struct flexcan_regs __iomem *regs; int err, irq; - u8 clk_src = 1; + u8 clk_src = 1, can_idx = 0; u32 clock_freq = 0; reg_xceiver = devm_regulator_get_optional(&pdev->dev, "xceiver"); @@ -1943,6 +2031,8 @@ static int flexcan_probe(struct platform_device *pdev) "clock-frequency", &clock_freq); of_property_read_u8(pdev->dev.of_node, "fsl,clk-source", &clk_src); + of_property_read_u8(pdev->dev.of_node, + "fsl,can-index", &can_idx); } if (!clock_freq) { @@ -2019,6 +2109,7 @@ static int flexcan_probe(struct platform_device *pdev) priv->clk_src = clk_src; priv->devtype_data = devtype_data; priv->reg_xceiver = reg_xceiver; + priv->can_idx = can_idx; if (priv->devtype_data->quirks & FLEXCAN_QUIRK_SUPPORT_FD) { priv->can.ctrlmode_supported |= CAN_CTRLMODE_FD | @@ -2030,6 +2121,10 @@ static int flexcan_probe(struct platform_device *pdev) priv->can.bittiming_const = &flexcan_bittiming_const; } + err = flexcan_setup_stop_mode(pdev); + if (err == -EPROBE_DEFER) + return -EPROBE_DEFER; + pm_runtime_get_noresume(&pdev->dev); pm_runtime_set_active(&pdev->dev); pm_runtime_enable(&pdev->dev); @@ -2043,12 +2138,6 @@ static int flexcan_probe(struct platform_device *pdev) of_can_transceiver(dev); devm_can_led_init(dev); - if (priv->devtype_data->quirks & FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR) { - err = flexcan_setup_stop_mode(pdev); - if (err) - dev_dbg(&pdev->dev, "failed to setup stop-mode\n"); - } - return 0; failed_register: From patchwork Fri Oct 16 13:43:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Zhang X-Patchwork-Id: 288411 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.9 required=3.0 tests=BAYES_00, DATE_IN_FUTURE_06_12,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 231C7C433DF for ; Fri, 16 Oct 2020 05:44:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BE1C62080A for ; Fri, 16 Oct 2020 05:44:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="NRUvSiiE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390649AbgJPFoE (ORCPT ); Fri, 16 Oct 2020 01:44:04 -0400 Received: from mail-am6eur05on2083.outbound.protection.outlook.com ([40.107.22.83]:33504 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2390478AbgJPFny (ORCPT ); Fri, 16 Oct 2020 01:43:54 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FmMqseSiJH/tqg2Qc+UEWfuqnC9M6B+hFpmzT4/QPzCD8979BKpZDKPFDItMXpB9C6MwRrW5bcDuzoglmoiV5rFZ2u7wCooqziH84lx2eMbt3CdY/Lsfnt3ESrssLQSrNeMba+UGo5jZQ+ZU9cfq2vYV/gvQHt5A/5r5vBh7U0Xsr8eBr4XOeKzGDamlmZpNrLQIxjhLPjeLwmtKrNAj+TWT6/S52WwLjvpNrLe+xo9mYt214/1BLYS26YXoQU9aZN4EkIuP9DTRzFrJ0ASy9vtZs/ySt4CWOeMV83m1jN7R1aN2qEFJzkCTU91D46xmXGUph+/9wjpDrlXRUANYsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3Y/QS4M9MnQx3oyWz449uvx1QyEdxbAVuXtCNrp6lI4=; b=Fj7EZrvCONKjBnt0wzEKcGXrR9Yyvnfs5V31y+iN2XJHV5h8n58w620VAf5qVWGtROT8gm+dF4z/f9aJ7H2OuqUj7p67Q2skxOI4/VzaqeEVQS+f6/veaOMzkvRcpqcpKSbmPFgirrx2SXNFEQLDuCrQsjc5EK6A7DalKQnmUPP5cCwFEyAitHsfXecAafVfEmR3s+1JBtmsgjAU33ldayV0+O5TnvtAT/XPpkbHJZ8aI/Nw8t1Qfh8Uwg7FZZQh6znQ/PlwbqNo/sZbyU2SDfkLl4xsRdd4AmtLIajvliAfuq2XJYtkRwnCr81KrJ44iK8M9g/suR9gFCbbhCoErA== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3Y/QS4M9MnQx3oyWz449uvx1QyEdxbAVuXtCNrp6lI4=; b=NRUvSiiEhEi9QI7eJ3O63y3w83CGUOaknJiBrIS8vZQmrn6nmExBewF3yeqQ7fQ4KK6bAu7iWyuvfBcZY6nDepMsImUaGrXMQDThxW7zy/HgJxfijsIMHxoqXla4osNWd6505B4BQ7+vsbuIU/b42FRy3l+CU0cZvEP6+nghb70= Authentication-Results: pengutronix.de; dkim=none (message not signed) header.d=none; pengutronix.de; dmarc=none action=none header.from=nxp.com; Received: from DB8PR04MB6795.eurprd04.prod.outlook.com (2603:10a6:10:fa::15) by DBAPR04MB7333.eurprd04.prod.outlook.com (2603:10a6:10:1b2::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.21; Fri, 16 Oct 2020 05:43:25 +0000 Received: from DB8PR04MB6795.eurprd04.prod.outlook.com ([fe80::3c3a:58b9:a1cc:cbcc]) by DB8PR04MB6795.eurprd04.prod.outlook.com ([fe80::3c3a:58b9:a1cc:cbcc%9]) with mapi id 15.20.3477.021; Fri, 16 Oct 2020 05:43:24 +0000 From: Joakim Zhang To: mkl@pengutronix.de, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, linux-imx@nxp.com, victor.liu@nxp.com, peng.fan@nxp.com, linux-can@vger.kernel.org, pankaj.bansal@nxp.com, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/6] can: flexcan: fix ECC function on LS1021A/LX2160A Date: Fri, 16 Oct 2020 21:43:20 +0800 Message-Id: <20201016134320.20321-7-qiangqing.zhang@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201016134320.20321-1-qiangqing.zhang@nxp.com> References: <20201016134320.20321-1-qiangqing.zhang@nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR02CA0068.apcprd02.prod.outlook.com (2603:1096:4:54::32) To DB8PR04MB6795.eurprd04.prod.outlook.com (2603:10a6:10:fa::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.71) by SG2PR02CA0068.apcprd02.prod.outlook.com (2603:1096:4:54::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.21 via Frontend Transport; Fri, 16 Oct 2020 05:43:20 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: e08a2a8e-e6b4-4bfe-67dd-08d8719665a8 X-MS-TrafficTypeDiagnostic: DBAPR04MB7333: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1824; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HEZcqxbOQSkrTr+1V7E8wPJs4cQOYoG5ei5W/sdwGLvjm9aYENNGO+hu0fWyLc+KJBiM/wyPuDvFyex6hL8iDNocOPECjWHahqEs7kt+m0nggAGdfjLOaL+5o/+vFQkkpF7zcpge0s6hnBdaGmumR7MeRDL+XAr1IOF5Qbikr0H5u4bKHEq4ZJZUwxKwRnEKUqe1cKn5kkhDN1aUrYVSo1511uJZlPc/NlhFaLG8zq0nkPIL1vkzjiEhaJ4qNjNt6hqEC24wckth7Fx2OPoYG49RdGZwC2eo0IZ9/TCsh4nlrybQH6T/TsTcwOCIu/Gk3NnZOKcaAjhIbBcwGCZY272TL1k/in00AJhhamh/Tu4pPV/IAwx0aMGt+Ju0rOUPcDEUXzieEIWgr1h7tC8mG6zckVa8Mn1SbRJrcagR7hg= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB8PR04MB6795.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(346002)(376002)(39860400002)(366004)(136003)(34490700002)(2906002)(316002)(6512007)(8936002)(86362001)(5660300002)(1076003)(69590400008)(478600001)(52116002)(6506007)(6486002)(66556008)(83380400001)(36756003)(4326008)(26005)(186003)(2616005)(956004)(16526019)(8676002)(66946007)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: EguAOlHjoxgedeTEUPygzYalZvoDlANpeTbLMZ9pxOBHGnv3lRnRblyJSBFz0MG9YbG69qM1pzJJA+1iCa2ll1Gcq5P+VNomEoDWL4gX9f/WWKUO2ESCoKVYD0veruFyJW9ipaNByEE9erIAoK4r6CaHU+bCXHhSVLwrRrN6HFmM7Sge2jbTcVNvxeoh70LJt6uavop+oBi00eaDQEEFBV9bFIxxnR9whZ7hV3lI1EK5WolsiOw664UKkw7bLfwcLIUNvL8dKs2ejziLbDQFcpQRgSQ6LJPj6C9cQyjWtJwz2rY86v6xeDpadFxx3ewIRKVHELv/dgHMRqEosZ3/sWroGNboCAVf2xIwez2K82poTvUV+dfBoVggyUVRM3Rs8gXf80xUkLvF+PAwseMXs3p9f6Enq0fLSPxduLXP3oW5oBDZrCzkCaHnRw2VCVzshzAtlFULNg9RE9LYPD+sV5GSikegiM1+Mat/IfXQQAPmm+xth4NFSyANy0J3IE/8ND/ODvgg++dFinqoIpvgefWMjK6ljxjyBQM8WjuYliQWNDS8oCHxM0+fC4ZxKH4MDEpPVkKDOoUo6zFUbLbcMPSqSRETkxUrYR21+haBSA1Fj8wOL0ZUA10ZZk+TfJoaAeiSYpPjeSEQA0fu00CUVA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e08a2a8e-e6b4-4bfe-67dd-08d8719665a8 X-MS-Exchange-CrossTenant-AuthSource: DB8PR04MB6795.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2020 05:43:24.0012 (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: fpxDGS+D20yn9xz9S3C/koyVrz22IXObl+7gZJN5WKPfZXtaq4iziGq0D9/VE8f3J1fGORv8tomoxGzfd6PGqA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7333 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org After double check with Layerscape CAN owner (Pankaj Bansal), confirm that LS1021A doesn't support ECC, and LX2160A indeed supports ECC. For SoCs with ECC supported, even use FLEXCAN_QUIRK_DISABLE_MECR quirk to disable non-correctable errors interrupt and freeze mode, had better use FLEXCAN_QUIRK_SUPPORT_ECC quirk to initialize all memory. Signed-off-by: Joakim Zhang --- drivers/net/can/flexcan.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c index a55ea8f27f7c..7b0eb608fc9d 100644 --- a/drivers/net/can/flexcan.c +++ b/drivers/net/can/flexcan.c @@ -219,7 +219,7 @@ * MX8MP FlexCAN3 03.00.17.01 yes yes no yes yes yes * VF610 FlexCAN3 ? no yes no yes yes? no * LS1021A FlexCAN2 03.00.04.00 no yes no no yes no - * LX2160A FlexCAN3 03.00.23.00 no yes no no yes yes + * LX2160A FlexCAN3 03.00.23.00 no yes no yes yes yes * * Some SOCs do not have the RX_WARN & TX_WARN interrupt line connected. */ @@ -408,19 +408,19 @@ static struct flexcan_devtype_data fsl_imx8mp_devtype_data = { static const struct flexcan_devtype_data fsl_vf610_devtype_data = { .quirks = FLEXCAN_QUIRK_DISABLE_RXFG | FLEXCAN_QUIRK_ENABLE_EACEN_RRS | FLEXCAN_QUIRK_DISABLE_MECR | FLEXCAN_QUIRK_USE_OFF_TIMESTAMP | - FLEXCAN_QUIRK_BROKEN_PERR_STATE, + FLEXCAN_QUIRK_BROKEN_PERR_STATE | FLEXCAN_QUIRK_SUPPORT_ECC, }; static const struct flexcan_devtype_data fsl_ls1021a_r2_devtype_data = { .quirks = FLEXCAN_QUIRK_DISABLE_RXFG | FLEXCAN_QUIRK_ENABLE_EACEN_RRS | - FLEXCAN_QUIRK_DISABLE_MECR | FLEXCAN_QUIRK_BROKEN_PERR_STATE | - FLEXCAN_QUIRK_USE_OFF_TIMESTAMP, + FLEXCAN_QUIRK_BROKEN_PERR_STATE | FLEXCAN_QUIRK_USE_OFF_TIMESTAMP, }; static const struct flexcan_devtype_data fsl_lx2160a_r1_devtype_data = { .quirks = FLEXCAN_QUIRK_DISABLE_RXFG | FLEXCAN_QUIRK_ENABLE_EACEN_RRS | FLEXCAN_QUIRK_DISABLE_MECR | FLEXCAN_QUIRK_BROKEN_PERR_STATE | - FLEXCAN_QUIRK_USE_OFF_TIMESTAMP | FLEXCAN_QUIRK_SUPPORT_FD, + FLEXCAN_QUIRK_USE_OFF_TIMESTAMP | FLEXCAN_QUIRK_SUPPORT_FD | + FLEXCAN_QUIRK_SUPPORT_ECC, }; static const struct can_bittiming_const flexcan_bittiming_const = {