From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Google-Smtp-Source: AA+uWPxhdSflIuo8xSkiJjjtGvAKXtPwos7o46t9vhz+PIXg2Ah9OWkJxdtVAOm1CO6Kd09ErHfM/w== 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 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: 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: [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: , X-List-Received-Date: Thu, 16 Aug 2018 12:14:50 -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.17.0