From patchwork Thu Aug 23 16:07:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Huang X-Patchwork-Id: 144966 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp315850ljw; Thu, 23 Aug 2018 09:10:41 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbhWO1zm46Go4xY2CUlXr/b1VTFM/EkLY4pvzPBQuLgVY+JPpPUmkBJFG0LqbimbD6I8rju X-Received: by 2002:a17:902:b947:: with SMTP id h7-v6mr12451764pls.140.1535040641233; Thu, 23 Aug 2018 09:10:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535040641; cv=none; d=google.com; s=arc-20160816; b=vV+IYP7UnFikOhbZ4zR+FMSrOV9DuCGmrhV/L2+uPxl+aybHyz16dGGyvk3BTBpOus jY+LJ5PkRPA9xBN8FYPkREPq0jbNFoIb3ex7fjFhZ11pm7gdYVfq3oQdZ0JQhryZqqco Kt1Sq1VBQg4llM8bhQSWCNLCVaL0ROShkubFIW0hgQaKgLmEInyILS4py7aGIi/6/oAH XIsWi9X9OzpW4Jt9adcZsSt+T/ot/yCYGXirJCxCR+YYZnACcGjX7rDfFwLUGV8m0eo7 4ce+pbV6gDrDCuiRAOK7uwW2oHgld0Li0EhCmpAZXehETdUm6vC1AFBDCPif3GtBHTa6 YfiA== 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=7EHcC3d9fNtsNaQ/FLBuWvJ2BdBLcwdD2SWofai9SMI=; b=xyq6IasHePww1whMt8quYo655DUc+6lt9/C/ObZgaVsFdSCrMBvyiw08N7o4fuhuGM 2c7X/SeOtq0X3MPX1LuUipEW1dqLtMccf8P1E+HIvll1V2A2u7CRiYcJh4veAUzQ7NnZ kGTftA8ZgTBzZci1MXE9Z/FtdqH27McthQl2cHDTZMb7q5oTvTVi32vGGUmzzpzb9k19 Z8isFZ19VC8McfbZHVxoNG3o5lUovfewOoIKOx/RwKtZqINMBSAOwoZkivMymEkBvA1h tB9ldhKqYaVNF6LVRVwZF6DMLaq+yQL/NNctHFYme8oJ58nXSB9lB/Gl040rBef9S1dz ey7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=QMAvgcKL; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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. [198.145.21.10]) by mx.google.com with ESMTPS id m2-v6si5317118pfi.351.2018.08.23.09.10.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Aug 2018 09:10:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=QMAvgcKL; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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 33D9E21106C63; Thu, 23 Aug 2018 09:10:25 -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::42f; helo=mail-pf1-x42f.google.com; envelope-from=ming.huang@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) (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 8D9C4211069F0 for ; Thu, 23 Aug 2018 09:10:23 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id u24-v6so2972114pfn.13 for ; Thu, 23 Aug 2018 09:10:23 -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=kYsHo0SwA0TsXUUWmOGxlZlTFJ1ZaFVxoPJ5qhB1fXE=; b=QMAvgcKLKYyADop/G4X3FEU7OqaypIO8u8e46OzCFMFp6IEe6+KdwOb68f5iWoNQ+G 8zFpZWzO1rNwYLsWtubQ90ezeBEyuajVzU0rDC6bHpncjybSMNSIuN8le4fc3Az0YyQF 4vXy+Nq9z8tZTf3yKS9GZ9CbJsMc9ZnRJyBqU= 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=kYsHo0SwA0TsXUUWmOGxlZlTFJ1ZaFVxoPJ5qhB1fXE=; b=XDntcGalz4SXaa1iQEwNRI+qQvOF7BelmrRSdGErCXUTBD88hbsoKwf4umEpBk49/+ fgTNi3AE5Z0v52D9ypcSFw1bjyoYNwOJHVl0L66M9BcJR2JHPnuSxbi6PwPtgu2jzM6H Q+bnnQQL29XxNKW46Mhtab0e8FHEc7p/OlGkGBLft7Nu7+qyvtnXjxR417+qsMMbjFih wNWM8yrtapKgwxmxaV3nDJK4VbLqBYWDZldkDqWjV1sszjQPXiB/vBRPx6Qb0+2QFtCh 1ovpHKlKI1fEx/b0FRRSYwd4r7fWFjpDYIFoP4ZlwylW7STA1fbJfPdzrPbxs2xkbB5W Y4mA== X-Gm-Message-State: APzg51Csq8gNutJp81fL1TwNItkcSBy9BQE+GqsGt2gLbkzCf4PCJ++i FzzDpEXos5C/y1HQgSl2y4ZIJg== X-Received: by 2002:a62:12c7:: with SMTP id 68-v6mr3739985pfs.216.1535040623314; Thu, 23 Aug 2018 09:10:23 -0700 (PDT) Received: from localhost.localdomain ([120.31.149.194]) by smtp.gmail.com with ESMTPSA id d19-v6sm5788083pgv.61.2018.08.23.09.10.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 23 Aug 2018 09:10:22 -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: Fri, 24 Aug 2018 00:07:39 +0800 Message-Id: <20180823160743.45638-28-ming.huang@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180823160743.45638-1-ming.huang@linaro.org> References: <20180823160743.45638-1-ming.huang@linaro.org> Subject: [edk2] [PATCH edk2-platforms v4 27/31] Silicon/Hisilicon: Add I2C Bus Exception handle function X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 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, guoheyi@huawei.com, huangdaode@hisilicon.com, michael.d.kinney@intel.com, lersek@redhat.com, wanghuiqiang@huawei.com MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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 handle 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: Ming Huang --- Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h | 3 +++ 1 file changed, 3 insertions(+) -- 2.18.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Leif Lindholm diff --git a/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h b/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h index 3ccfc6bee3..a232e52ed7 100644 --- a/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h +++ b/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h @@ -106,4 +106,7 @@ VOID DisableClusterClock(UINTN CpuClusterBase); VOID EnableClusterClock(UINTN CpuClusterBase); VOID DisableSocketClock (UINT8 Skt); +EFI_STATUS EFIAPI HandleI2CException (UINT32 Socket, UINT32 Port); +EFI_STATUS EFIAPI HandleI2CExceptionBySocket (UINT32 Socket); + #endif