From patchwork Thu Aug 16 12:12:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Huang X-Patchwork-Id: 144381 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2001768ljj; Thu, 16 Aug 2018 05:15:29 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyRn5fowGy1MwjNUDkbo89se0FH72+TvHKDb4R8hX27ZPUcdu/Cynvq1MbR3uScTKxc/FYB X-Received: by 2002:a63:f713:: with SMTP id x19-v6mr28725336pgh.233.1534421729736; Thu, 16 Aug 2018 05:15:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534421729; cv=none; d=google.com; s=arc-20160816; b=clI82CRjqxBk5OfgmoCDUeDLffguE+JGrUqilPasJh2+8UouUX8RoMsexAgo7laOSC V7xleOvt1mUjrjfk6hIRYUWNiCC7BhNYAB+E+OAT52drrJt7E6s+NCn9iz2z2O18ANhj CVBKxeSN7bM0oQ+TdxR43QV8bRfjR7VqrudaNwUduWchg/jSdR6bZqY9E1opzgPSFPkR i5syQ9uDSnXrx5cKh6daYB25PkDVDLSnhFxzenWcgljkhUDr/QGumG8JZHkYy2PPF9Vs cLdc7ThVD/GY4a5JJod6Osf/TXd7uxXVJEYxKM9kv9TdegRIMfFqBgeiQLCxo/fdg6SI yMgg== 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=aMwN1qcdG7jMT/LnzaKjeB+JUW5mKkzWOsXtTbIBnJFoD18vGDMFrw41bT6dTfcyoJ SqK4kHlyY1EXOub5Qv0OMMaTeF8nQjjUvIH8ZrXNtH0cFOlKiTYCfFEWZTLTm4jxD+CG fgABBLJAlOeAhEYA/4aahUYWdSNbkBBMKAxwUbn+ck2ih+KkNR+oOtX8WQyV0q0VIzTE 30ziy1EvBS2W8d6TSuPqWyJBNWjFKIaSqk0Um9PpVGFOQZ7WPBaTuXMxh7YHM9Q7/qhX wLSZesC5EvdFC5Cm89w7FqszmeWteCCD+R5xJ7fHYjGwx6vHs2fUCKtpejm+jSCMKrGU //CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=ZHxGJ0YC; 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 l2-v6si26964699pgk.572.2018.08.16.05.15.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Aug 2018 05:15:29 -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=ZHxGJ0YC; 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 D9A84210F3D9F; Thu, 16 Aug 2018 05:14:51 -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:400e:c01::234; helo=mail-pl0-x234.google.com; envelope-from=ming.huang@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pl0-x234.google.com (mail-pl0-x234.google.com [IPv6:2607:f8b0:400e:c01::234]) (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 76ABA210F3D9A for ; Thu, 16 Aug 2018 05:14:50 -0700 (PDT) Received: by mail-pl0-x234.google.com with SMTP id w14-v6so2014698plp.6 for ; Thu, 16 Aug 2018 05:14:50 -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=ZHxGJ0YCqSf20nlfoYmq/qAj6zygUa4VjgpKlmMWwzhBLfKG3+ztkeeSAqrcHmZsv8 gTtCm/1/QNIBIESCAwAq3MdzDdguGc3VVGV9LmgeCI7OKN2ojdHRZsu+14xTwk27KV7T PM8EnE7QIJDAzz/DGnVeCSerwpWeAuZ+Gtob4= 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=mR80LqW3XhqePi3ImtUPD5zuYygyt/KQ+gXuPj2kc2FKlrNhhrZUS0BtDJ9ioKWcjy ZOmZkozsH6Ad+LfndAtA8q23xQgrq+2wvauWdH+duU+uywt2Jcw6ofW24vSUtxFofNH8 NVtrFTqAvYit36qqxS6KoUerPPL4WJzr4LHKpVo/srS5fnmjiY5SHulnaYeXJlyS6KBb lelyEBxQxg9v6sdLZWX/Rvy/xdkFYxGTRZGt/k3eoELBYfZ7I+ZcZjQIrZWNjehQCwxh D51hXa/NfzBj/yEwjjTdSkO5FMuYUoHBDiPVOcgyL9g77dZtRl6+Ta3oKgosDANP3jZC kisA== X-Gm-Message-State: AOUpUlHlpegHAHnbbtnrwdQFVvkebwgxu1GJZty7C2Xu2tAbp857O4qO EkwjGbSVMeBJe1I089stQtYpAQ== X-Received: by 2002:a17:902:2e83:: with SMTP id r3-v6mr28969891plb.80.1534421690236; Thu, 16 Aug 2018 05:14:50 -0700 (PDT) Received: from localhost.localdomain ([120.31.149.194]) by smtp.gmail.com with ESMTPSA id j27-v6sm46736311pfj.91.2018.08.16.05.14.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 16 Aug 2018 05:14:49 -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: Thu, 16 Aug 2018 20:12:34 +0800 Message-Id: <20180816121239.44129-32-ming.huang@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180816121239.44129-1-ming.huang@linaro.org> References: <20180816121239.44129-1-ming.huang@linaro.org> Subject: [edk2] [PATCH edk2-platforms v3 31/36] 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