From patchwork Fri Aug 31 13:27:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Huang X-Patchwork-Id: 145635 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp785187ljw; Fri, 31 Aug 2018 06:29:20 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaV3ILw9/5qviv5f55yQopMbKkGvpFpTuz9na54bWUy7M0Fk4NiNt8c83k9V8gAb97VuS3b X-Received: by 2002:a63:5b63:: with SMTP id l35-v6mr14511963pgm.50.1535722160569; Fri, 31 Aug 2018 06:29:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535722160; cv=none; d=google.com; s=arc-20160816; b=mNpmRnVxLC/1DctxAzw6GAQCDXNB+jIzlxfSZ0mAr7tZeye8iTYE00fVhA/hi+eMr/ bYql4kk0xXjDOlXdBUZmqJ1B6usNjnBrE8Ltv114gOn/lxCK3kBFYcXwVpwnk4MCykq4 GALbo+kUrG8eKyqbt0dkpswkNDTL/t8gcexMiNRY2uSidnAhU8u+9MG8Rnbne+V/i0Ry lxntkHAY7eNKw0SlTCgeEOX7P4rwyYFCmACKt4xfsGrfKuRHSiNXQcbZBR1FAQBwlm+4 0AlwpeqRnFids3WcusKhEvwvesqcIQobx8+rm7OAjzOAFx7E1SRCluI2HJ5MnVyFzTmH QU2Q== 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=63eLxo4ZLBI5N3vI/gFucaZfFF+PmOYtXtHAyhqbbrI=; b=bBir7PnrJzO/dOCBHpNywoPlYx9SN9jbBCtydpanGBU4ha8X63XVzqjEO0KxFTGm8l pdbtYCjKuNf9fskcyVtSG7hNIZUCqQMSaZxP7MzGM0QnOjaKLQ7OoRZ+bMRH5gJ85Y4H vVdmTufm3bjCtfveUunqEffQ6nWNVBnS5Z6GxM/BVQjm+dhVblgJrYb5uGXn3RMVdniy nkSVhgg3M2n6EKraRzuSSSw2abwhrnlrp89lANEf2WojTDzpzG0PZt5XVefFsYepay2j sLx9avYY3HLuszDPv8KpkjS/FQbekmvzk8lsYjyJpIpdPwL0S2IFiH2sOkq0sNziwzA/ 1GYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Iw7JbrHA; 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 o5-v6si9401633pgo.250.2018.08.31.06.29.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Aug 2018 06:29:20 -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=Iw7JbrHA; 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 455A32110BD78; Fri, 31 Aug 2018 06:28:56 -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 975612110BD68 for ; Fri, 31 Aug 2018 06:28:54 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id x17-v6so5536183pfh.5 for ; Fri, 31 Aug 2018 06:28:54 -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=AUkxwPojircRj7QamPyy7BiiH3Cj4V/KyOnceErQlQw=; b=Iw7JbrHAHXQX/72bRYNMInvTY4lvvc7/0AHms0vdqbzlLnV9nwciD6D9AVRwFpu2F0 ZcbGDxwKnNNA7xE6w9P8OdzWVdjj5RQZdIYDwHmAW1wl73l7U67vs2qOankylBRJRjZJ Y+9DsfLg8MsoCe5Cl14a5ZHPSOgZc8tSmOVI0= 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=AUkxwPojircRj7QamPyy7BiiH3Cj4V/KyOnceErQlQw=; b=lnrYPtOL3/ClRTDFRjbExdjyVpBAd3lBuuyXqv7BeTPlVXT+LCyDhIqwwrhxEnGChz jo4jfdg8RSHla04b+jjRzUiH8yRciGL+bEXUTMj1YwRjtwLlQ4BXSPlgwqfI9Oj2aD5L sHZaB0Nl7gY758c9MAMZUqAQSfZjPzOHibRJ9VwA9wkLVfHqIo7SJ9x2C8P1/07dKgss JdG8laIWISVK7PTJSnraJXQ+hkA0K+svt+mup5TfiEGxq2CI+y5A8QiFPxZaT4yX4A6j vHKqDwJ/US47r8OnsNorslcpyFpNpLvFwiDubRP1J4RxGx4rjzIb7Q41cQluE/FiN0/5 T5cg== X-Gm-Message-State: APzg51BQjSKAc2VyIaAQOazfw9UtCkZcjqGWXb9yC5BNRnAQzGUsgoab I8EKMlQFcxqeg7UeE3yicU1Kbw== X-Received: by 2002:a65:614a:: with SMTP id o10-v6mr14530849pgv.387.1535722134309; Fri, 31 Aug 2018 06:28:54 -0700 (PDT) Received: from localhost.localdomain ([120.31.149.194]) by smtp.gmail.com with ESMTPSA id l185-v6sm19081936pga.5.2018.08.31.06.28.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 31 Aug 2018 06:28:53 -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, 31 Aug 2018 21:27:07 +0800 Message-Id: <20180831132710.23055-26-ming.huang@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180831132710.23055-1-ming.huang@linaro.org> References: <20180831132710.23055-1-ming.huang@linaro.org> Subject: [edk2] [PATCH edk2-platforms v5 25/28] 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, zhangfeng56@huawei.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 Reviewed-by: Leif Lindholm --- 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 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