From patchwork Tue Jul 24 07:09:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Huang X-Patchwork-Id: 142736 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp6941039ljj; Tue, 24 Jul 2018 00:24:13 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdr4GOncfaQWorbPorcMqSgfHK8zZ5vLg1iFS7sE8Y0Ps+LPRiri+vGwtDB2bAEbVT+MbQ8 X-Received: by 2002:a17:902:20e3:: with SMTP id v32-v6mr7321889plg.232.1532417052894; Tue, 24 Jul 2018 00:24:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532417052; cv=none; d=google.com; s=arc-20160816; b=xTD/Z9nlPqOlDhQmjZpjOcfyeqSPi5jqkvYZRbzyjcxDP+JDY8aWAKIeocjFhoFPFy evRI3BLeZV2fFVKLzeDjReuw0YC8w4++e77tCs3YP0+wjeGqI7euDIDfTHokxeAPxLQt yi0C009eQ6LHqATO/ySFW7CZUrT4dQAvdkLHRFPdNEfUQvN/PwWbtgtnZEXnhxhW1vBq m1VfBUFwfaHWDJHX53T/DJARyyy1Z50yK8smXQeqM30pu5HJXtVJ4jTpwh8zOltCmTJw oW3Aer3mDxrYTFAqsLMOrwDD3XoqYIUbjJWqdGwFmfnN7YUsLcXRa1m5fdQSc2maoBfc 2+7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=5VibTVVgDiAAseep0NOV1YERGHhMGFR8HuyIr2AnuF8=; b=xHGfnfqeBNaw0owiCD8lS3f/qYDcsUb0SqTGZjfGKs6O7LsKZZsigzoLwgkYiMIj5+ rGrdAm+uPeyjrdCfaHI3wIDpSXQk9st09TGz4mWAZ4Da5Vus7SC1oeL0OuUnaB8gHSWR L1tltHYiLKylpNrkgRDNuhpYtX4HI+GQYHTtw38dCmmY4yosS5uz2V/72l5jzo26jG6G HKh79V0rn8Strxys+6ejXLko6IqtuhLB1uZxuUAPCp83voUkjGS1TaY0PlR1jeyaldUx 1N4o9j4bF5AE+OCzG+jx2ND2wdqNujuImCth3cZ1DvLAhGorjCxE67WWxEz1z5g3criC XcGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="iY/OI/5m"; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id a24-v6si9356739pgv.527.2018.07.24.00.24.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jul 2018 00:24:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="iY/OI/5m"; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 7FAE6210C1B64; Tue, 24 Jul 2018 00:24:12 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::441; helo=mail-pf1-x441.google.com; envelope-from=ming.huang@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id EC85C210C125C for ; Tue, 24 Jul 2018 00:24:10 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id l9-v6so637320pff.9 for ; Tue, 24 Jul 2018 00:24:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=yNCT88X6dmgXTIelZSSB6beYdom8f5DOiU7LA+gfxD8=; b=iY/OI/5mq7p1LANpjDX39juE0/pWSywm0jsUhIUlfy10meTbqli81BnUrCqGcA1x2h qDwG2IHx/ke7fXOi5mvhetj0bn4KvwnSBK4gy/MMpy4V2OtCdO9Uvj9EPC13bIu5YdSG oc0Nd57u8/CgIEjx9IAgL++wGM/QQ97FllYNE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=yNCT88X6dmgXTIelZSSB6beYdom8f5DOiU7LA+gfxD8=; b=hC25txGTmbt+GhSiC3qX7s3YAuvQgO214W2tke0KF/5ycbCr1lEgNZxLpbv0LkxNjL 9HhcYHDtFiFzIunZ8OHYjUrkwCZtJX0hbfWDdpcU1HnouQsivvmEQBEFtc7bA+iTEahb cAkL566jFzv71EzEvAaFVQ+RWANK/lZm0/WXWK14Bzrdgxk20/NT4mOoLtPLtItx51kT i97KaPE/2AE7UDHbV7BSv1mI1lJZP/CVySV+orIv3cM+N8JEzXOmJgsrUYVz5etu+LHz +4ja5CW4E7++TgppOBtt7+9RmfBtX/pdKFMZ304IfM+xngNAIUqlkBz2xYKhpePQe0Gl KHEA== X-Gm-Message-State: AOUpUlFKOx/FWN5jSdLDpMhr7mTh63QYg5RyvvDOtqMgcM0EeIM+1qFr kpwM3zXkAgNniqEEe0UlUW5vKA== X-Received: by 2002:a63:1722:: with SMTP id x34-v6mr15335794pgl.268.1532417050739; Tue, 24 Jul 2018 00:24:10 -0700 (PDT) Received: from localhost.localdomain ([120.31.149.194]) by smtp.gmail.com with ESMTPSA id t14-v6sm11449788pgu.0.2018.07.24.00.23.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 24 Jul 2018 00:24:10 -0700 (PDT) From: Ming Huang To: leif.lindholm@linaro.org, linaro-uefi@lists.linaro.org, edk2-devel@lists.01.org, graeme.gregory@linaro.org Date: Tue, 24 Jul 2018 15:09:18 +0800 Message-Id: <20180724070922.63362-35-ming.huang@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180724070922.63362-1-ming.huang@linaro.org> References: <20180724070922.63362-1-ming.huang@linaro.org> Subject: [edk2] [PATCH edk2-platforms v1 34/38] Silicon/Hisilicon/D06: Add I2C Bus Exception deal function X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: huangming23@huawei.com, xinliang.liu@linaro.org, john.garry@huawei.com, zhangjinsong2@huawei.com, shaochangliang , huangdaode@hisilicon.com, guoheyi@huawei.com, wanghuiqiang@huawei.com MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" From: shaochangliang During the period of I2c accessing, if the board is reset unexpectedly, and because the I2c client can not reset, the SDA will be always pull down, then it cause I2C bus Exception. Follow the Hi1620 I2C FS chapter 1.8.2 design, add I2C Bus Exception deal function. It will Config SCL and SDA to GPIO, and set the reversal frequency of SCL to 10KHz. The implementation of functions is in edk2-non-osi. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: shaochangliang Signed-off-by: Ming Huang Signed-off-by: Heyi Guo --- Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h | 5 +++++ 1 file changed, 5 insertions(+) -- 2.17.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h b/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h index cc60e213de..483c2c2d41 100644 --- a/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h +++ b/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h @@ -106,4 +106,9 @@ VOID CloseClusterClock(UINTN CpuClusterBase); VOID EnableClusterClock(UINTN CpuClusterBase); VOID CloseSktClock (UINT8 Skt); +EFI_STATUS EFIAPI DealI2cBusException(UINT32 Socket); +EFI_STATUS +EFIAPI +I2C_DealException(UINT32 Socket, UINT32 Port); + #endif