Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967115AbdCXTap (ORCPT ); Fri, 24 Mar 2017 15:30:45 -0400 Received: from mail-cys01nam02on0055.outbound.protection.outlook.com ([104.47.37.55]:41952 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S935840AbdCXT3v (ORCPT ); Fri, 24 Mar 2017 15:29:51 -0400 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; From: Wendy Liang To: CC: , , "Wendy Liang" , Wendy Liang , Michal Simek Subject: [RFC LINUX PATCH 07/19] remoteproc: Add firmware checksum resource entry Date: Fri, 24 Mar 2017 12:22:23 -0700 Message-ID: <1490383355-23176-8-git-send-email-jliang@xilinx.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1490383355-23176-1-git-send-email-jliang@xilinx.com> References: <1490383355-23176-1-git-send-email-jliang@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-22962.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(39840400002)(39410400002)(39850400002)(39450400003)(39860400002)(2980300002)(438002)(189002)(199003)(9170700003)(50986999)(77096006)(36386004)(107886003)(48376002)(50466002)(8936002)(38730400002)(6666003)(8676002)(54906002)(36756003)(110136004)(2950100002)(6916009)(5003940100001)(81166006)(47776003)(9786002)(50226002)(2351001)(4326008)(76176999)(356003)(189998001)(5660300001)(106466001)(33646002)(305945005)(2906002)(107986001)(217873001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR0201MB0761;H:xsj-pvapsmtpgw01;FPR:;SPF:Pass;MLV:sfv;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;CY1NAM02FT007;1:KTa8tHxybQi8PvNljFaRYlIS4lDUaZrnHxE0jfrO2UQnTI01ybTfI50qA9xxfdgI0puPPD7CDjYVfItotuS4ylmUj4q8iE3qyBXqFtoDg7WTXsByAvGmDBLlAMaGBstmm1iiCII20Gx7IIwjeLNaRqCE/bhuB4pEN/GGutbHT+SfGLaOfr9bLQts5f7STak2/SNes40WxYwgs8mr94oX2umHqHa7NTlzmy0ON9Wg1o2UqScLGzJ/cAaWZGfuhstJ24sxxVTGpJDWA2bYXMdse5vHM6bC6GWHGPbmwtTFU2tzH3d5FqIz+tkl6lGsDJVYz/HPlzJxFi1PAYmAHd1LiICqCakueDdUv4A07ho/AjzxMqt8POKUrNuz5xMqTTj+YA80x/IXHhiwNBMZh5x1CyCsJMhybPhwyWCCt4KfLN4UrVlu/TdsKTd9F/uRgWoBSO4X5zIKIpa1R/UcSVwM+Z3EkGzvcJRdhUiX7fY/9bm3BvRJw0iRXOI0i70bjWgctVQ7bKe/fEToHsWqMoK3R2qvG0U4MRMYDWrDDWBXhZk2hm6vPd7YQRSbFd3gqYUgDQfN+cNOaJObX+ao7YI9ZA== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: ccea13c7-dfdb-4678-2c5e-08d472ec22ae X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(8251501002)(2017030254075);SRVR:CY1PR0201MB0761; X-Microsoft-Exchange-Diagnostics: 1;CY1PR0201MB0761;3:eYj6hBbtHN05ELP13CVCWrkenhkejM2T070lSeDzvFr5W+iKoNrDUMx7WI5d90/hwPpEay0Ym0T5E6BzFaq1JN2lGupnN0Y4ukyL/Ff6rvcfmO8WSemU2VXrJ0yL4HqjFtXA7mEVNhLkmNySRxno1oL5uRN8pxfvdEL4kAw/V4eu1tW+SasxnaPjfJVxSEjA5kDOOFoemPkxC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/AT5Ru9l59ATKmhL59lWpcOoFOpXrVddW1lZCYkaM1fLcWB+d2m5vz+HnmABzlDA+rggPoPxkvjBThSNwY+lFSflYBAebx0ANHc/xQrk60dMuL3z2u077wBNbQjkkq8slPiKeQQuZef1oUHGRYMzsLX9te87nzMU7soPBy85No56fKON1qprRYqlkRNTc8j51pn1BMkALau7l79GNVLl/QgYXmaHL2RyDqOhukF3bsssDyI8OqucdJEuk7jBERik3coHHn6szuY7w0MK8cbwiofop3mnd9oZDj44rjzv7Tjj/x9ZEUzVQkyX9XqbP7TP6v15cZKQBV+nrvHrr9V/yASps+iI6Y9kb+264GNkM/v5Zm8NcWx/VXdwKhgBKE4CmnJqYHd/NJb0fUzkd7vyo+JLIYkyheiReHjpDJuLg+kq+v9lW+1Vs8XTPIXfpI6/F8HOX+CVcnfZeftXngLl0DPCtt X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(13023025)(13015025)(13018025)(13024025)(8121501046)(13017025)(5005006)(10201501046)(3002001)(6055026)(6041248)(20161123555025)(20161123560025)(20161123564025)(20161123562025)(20161123558025)(6072148);SRVR:CY1PR0201MB0761;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0201MB0761; X-Microsoft-Exchange-Diagnostics: 1;CY1PR0201MB0761;4:mZ+i1jiCwVB0PcOaGHiYbxPnLREce1QiPCMBYrzudrV+tUd/6rdhVPi0luh2bLb1JAUsiHNTeOtbqZi48Gv4T1YcOGrvCa20KSngvVaGZrEV2EN2BSHGo5gA6rSKnvgCNnDP1zo0R3rU24mC8AxA8ikEgAMBkCrzq87EhfT2VfbHIYXRdc9GMjwHt5iSXUrRt7ltQJ4E7QBrqHxBxPpoOFKoxmFN+zmQC5AM8Po5WFEidBAqOB2QiZyER2085r7hAfEmaT8xArXuIGlwVBZfXB6GSpzH/yyTDh1LJ4yxQ17jqGtnXHrKogrG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kGdvdwP9lpBysCTAezq2Xd4YljKo4gh7kFNZWzxGfgBJOW+mlAdZLfoVWHgLNZtl8mYVv34QmqoXolntPQynoDiawyZJ79nY9UT7Rm7/lPkzoQP3/XURStHj+TSG/N9Fy+/J+q4Fl/exM/LlcpEm5ZV+IwiwbOgm222W/yvptHgWzcrBworScKkTybCaNLmvJ3uDw=;5:ve0gwN6PkO/sQpe+fH1oNFqIFPLMTivRPFMI/ZIfokDYm6ydFw+E8J9KjlACm9OMTwHO6Fzj428qMfG72oGxs91EGkJP1JpmpI8wGjevKX1nCpq3TRZ5SKhA8IT6SufQnEkeIygsQyHGF2dBSRsI/w==;24:/QUr6AkfA6RQZjlsgJG/buYGnwYpqfhIvFVSs7uAOVt76tY4lqwHYjWIhxxYyElmhZqfXed4PILPd3fRdYUerFPmgKzF7hYeyicY4t/vgNY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY1PR0201MB0761;7:/w9NogPcNaI7pM+GZE4BsQcCFx2g0wEQ6LUXHvMpe7HvlXPAtHdu8f4emngUpf+qJdP5xx25jHR4RdIkHGXwREe+xzjD1c3hpJlNtEOTCr5aV1tbrP/pEuVvvtZuWy3yKHtfRxlbeKQ9frqLhYtEtBvIC49RZ1zrZ6PDP7gUGUUREhVg7npPITHyO2TLcJBp5dF3b0HscKXRJ8kH/8FZbZUPKkSOslmAjEG+Xd4ZuOWQTV2Y02u7J61XztuMIHjq4ImDxVg5OD7aKlaNRjxRYaM+E8Aj7rwPvKrqTqWQEoL4g57rjDDbZzkXuB8fQNDOu6vrAxD0vy0dHxJwV6pg4Q== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Mar 2017 19:29:48.3270 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.83];Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0201MB0761 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1559 Lines: 53 From: Wendy Liang Add a firmware checksum resource entry type to store the checksum of the firmware in the resource table. In the remoteproc driver firmware booting process, it can check if the remote already runs the expected firmware so that it can decide if it needs to restart the remote if the remote already runs. Signed-off-by: Wendy Liang Signed-off-by: Michal Simek --- include/linux/remoteproc.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index b740b93..303210b 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -116,7 +116,8 @@ enum fw_resource_type { RSC_TRACE = 2, RSC_VDEV = 3, RSC_RPROC_MEM = 4, - RSC_LAST = 5, + RSC_FW_CHKSUM = 5, + RSC_LAST = 6, }; #define FW_RSC_ADDR_ANY (-1) @@ -327,6 +328,20 @@ struct fw_rsc_rproc_mem { } __packed; /** + * struct fw_rsc_fw_chksum - firmware checksum + * @algo: algorithm to generate the cheksum + * @chksum: checksum of the firmware loadable sections. + * + * This resource entry provides checksum for the firmware loadable sections. + * It is used to check if the remote already runs with the expected firmware to + * decide if it needs to start the remote if the remote is already running. + */ +struct fw_rsc_fw_chksum { + u8 algo[16]; + u8 chksum[64]; +} __packed; + +/** * struct rproc_mem_entry - memory entry descriptor * @va: virtual address * @dma: dma address -- 1.9.1