From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Google-Smtp-Source: ANB0VdZkjAEO7Ej4SbI8duR/0F/ma/2ervfnMomlbHPhDHvQEEZe9VGMgygRe/YaWsvcefXpzTTyJw== 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 Cc: ard.biesheuvel@linaro.org, michael.d.kinney@intel.com, lersek@redhat.com, guoheyi@huawei.com, wanghuiqiang@huawei.com, huangming23@huawei.com, zhangjinsong2@huawei.com, huangdaode@hisilicon.com, john.garry@huawei.com, xinliang.liu@linaro.org, Ming Huang 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: [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: , X-List-Received-Date: Thu, 23 Aug 2018 16:10:23 -0000 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(+) 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 -- 2.18.0