From patchwork Tue Aug 14 08:08:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Huang X-Patchwork-Id: 144146 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp4050847ljj; Tue, 14 Aug 2018 01:12:44 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyLjJuNJeAoPaFjCR3wTtw0nT3sEKUl4xv1nXwcWwLglk3TaC2Qy5ugl92ObCgyf2NQAGAZ X-Received: by 2002:a62:5047:: with SMTP id e68-v6mr22610311pfb.157.1534234364124; Tue, 14 Aug 2018 01:12:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534234364; cv=none; d=google.com; s=arc-20160816; b=vLFqYg5AHb1aMGKRwoIXLA4XNmF4VE407ZtiB776u2Qj6/FOOPX4TbJkoPpoQVm70L KxAYeuiJC9maCiY9Y1rCCr2Rea4UpQ2jOmSHlVAjgYXgM/DtjnmzZZwakMnKJjSpevNe PaSpRRhEVkvwocg1qwMq46HPgUUsR9Gd13w53HstoDQndefaTVdnktKmJWRVGUHct+Rg b1n2DJhyLElHr5Ac48ag2XQ9H00JlxD3Y8P45yQag5Sh6zA2Q8gBteHK6u0sEJHOyPL5 WBKVWPHNpgLq/Vw08pj5ojCHw2xO8s7YS/549hdqD4LU8hppmdVCPmmDhwgK+6zs5KUH 4l2w== 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=tK2I5xzW7TAqmRo+XHc3FUIvq0OVMbvHdK9wpQ71DFc=; b=OIk38OEkU5c2iJ58L6p3wOupFKX02W5slEMR14gAdeUWmdrJpTdE7vqWdGRcq9Ystl k6meJs9t1HgLH4OK9IdbaZEl/hGJN0RwuB1n/OfU0R2p5fGN8MGhIU6egcGNHuZr2Gcv 5ku+WDJYntlyLho3V7XASOfBGF0eceivWaVZPNfLKHInQcVoD+fTifgzMS7k8xwZtQuC 4ut1EihoirINJHCQJH3/Mc4r0sD4ktTJR/xqd7kUg40QnkhehZtWosNlOi/+E9aCVMWT qGZhtvoQQqRuahbAGSH5ROBjIa2NJXf8uAinwjIKl5exS2pqbmWPznlTH8FW1Wnb4xZH Tdsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=iDbtAuvU; 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 u24-v6si18507143pgk.72.2018.08.14.01.12.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Aug 2018 01:12:44 -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=iDbtAuvU; 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 EDAD7210F254C; Tue, 14 Aug 2018 01:11:37 -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::42d; helo=mail-pf1-x42d.google.com; envelope-from=ming.huang@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) (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 EE041210F16A6 for ; Tue, 14 Aug 2018 01:11:36 -0700 (PDT) Received: by mail-pf1-x42d.google.com with SMTP id y10-v6so8925197pfn.8 for ; Tue, 14 Aug 2018 01:11:36 -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=oQZTdPX4Z4+IudM1ZbREKorW3bJ8D5rX+lh1isOPEVc=; b=iDbtAuvUYGiZuW9qEKnvFOphve1j7C/ZfZ9oJN+gHUDT2wUTmXJRM5kSg1oxjjlA+L lXnFrqn8bV615EEkUtCratcm8Ks8JGPBi0SVdeixGSSvfqQAK7eEMAc6wmxbgu9+vy5M zgronNCDcsi/ARUNgI+sorQptxmJVut5q9pFk= 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=oQZTdPX4Z4+IudM1ZbREKorW3bJ8D5rX+lh1isOPEVc=; b=TvXOeH2dnNISvAqXjNRLxcbJg3OrwxgG+lCcLz10z+WzNRtk6Ej+ESRRmzlN3Tw+3N q6THW4p4MHefAzl/n7USFsl0mf/cZF/HpguWyeL1v0619KZfxbPedP3oDmFSXV67YFfB rTi7NpJB5vyRpqT64Olz0xUWp0DkYNUMfuv/mU9e05IlB/MkowI1uxm7w9IRHgpXIVNA ES8gs3o6oS30vuQEMdEsdx7s1Rehsfozg/sRUN5yJOL+AVqNBU7Rnevc1rDtxnz9P8U3 vERXJxp8NECT5H+VWami9adDjRZx1DgLUCNMEdn+mdmZVoPL3LEvEijImCYW7G7cIdCL ZOmA== X-Gm-Message-State: AOUpUlHB7jZ/qvDxZi8v0G7/einC2vxGgUMCOmYX6tsGPENCJPhCwQdw qX/5yoUG0ZQoBzL/74ytTyVKlA== X-Received: by 2002:a62:4255:: with SMTP id p82-v6mr22543914pfa.238.1534234296629; Tue, 14 Aug 2018 01:11:36 -0700 (PDT) Received: from localhost.localdomain ([120.31.149.194]) by smtp.gmail.com with ESMTPSA id h130-v6sm72905670pgc.88.2018.08.14.01.11.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 14 Aug 2018 01:11:36 -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, 14 Aug 2018 16:08:58 +0800 Message-Id: <20180814080903.50466-39-ming.huang@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180814080903.50466-1-ming.huang@linaro.org> References: <20180814080903.50466-1-ming.huang@linaro.org> Subject: [edk2] [PATCH edk2-platforms v2 38/43] Silicon/Hisilicon/D06: Add I2C Bus Exception handle 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, 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.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 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