From patchwork Mon Oct 31 16:47:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 13026123 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AE2E8FA3741 for ; Mon, 31 Oct 2022 16:47:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UdcBuJKE/gJoK+wIPmuEHcw2wixQc01yfFZzsfdYiSA=; b=MTdLPgpFVjQ7bP GEqF6KrtuYT4wcI/I69MO24k4dfknDu1bzpVa+xx5d70FF3gHrdUL0LEvNxtCQDI/QCj2VVALEDBn cJRekZYDZllT9PkbJp5o3P8Kj69ULBKfYsiHMOWPpeQSSWqQ/n45+4vmkpvnuXkv+Lgux5TNtbTa5 vRasMHDHnry2FGCw4hgrUWqLeeEhjp0GIBEmZVWpkyW8Du83PRj7c6ayBP35qpH+/iRMk72iMyY7R NI2QyFvSgZdHwAzd7Fj6/CGSMWsCH4sOebkWCZfERU8gAcaLNvre3fzgYGCjoelhVJ5DvVn83OOSw Fnb4INT91xUPvP1jI0Lw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1opXwi-00D5UU-OT; Mon, 31 Oct 2022 16:47:32 +0000 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1opXwg-00D5SS-2P for linux-amlogic@lists.infradead.org; Mon, 31 Oct 2022 16:47:31 +0000 Received: by mail-wr1-x434.google.com with SMTP id cl5so5159608wrb.9 for ; Mon, 31 Oct 2022 09:47:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=NOvjAXevhTkIKEozXkDl99JqlY+Qi6ewDIiwMUqw+eI=; b=qY2IeKDRG1F4poEQPiAWWwD+glIBmz2L95iZxZiagfOCWZPnnMTf3cBx/VNmUR3OSl O2CLdUJ8mHfln5H75LZ1mzfbQ/cAL6C3oMFXSNSbbavXhhQNkMD2qQ897BCUKTSa+SHS L4bV0YSEwLQQeIegTJV3MIJgFJSYs5K5tdIR8H2MRRYvESbxB8zqP7qdblVFmAIFgm5o IycEid4/5BbtDlltxbKqLS9INDgq8xCg13tVBe+RaIVPMTe6gCdrWRLx8yjueLjRmeC+ JWLK42+UZHM2V5bL1ZYpVuUu1r3KY9BDCEn/a5Z1YyiuGrHONQQ2NKE7BnRGprS0Mqev vV0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NOvjAXevhTkIKEozXkDl99JqlY+Qi6ewDIiwMUqw+eI=; b=q+nbYTL/jAH10Ti4H9Wp2IQrHSYxX8cSKigt7co3tFuDYQ/PE94e7x4nwXcmJZTfKo REFE7tGM2PZsAmMpbNqTiDhvHvLKqKeig2kO1HHp59XAYasG5haWE09ljRag/HcTbU3Z JOs/UPW1cPCKxiwZQ8aAo9havLnMfmI7itcvqXdv+QqA7nUOD4teBxhMmY1QGpQ5DstC /9R5umGjpDkp+O2oUEbkJKDtTQiEBp62Olr9I+j1rAaXcoCW0EVI89Anl8W/z7p3ISC3 dikAIIZNfJ+Kv2y1GVLKL0XJ5qeRa5mn9Rf+BN5X7xrrCEYThIPQVYeWkfxXJD+7zR8L vEug== X-Gm-Message-State: ACrzQf1k/fSc46XvYdy4I/KPQL0Tb+UyQ4LvrzSgjAMqvzOyS2STclMN 3LP3zHbBAadik46WItA73KTtbA== X-Google-Smtp-Source: AMsMyM70WHblAByJ4Qi+nU6doCl8thqDKuH5Zl1XoFQhfj9UxiE9dDkzhRNahah6ucvCPCN5k67C1Q== X-Received: by 2002:adf:da4f:0:b0:236:cdd4:4ce2 with SMTP id r15-20020adfda4f000000b00236cdd44ce2mr3330832wrl.626.1667234848824; Mon, 31 Oct 2022 09:47:28 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id q8-20020a05600c46c800b003b4868eb71bsm7488871wmo.25.2022.10.31.09.47.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Oct 2022 09:47:28 -0700 (PDT) From: Neil Armstrong Date: Mon, 31 Oct 2022 17:47:25 +0100 Subject: [PATCH 1/4] dt-bindings: reset: document Odroid Go Ultra power-off MIME-Version: 1.0 Message-Id: <20221031-b4-odroid-go-ultra-initial-v1-1-42e3dbea86d5@linaro.org> References: <20221031-b4-odroid-go-ultra-initial-v1-0-42e3dbea86d5@linaro.org> In-Reply-To: <20221031-b4-odroid-go-ultra-initial-v1-0-42e3dbea86d5@linaro.org> To: Martin Blumenstingl , Krzysztof Kozlowski , Rob Herring , Kevin Hilman , Sebastian Reichel , Jerome Brunet Cc: linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.10.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221031_094730_273530_0A0014D5 X-CRM114-Status: GOOD ( 10.51 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org The Hardkernel Odroid Go Ultra poweroff scheme requires requesting a poweroff to its two PMICs in order, this represents the poweroff scheme needed to complet a clean poeroff of the system. Signed-off-by: Neil Armstrong --- .../reset/hardkernel,odroid-go-ultra-poweroff.yaml | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/Documentation/devicetree/bindings/power/reset/hardkernel,odroid-go-ultra-poweroff.yaml b/Documentation/devicetree/bindings/power/reset/hardkernel,odroid-go-ultra-poweroff.yaml new file mode 100644 index 000000000000..65e42258717c --- /dev/null +++ b/Documentation/devicetree/bindings/power/reset/hardkernel,odroid-go-ultra-poweroff.yaml @@ -0,0 +1,42 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/power/reset/hardkernel,odroid-go-ultra-poweroff.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Hardkernel Odroid Go Ultra poweroff + +maintainers: + - Neil Armstrong + +description: + The Hardkernel Odroid Go Ultra poweroff scheme requires requesting a poweroff + to its two PMICs in order, this represents the poweroff scheme needed to complete + a clean poeroff of the system. + +properties: + compatible: + const: hardkernel,odroid-go-ultra-poweroff + + hardkernel,rk817-pmic: + $ref: /schemas/types.yaml#/definitions/phandle + description: Phandle to the RK817 PMIC node + + hardkernel,rk818-pmic: + $ref: /schemas/types.yaml#/definitions/phandle + description: Phandle to the RK818 PMIC node + +required: + - compatible + - hardkernel,rk817-pmic + - hardkernel,rk818-pmic + +additionalProperties: false + +examples: + - | + poweroff { + compatible = "hardkernel,odroid-go-ultra-poweroff"; + hardkernel,rk817-pmic = <&rk817>; + hardkernel,rk818-pmic = <&rk818>; + }; From patchwork Mon Oct 31 16:47:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 13026124 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C1531ECAAA1 for ; Mon, 31 Oct 2022 16:48:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ITQFdbnniICWZDz4sy5+YoHddz8ZDYKysOSLJmlu38U=; b=JCoB/oUH5BrO71 RWNm07Y0GAW/YekrWK5twJuIrH1/GLSGrBPWX0EPmsuFPUoA2bwRL65SMrIvHQf3AUm8+VV2B6/bV VLQwLADnYEpp3Lb7gLI1WRXC4qFpyCr6LwfCwlgUnmTqKaE/37x8EauG+pMUHSoKlWwdepVMMUbmH Llppa0sTGU1kqGJ9qHax+ZE1EMt7J4ANlRw0FZQ3Q06SWxLeKm9lXlYLKFJN/jpYNhLwSvpJ1SJng hNRaAkTwdCXTx9gf7kbF0RkX3m1RgHg9x+fVMQEAV6xR7AVmJgTIXKNtFw+BS73I9BWYRq8FDYNfb WgkkjWPI1axMQjyGiThg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1opXx2-00D5as-TH; Mon, 31 Oct 2022 16:47:52 +0000 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1opXwh-00D5TL-Ns for linux-amlogic@lists.infradead.org; Mon, 31 Oct 2022 16:47:33 +0000 Received: by mail-wr1-x42b.google.com with SMTP id bs21so16822678wrb.4 for ; Mon, 31 Oct 2022 09:47:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=xErnWFgaDg+HEqwln9TpU02EEACDpfMaLjEESgcrepc=; b=DnnOoSoK2AhVhQBp/Ch2lYXVTR7ui4LvICzoHKNz4sAnqC0sYU/1QnVYTwh8lVheLa SOMreBchmy6gq5boDFswK5fLTpE3BIPhA4HE3oAYAe2EyroMSR0EQ9D023dGU+HlEPOn ascKLRTN+V0/2aMCpOO14noYbzT6jMaA2zsUs8oxtlUpZECLih0Nr8SixehhZYYcK9rK yaE3IeSeL43BFP7rY5YbrfwiCqpq3J7M6v51DUtrp1IloZgld2lAdAe5pa8xwwast+c5 kBdTiyrvrAIlWOFwh+OrxbO0+vsGjC3cgWMD7HES4Qf2cvE+FkG8HmGTtvtdfRWMgIOZ uFiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xErnWFgaDg+HEqwln9TpU02EEACDpfMaLjEESgcrepc=; b=fcUS8SzDF241J9AM5bcsY3i/H5PbDruqWfF0ueBd2XI7rgiMhUM1wdzYFdzQsAxB2i k/Xi+7qE9k/FybHL0FrK6x5AYGTca2X9aZZYjg4JK5h1Xko7W8lhMKKVR3G40v4Xe+lq fXHH/QVyQBF64yDcuzx/XqK5+jx0MNZiiodp8xjoCmAoqPjhem+vsSNezLVoKT3/rCO0 NOL05Z6ZAQ58PPHHHOWFVOnQpe3C6sYT06yAgKE9USaK9YeW+Afi4H6rtugFOXknFfhf YEKvFtB8XoJMwhla1s187D1qMpA2qHz0CTzMe7s/YnOaPGUHGkyqsZw8HTJJzR5y6Il8 sNTA== X-Gm-Message-State: ACrzQf3lHYKlLLUSMhhx3CfMVtyyt5zfGeNzIyXGcZq8zXcsekz3IOTE TD/vwjt5NZYlkB/cow/JzBv3NQ== X-Google-Smtp-Source: AMsMyM5duokxV3j72AD+s51mhGdvgvu5dn5e7ybRmwDvcGdv24bieBhGb5F6sULHYJrafLR9/yIy0g== X-Received: by 2002:a5d:6e8e:0:b0:220:5fa1:d508 with SMTP id k14-20020a5d6e8e000000b002205fa1d508mr9151987wrz.337.1667234849903; Mon, 31 Oct 2022 09:47:29 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id q8-20020a05600c46c800b003b4868eb71bsm7488871wmo.25.2022.10.31.09.47.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Oct 2022 09:47:29 -0700 (PDT) From: Neil Armstrong Date: Mon, 31 Oct 2022 17:47:26 +0100 Subject: [PATCH 2/4] power: reset: add Odroid Go Ultra poweroff driver MIME-Version: 1.0 Message-Id: <20221031-b4-odroid-go-ultra-initial-v1-2-42e3dbea86d5@linaro.org> References: <20221031-b4-odroid-go-ultra-initial-v1-0-42e3dbea86d5@linaro.org> In-Reply-To: <20221031-b4-odroid-go-ultra-initial-v1-0-42e3dbea86d5@linaro.org> To: Martin Blumenstingl , Krzysztof Kozlowski , Rob Herring , Kevin Hilman , Sebastian Reichel , Jerome Brunet Cc: linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.10.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221031_094731_814573_69A224CC X-CRM114-Status: GOOD ( 17.03 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org The Hardkernel Odroid Go Ultra poweroff scheme requires requesting a poweroff to its two PMICs in order, this represents the poweroff scheme needed to complete a clean poweroff of the system. This implement this scheme, and overrides the PSCI pm_power_off. Signed-off-by: Neil Armstrong --- drivers/power/reset/Kconfig | 7 ++ drivers/power/reset/Makefile | 1 + drivers/power/reset/odroid-go-ultra-poweroff.c | 122 +++++++++++++++++++++++++ 3 files changed, 130 insertions(+) diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig index a8c46ba5878f..26860c2e05a9 100644 --- a/drivers/power/reset/Kconfig +++ b/drivers/power/reset/Kconfig @@ -141,6 +141,13 @@ config POWER_RESET_OCELOT_RESET help This driver supports restart for Microsemi Ocelot SoC and similar. +config POWER_RESET_ODROID_GO_ULTRA_POWEROFF + bool "Odroid Go Ultra power-off driver" + depends on ARCH_MESON || COMPILE_TEST + depends on MFD_RK808 + help + This driver supports Power off for Odroid Go Ultra device. + config POWER_RESET_OXNAS bool "OXNAS SoC restart driver" depends on ARCH_OXNAS diff --git a/drivers/power/reset/Makefile b/drivers/power/reset/Makefile index 0a39424fc558..d763e6735ee3 100644 --- a/drivers/power/reset/Makefile +++ b/drivers/power/reset/Makefile @@ -17,6 +17,7 @@ obj-$(CONFIG_POWER_RESET_MT6323) += mt6323-poweroff.o obj-$(CONFIG_POWER_RESET_OXNAS) += oxnas-restart.o obj-$(CONFIG_POWER_RESET_QCOM_PON) += qcom-pon.o obj-$(CONFIG_POWER_RESET_OCELOT_RESET) += ocelot-reset.o +obj-$(CONFIG_POWER_RESET_ODROID_GO_ULTRA_POWEROFF) += odroid-go-ultra-poweroff.o obj-$(CONFIG_POWER_RESET_PIIX4_POWEROFF) += piix4-poweroff.o obj-$(CONFIG_POWER_RESET_LTC2952) += ltc2952-poweroff.o obj-$(CONFIG_POWER_RESET_QNAP) += qnap-poweroff.o diff --git a/drivers/power/reset/odroid-go-ultra-poweroff.c b/drivers/power/reset/odroid-go-ultra-poweroff.c new file mode 100644 index 000000000000..89ae21790f65 --- /dev/null +++ b/drivers/power/reset/odroid-go-ultra-poweroff.c @@ -0,0 +1,122 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (c) 2022 Neil Armstrong + */ +#include +#include +#include +#include +#include +#include +#include +#include + +static struct rk808 *rk817; +static struct rk808 *rk818; + +static void odroid_go_ultra_do_poweroff(void) +{ + int ret; + + BUG_ON(!rk817); + BUG_ON(!rk818); + + /* RK817 */ + ret = regmap_update_bits(rk817->regmap, RK817_SYS_CFG(3), DEV_OFF, DEV_OFF); + if (ret) + pr_err("%s: failed to poweroff rk817\n", __func__); + + /* RK818 */ + ret = regmap_update_bits(rk818->regmap, RK818_DEVCTRL_REG, DEV_OFF, DEV_OFF); + if (ret) + pr_err("%s: failed to poweroff rk817\n", __func__); + + WARN_ON(1); +} + +static int odroid_go_ultra_poweroff_get_pmic_drvdata(struct platform_device *pdev, + const char *property, + struct rk808 **pmic) +{ + struct device_node *pmic_node; + struct i2c_client *pmic_client; + + pmic_node = of_parse_phandle(pdev->dev.of_node, property, 0); + if (!pmic_node) + return -ENODEV; + + pmic_client = of_find_i2c_device_by_node(pmic_node); + of_node_put(pmic_node); + if (!pmic_client) + return -EPROBE_DEFER; + + *pmic = i2c_get_clientdata(pmic_client); + + put_device(&pmic_client->dev); + + if (!*pmic) + return -EPROBE_DEFER; + + return 0; +} + +static int odroid_go_ultra_poweroff_probe(struct platform_device *pdev) +{ + int ret; + + /* RK818 */ + ret = odroid_go_ultra_poweroff_get_pmic_drvdata(pdev, "hardkernel,rk818-pmic", &rk818); + if (ret) { + dev_err(&pdev->dev, "failed to get rk818 mfd data (%d)\n", ret); + return ret; + } + + /* RK817 */ + ret = odroid_go_ultra_poweroff_get_pmic_drvdata(pdev, "hardkernel,rk817-pmic", &rk817); + if (ret) { + dev_err(&pdev->dev, "failed to get rk817 mfd data (%d)\n", ret); + return ret; + } + + /* If a pm_power_off function has already been added, warn we're overriding */ + if (pm_power_off != NULL) + dev_warn(&pdev->dev, + "%s: pm_power_off function already registered, overriding\n", + __func__); + + pm_power_off = odroid_go_ultra_do_poweroff; + + return 0; +} + +static int odroid_go_ultra_poweroff_remove(struct platform_device *pdev) +{ + if (pm_power_off == &odroid_go_ultra_do_poweroff) + pm_power_off = NULL; + + rk817 = NULL; + rk818 = NULL; + + return 0; +} + +static const struct of_device_id of_odroid_go_ultra_poweroff_match[] = { + { .compatible = "hardkernel,odroid-go-ultra-poweroff", }, + {}, +}; +MODULE_DEVICE_TABLE(of, of_odroid_go_ultra_poweroff_match); + +static struct platform_driver odroid_go_ultra_poweroff_driver = { + .probe = odroid_go_ultra_poweroff_probe, + .remove = odroid_go_ultra_poweroff_remove, + .driver = { + .name = "odroid-go-ultra-poweroff", + .of_match_table = of_odroid_go_ultra_poweroff_match, + }, +}; + +module_platform_driver(odroid_go_ultra_poweroff_driver); + +MODULE_AUTHOR("Neil Armstrong "); +MODULE_DESCRIPTION("Odroid Go Ultra poweroff driver"); +MODULE_LICENSE("GPL"); From patchwork Mon Oct 31 16:47:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 13026126 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 63EFFECAAA1 for ; Mon, 31 Oct 2022 16:48:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bs1enNYR/eJJUisUwiW+YUtQpUrCwNol5VzE9AdLulo=; b=EGj2X3FF0BlVa1 OoDTGL8n4kVUILAEUgpBzZeLRIl71slIM7hWw54ypZY0M4w5cNnSl8bSe3KPlKaV3NVqNlhxD/OZM ZJtb+uyDVcHMFf9GPSHh4J02i7s4rka3RF19/cw1rAOYZnZ3CiWcJRA9gnfklRd9LhJcWLHUGqNjj sApBk9EA+UYzY8sWJRvc/vGBP/O40KBwQSBLFCH9eYch17Me1fTFxlc6f45Iw3VVy1nNT1H083AH1 9xbiCBSW9Zyg1DunOcHncUsUK2+qRtxpyj4UsYfzEv1jg2K6V4szWvP+IjFQW24UR/E8yUFw0WHU1 Ug25b6+C8bgGSfuuZaLA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1opXxE-00D5fi-0U; Mon, 31 Oct 2022 16:48:04 +0000 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1opXwi-00D5TQ-4P for linux-amlogic@lists.infradead.org; Mon, 31 Oct 2022 16:47:34 +0000 Received: by mail-wr1-x436.google.com with SMTP id y16so16778423wrt.12 for ; Mon, 31 Oct 2022 09:47:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=xKTqAkxJgMWx6sBMNSE6aZbt6frvVDq8u09kfz+kAfA=; b=XRcmdZ4LO0owByPD5STPLCr2UYHDXmzbX7K1uLrLp0SOM6/QXVwHX3X/2izgX3DHeH 3a2gczFLc9gHwDbBwP0MIcHXlUV3cfdvLKA9fvVBskFtLJ7is1P2OXUnb6A6mJpEUggS wwQ2XyG/maewHSkOjIZf6kvSFpAmaqpe1pJ4lM0I7bm67V7sPrSDC1ZWc71YEjcL2Eom YLg2hj89uMii3gfsoP1q7wpIJNDsktqDsrj+3G60XoWQH7u5Zd1a6mkr1yK3Vb9kj0UN 0KTuqzbDJkpIbsOM53u0t2oN+9xPygxvlJzEGfDNrKoBYJvr/XFbUf0P8v+PiKSUG+wR ZY0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xKTqAkxJgMWx6sBMNSE6aZbt6frvVDq8u09kfz+kAfA=; b=4ur1uyl+65e3rD9D89cFhSyuNJv7AtdUnGTeuRYa6iWmgfBvSRbdU2RgfLygAHL0u2 30ucmKodKM26TbuJ8wEOw3KAje3zLk6zKZURCAvJa0n4Kp7b2PkQ9FC7BDkiZbw1p0kZ tLJq6E1pSwOgB/GIz/UqcVx/qi+sjG4j/Gf/RPgx0qzUQoiRLnvy+4uRg3Ztjy6EX1+F /LT87PJQPELyWLiAc0GsmoBlPnlxztWyorHobjmwWnDAO1/PhFCWLG3m9ao0oV0OLTb7 vDjmUsONBFeelILuDVJvJUWrdn1/h6xRIRGFxnIuOPIY3tE2feM2hQ3fsnGIb38klILQ oQTg== X-Gm-Message-State: ACrzQf2DRlzDD58j8sC+h0BCW9MhuFAOWfApIaEhzZa7owjLRwFolhcu CqkZyAeC4OL3/AStzT7nIdV4RQ== X-Google-Smtp-Source: AMsMyM4jP4ham9rkHQIKGWu7iRmlbMIYmA2Dcqhqsr+EJ555arOEBiRDyVkQMUQq9czGPTPFVQelzA== X-Received: by 2002:a5d:4b90:0:b0:236:702f:2093 with SMTP id b16-20020a5d4b90000000b00236702f2093mr9210941wrt.577.1667234850953; Mon, 31 Oct 2022 09:47:30 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id q8-20020a05600c46c800b003b4868eb71bsm7488871wmo.25.2022.10.31.09.47.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Oct 2022 09:47:30 -0700 (PDT) From: Neil Armstrong Date: Mon, 31 Oct 2022 17:47:27 +0100 Subject: [PATCH 3/4] dt-bindings: amlogic: document Odroid Go Ultra compatible MIME-Version: 1.0 Message-Id: <20221031-b4-odroid-go-ultra-initial-v1-3-42e3dbea86d5@linaro.org> References: <20221031-b4-odroid-go-ultra-initial-v1-0-42e3dbea86d5@linaro.org> In-Reply-To: <20221031-b4-odroid-go-ultra-initial-v1-0-42e3dbea86d5@linaro.org> To: Martin Blumenstingl , Krzysztof Kozlowski , Rob Herring , Kevin Hilman , Sebastian Reichel , Jerome Brunet Cc: linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.10.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221031_094732_229149_6E114652 X-CRM114-Status: UNSURE ( 7.28 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org This documents the Odroid Go Ultra, a portable gaming device, with the following characteristics: - Amlogic S922X SoC - RK817 & RK818 PMICs - 2GiB LPDDR4 - On board 16GiB eMMC - Micro SD Card slot - 5inch 854×480 MIPI-DSI TFT LCD - Earphone stereo jack, 0.5Watt 8Ω Mono speaker - Li-Polymer 3.7V/4000mAh Battery - USB-A 2.0 Host Connector - x16 GPIO Input Buttons - 2x ADC Analog Joysticks - USB-C Port for USB2 Device and Charging Signed-off-by: Neil Armstrong Reviewed-by: Martin Blumenstingl Acked-by: Rob Herring --- Documentation/devicetree/bindings/arm/amlogic.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/arm/amlogic.yaml b/Documentation/devicetree/bindings/arm/amlogic.yaml index 9fda2436c618..e16b5fa55847 100644 --- a/Documentation/devicetree/bindings/arm/amlogic.yaml +++ b/Documentation/devicetree/bindings/arm/amlogic.yaml @@ -163,6 +163,7 @@ properties: - azw,gsking-x - azw,gtking - azw,gtking-pro + - hardkernel,odroid-go-ultra - hardkernel,odroid-n2 - hardkernel,odroid-n2-plus - khadas,vim3 From patchwork Mon Oct 31 16:47:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 13026127 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 78411ECAAA1 for ; Mon, 31 Oct 2022 16:48:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MdrC9ymRjEHJqbSW75RR6eIjQzcFPQw0mFJD2PZBC1s=; b=qrFV3g6Pggohm4 /3uedbKjOun+9QoDnG7igSTPEbw2WgjG3Dtu7AlmoWswrJQDfXguXLEfgXi8hQwbqCZAdpZz+0x9C o+huMdYYNbbMpT2Wp/SUbl465P6nThLfWknZ+XGeoaPTcO/QAS64kGLxLVknrpSp1bVkGn3+zFUIB fWeWrK/rIe++OGjX536MB0H1BRYuM6cuKEWuuAx1omChkTQCvCO/3a371vvrDNn4GMUjRaqgyCbkk kFwG43FoYFoOxcOvaXCbkEykGeZ6fXj7D8kNnPyB/mW9amcFyCQtWIQ7HCwUejMYoqMqS/6W9NHaq GuXqDkqe1QSJSlkfJ2Ng==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1opXxg-00D5sv-1Z; Mon, 31 Oct 2022 16:48:32 +0000 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1opXwk-00D5US-5C for linux-amlogic@lists.infradead.org; Mon, 31 Oct 2022 16:47:37 +0000 Received: by mail-wr1-x42c.google.com with SMTP id k8so16842151wrh.1 for ; Mon, 31 Oct 2022 09:47:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=vqtJ0U0dQHjak7CeAguxz3E+6JTNx3+rjvuNDtKIyWI=; b=hbo0X9UAYygih2LBF0g43pPCBDE/SOsn2aL2y6YhVQ0ifMlAVcKO/FA0kCiIGicPY0 vfdXsnfq4OywaFGkU3YJD1dMdv9OXmEi5kbD1H1DMkWQQeqaRT22DKUitwI/xMGGw6o/ bwxfn7jLnVliw8D9GFhY0aoyuHsBYe1ebq7bmDPxLBJOLRJzjsUBkCYb7Dat/peGtBFE jCoW8eC2+rG6g1CIKIlAwDHXNVfne57rkWR+3cVI5AxQSYdu3A1+P9/ELDXitVTCS4EQ DvyjOH/YUA3raxwzLynaCY4Nc9N3z/x63I67B3Jj9qTYZsETd9fw//IYAbAkEJXiFPtp 72dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vqtJ0U0dQHjak7CeAguxz3E+6JTNx3+rjvuNDtKIyWI=; b=5NCFzXfU6Q4/9t2tzHnhoJ920wXwRgzo7WmV7EATZHaDMdBhfEosIA4/vuZRUlSEnd 2Bras+RnVBRTMwlmYBJULkPFCJ3P/EosXS9oO+fv9R512CjWgCe/IkYIOP++2C4khjYm YQ8jXMYtN5iw31j3XWdS+qiQOJeFsMDusXccqBbFm4xiq34qfbCo3bjX4+7miXRp57wX eMDXbUDFx9ADNsvUptuypPYtwP/twQntQlp0xQQwXXNDvnqB9bXp5H14o6BUjUho5N+c o3MtwOEJoz3TOV+PjJ688w7j9lhJaNXqzDBZG/v4i2sTjlrROfaen9Ny4NMIZdr1vzwn n6+A== X-Gm-Message-State: ACrzQf3Dvv6PKsxxf+FNkshJtZI/j4rfmJdCOH8iE1F34/GUGyNmZZdL ybfc7WakRyiCVXtm6Av+dznS+w== X-Google-Smtp-Source: AMsMyM7C9KEJl9MTrolh+YNUrz+y5v0hTKKQM6uz8A+wvOQ7BAPKMNAA7u/PBr2qnc3RWpdgV3B/bg== X-Received: by 2002:a5d:54c2:0:b0:235:897d:38b7 with SMTP id x2-20020a5d54c2000000b00235897d38b7mr8696197wrv.604.1667234851873; Mon, 31 Oct 2022 09:47:31 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id q8-20020a05600c46c800b003b4868eb71bsm7488871wmo.25.2022.10.31.09.47.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Oct 2022 09:47:31 -0700 (PDT) From: Neil Armstrong Date: Mon, 31 Oct 2022 17:47:28 +0100 Subject: [PATCH 4/4] arm64: dts: amlogic: add initial Odroid Go Ultra DTS MIME-Version: 1.0 Message-Id: <20221031-b4-odroid-go-ultra-initial-v1-4-42e3dbea86d5@linaro.org> References: <20221031-b4-odroid-go-ultra-initial-v1-0-42e3dbea86d5@linaro.org> In-Reply-To: <20221031-b4-odroid-go-ultra-initial-v1-0-42e3dbea86d5@linaro.org> To: Martin Blumenstingl , Krzysztof Kozlowski , Rob Herring , Kevin Hilman , Sebastian Reichel , Jerome Brunet Cc: linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.10.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221031_094734_232157_884E2D57 X-CRM114-Status: GOOD ( 12.28 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org This adds initial support for the Hardkernel Odroid Go Ultra. The Odroid Go Ultra is a portable gaming device with the following characteristics: - Amlogic S922X SoC - RK817 & RK818 PMICs - 2GiB LPDDR4 - On board 16GiB eMMC - Micro SD Card slot - 5inch 854×480 MIPI-DSI TFT LCD - Earphone stereo jack, 0.5Watt 8Ω Mono speaker - Li-Polymer 3.7V/4000mAh Battery - USB-A 2.0 Host Connector - x16 GPIO Input Buttons - 2x ADC Analog Joysticks - USB-C Port for USB2 Device and Charging The following are not yet handled: - Battery RK818 Gauge and Charging - Earphone stereo jack detect - 5inch 854×480 MIPI-DSI TFT LCD Signed-off-by: Neil Armstrong --- arch/arm64/boot/dts/amlogic/Makefile | 1 + .../dts/amlogic/meson-g12b-odroid-go-ultra.dts | 730 +++++++++++++++++++++ 2 files changed, 731 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/Makefile b/arch/arm64/boot/dts/amlogic/Makefile index e213aeebb774..97b42e2100e0 100644 --- a/arch/arm64/boot/dts/amlogic/Makefile +++ b/arch/arm64/boot/dts/amlogic/Makefile @@ -12,6 +12,7 @@ dtb-$(CONFIG_ARCH_MESON) += meson-g12b-a311d-khadas-vim3.dtb dtb-$(CONFIG_ARCH_MESON) += meson-g12b-gsking-x.dtb dtb-$(CONFIG_ARCH_MESON) += meson-g12b-gtking-pro.dtb dtb-$(CONFIG_ARCH_MESON) += meson-g12b-gtking.dtb +dtb-$(CONFIG_ARCH_MESON) += meson-g12b-odroid-go-ultra.dtb dtb-$(CONFIG_ARCH_MESON) += meson-g12b-odroid-n2-plus.dtb dtb-$(CONFIG_ARCH_MESON) += meson-g12b-odroid-n2.dtb dtb-$(CONFIG_ARCH_MESON) += meson-g12b-s922x-khadas-vim3.dtb diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts new file mode 100644 index 000000000000..3bda11b37d5e --- /dev/null +++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts @@ -0,0 +1,730 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2022 Neil Armstrong + */ + +/dts-v1/; + +#include "meson-g12b-s922x.dtsi" +#include +#include +#include +#include +#include + +/ { + compatible = "hardkernel,odroid-go-ultra", "amlogic,s922x", "amlogic,g12b"; + model = "Hardkernel ODROID-GO-Ultra"; + + aliases { + serial0 = &uart_AO; + rtc0 = &vrtc; + }; + + adc-joystick-left { + compatible = "adc-joystick"; + io-channels = <&saradc 2>, <&saradc 3>; + poll-interval = <10>; + #address-cells = <1>; + #size-cells = <0>; + + axis@0 { + reg = <0>; + linux,code = ; + abs-range = <3150 950>; + abs-fuzz = <32>; + abs-flat = <64>; + }; + axis@1 { + reg = <1>; + linux,code = ; + abs-range = <700 2900>; + abs-fuzz = <32>; + abs-flat = <64>; + }; + }; + + adc-joystick-right { + compatible = "adc-joystick"; + io-channels = <&saradc 0>, <&saradc 1>; + poll-interval = <10>; + #address-cells = <1>; + #size-cells = <0>; + + axis@0 { + reg = <0>; + linux,code = ; + abs-range = <3150 950>; + abs-fuzz = <32>; + abs-flat = <64>; + }; + axis@1 { + reg = <1>; + linux,code = ; + abs-range = <800 3000>; + abs-fuzz = <32>; + abs-flat = <64>; + }; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + codec_clk: codec-clk { + compatible = "fixed-clock"; + clock-frequency = <12288000>; + clock-output-names = "codec_clk"; + #clock-cells = <0>; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + poll-interval = <10>; + pinctrl-0 = <&keypad_gpio_pins>; + pinctrl-names = "default"; + + volume-up-button { + label = "VOLUME-UP"; + linux,code = ; + gpios = <&gpio GPIOX_8 GPIO_ACTIVE_LOW>; + }; + volume-down-button { + label = "VOLUME-DOWN"; + linux,code = ; + gpios = <&gpio GPIOX_9 GPIO_ACTIVE_LOW>; + }; + dpad-up-button { + label = "DPAD-UP"; + linux,code = ; + gpios = <&gpio GPIOX_0 GPIO_ACTIVE_LOW>; + }; + dpad-down-button { + label = "DPAD-DOWN"; + linux,code = ; + gpios = <&gpio GPIOX_1 GPIO_ACTIVE_LOW>; + }; + dpad-left-button { + label = "DPAD-LEFT"; + linux,code = ; + gpios = <&gpio GPIOX_2 GPIO_ACTIVE_LOW>; + }; + dpad-right-button { + label = "DPAD-RIGHT"; + linux,code = ; + gpios = <&gpio GPIOX_3 GPIO_ACTIVE_LOW>; + }; + a-button { + label = "A"; + linux,code = ; + gpios = <&gpio GPIOX_4 GPIO_ACTIVE_LOW>; + }; + b-button { + label = "B"; + linux,code = ; + gpios = <&gpio GPIOX_5 GPIO_ACTIVE_LOW>; + }; + y-button { + label = "Y"; + linux,code = ; + gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>; + }; + x-button { + label = "X"; + linux,code = ; + gpios = <&gpio GPIOX_7 GPIO_ACTIVE_LOW>; + }; + f1-button { + label = "F1"; + linux,code = ; + gpios = <&gpio GPIOX_17 GPIO_ACTIVE_LOW>; + }; + f2-button { + label = "F2"; + linux,code = ; + gpios = <&gpio GPIOX_10 GPIO_ACTIVE_LOW>; + }; + f3-button { + label = "F3"; + linux,code = ; + gpios = <&gpio GPIOX_11 GPIO_ACTIVE_LOW>; + }; + f4-button { + label = "F4"; + linux,code = ; + gpios = <&gpio GPIOX_12 GPIO_ACTIVE_LOW>; + }; + f5-button { + label = "F5"; + linux,code = ; + gpios = <&gpio GPIOX_13 GPIO_ACTIVE_LOW>; + }; + f6-button { + label = "F6"; + linux,code = ; + gpios = <&gpio GPIOX_16 GPIO_ACTIVE_LOW>; + }; + top-left-button { + label = "TOP Left"; + linux,code = ; + gpios = <&gpio GPIOX_14 GPIO_ACTIVE_LOW>; + }; + top-left2-button { + label = "TOP Left 2"; + linux,code = ; + gpios = <&gpio GPIOX_19 GPIO_ACTIVE_LOW>; + }; + top-right-button { + label = "TOP Right"; + linux,code = ; + gpios = <&gpio GPIOX_15 GPIO_ACTIVE_LOW>; + }; + top-right2-button { + label = "TOP Right 2"; + linux,code = ; + gpios = <&gpio GPIOX_18 GPIO_ACTIVE_LOW>; + }; + }; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x0 0x0 0x40000000>; + }; + + emmc_pwrseq: emmc-pwrseq { + compatible = "mmc-pwrseq-emmc"; + reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>; + }; + + leds { + compatible = "gpio-leds"; + + led-blue { + color = ; + gpios = <&gpio_ao GPIOAO_11 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "heartbeat"; + }; + }; + + poweroff { + compatible = "hardkernel,odroid-go-ultra-poweroff"; + hardkernel,rk817-pmic = <&rk817>; + hardkernel,rk818-pmic = <&rk818>; + }; + + vdd_sys: regulator-vdd_sys { + compatible = "regulator-fixed"; + regulator-name = "VDD_SYS"; + regulator-min-microvolt = <3800000>; + regulator-max-microvolt = <3800000>; + regulator-always-on; + }; + + sound { + compatible = "amlogic,axg-sound-card"; + model = "Odroid GO Ultra"; + audio-widgets = "Microphone", "Mic Jack", + "Headphone", "Headphones", + "Speaker", "Internal Speakers"; + audio-aux-devs = <&tdmout_b>, <&tdmin_b>, <&speaker_amp>; + audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1", + "TDM_B Playback", "TDMOUT_B OUT", + "TDMIN_B IN 1", "TDM_B Capture", + "TDMIN_B IN 4", "TDM_B Loopback", + "TODDR_A IN 1", "TDMIN_B OUT", + "MICL", "Mic Jack", + "Headphones", "HPOL", + "Headphones", "HPOR", + "Speaker Amplifier INL", "HPOL", + "Speaker Amplifier INR", "HPOR", + "Internal Speakers", "Speaker Amplifier OUTL", + "Internal Speakers", "Speaker Amplifier OUTR"; + + assigned-clocks = <&clkc CLKID_MPLL2>, + <&clkc CLKID_MPLL0>, + <&clkc CLKID_MPLL1>; + assigned-clock-parents = <0>, <0>, <0>; + assigned-clock-rates = <294912000>, + <270950400>, + <393216000>; + status = "okay"; + + dai-link-0 { + sound-dai = <&frddr_a>; + }; + + dai-link-1 { + sound-dai = <&toddr_a>; + }; + + dai-link-2 { + sound-dai = <&tdmif_b>; + dai-format = "i2s"; + dai-tdm-slot-tx-mask-0 = <1 1>; + mclk-fs = <256>; + + codec-0 { + sound-dai = <&rk817>; + }; + }; + }; + + speaker_amp: speaker-amplifier { + compatible = "simple-audio-amplifier"; + sound-name-prefix = "Speaker Amplifier"; + VCC-supply = <&hp_5v>; + }; +}; + +&arb { + status = "okay"; +}; + +&cpu0 { + cpu-supply = <&vddcpu_b>; + operating-points-v2 = <&cpu_opp_table_0>; + clocks = <&clkc CLKID_CPU_CLK>; + clock-latency = <50000>; +}; + +&cpu1 { + cpu-supply = <&vddcpu_b>; + operating-points-v2 = <&cpu_opp_table_0>; + clocks = <&clkc CLKID_CPU_CLK>; + clock-latency = <50000>; +}; + +&cpu100 { + cpu-supply = <&vddcpu_a>; + operating-points-v2 = <&cpub_opp_table_1>; + clocks = <&clkc CLKID_CPUB_CLK>; + clock-latency = <50000>; +}; + +&cpu101 { + cpu-supply = <&vddcpu_a>; + operating-points-v2 = <&cpub_opp_table_1>; + clocks = <&clkc CLKID_CPUB_CLK>; + clock-latency = <50000>; +}; + +&cpu102 { + cpu-supply = <&vddcpu_a>; + operating-points-v2 = <&cpub_opp_table_1>; + clocks = <&clkc CLKID_CPUB_CLK>; + clock-latency = <50000>; +}; + +&cpu103 { + cpu-supply = <&vddcpu_a>; + operating-points-v2 = <&cpub_opp_table_1>; + clocks = <&clkc CLKID_CPUB_CLK>; + clock-latency = <50000>; +}; + +/* RK817 only supports 12.5mV steps, round up the values */ +&cpu_opp_table_0 { + opp-1000000000 { + opp-microvolt = <737500>; + }; + opp-1200000000 { + opp-microvolt = <737500>; + }; + opp-1398000000 { + opp-microvolt = <762500>; + }; + opp-1512000000 { + opp-microvolt = <800000>; + }; + opp-1608000000 { + opp-microvolt = <837500>; + }; + opp-1704000000 { + opp-microvolt = <862500>; + }; + opp-1896000000 { + opp-microvolt = <987500>; + }; + opp-1992000000 { + opp-microvolt = <1012500>; + }; +}; + +/* RK818 only supports 12.5mV steps, round up the values */ +&cpub_opp_table_1 { + opp-1000000000 { + opp-microvolt = <775000>; + }; + opp-1200000000 { + opp-microvolt = <775000>; + }; + opp-1398000000 { + opp-microvolt = <800000>; + }; + opp-1512000000 { + opp-microvolt = <825000>; + }; + opp-1608000000 { + opp-microvolt = <862500>; + }; + opp-1704000000 { + opp-microvolt = <900000>; + }; + opp-1800000000 { + opp-microvolt = <987500>; + }; + opp-1908000000 { + opp-microvolt = <1025000>; + }; +}; + +&i2c_AO { + status = "okay"; + pinctrl-0 = <&i2c_ao_sck_pins>, <&i2c_ao_sda_pins>; + pinctrl-names = "default"; + + rk818: pmic@1c { + compatible = "rockchip,rk818"; + reg = <0x1c>; + interrupt-parent = <&gpio_intc>; + interrupts = <7 IRQ_TYPE_LEVEL_LOW>; /* GPIOAO_7 */ + + vcc1-supply = <&vdd_sys>; + vcc2-supply = <&vdd_sys>; + vcc3-supply = <&vdd_sys>; + vcc4-supply = <&vdd_sys>; + vcc6-supply = <&vdd_sys>; + vcc7-supply = <&vcc_2v3>; + vcc8-supply = <&vcc_2v3>; + vcc9-supply = <&vddao_3v3>; + boost-supply = <&vdd_sys>; + switch-supply = <&vdd_sys>; + + regulators { + vddcpu_a: DCDC_REG1 { + regulator-name = "vddcpu_a"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <775000>; + regulator-max-microvolt = <1025000>; + regulator-ramp-delay = <6001>; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <775000>; + }; + }; + + vdd_ee: DCDC_REG2 { + regulator-name = "vdd_ee"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <875000>; + regulator-max-microvolt = <1250000>; + regulator-ramp-delay = <6001>; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <875000>; + }; + }; + + vddq_1v1: DCDC_REG3 { + regulator-name = "vddq_1v1"; + regulator-always-on; + regulator-boot-on; + regulator-state-mem { + regulator-on-in-suspend; + }; + }; + + vddao_3v3: DCDC_REG4 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vddao_3v3"; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <3300000>; + }; + }; + + hp_5v: DCDC_BOOST { + regulator-always-on; + regulator-boot-on; + regulator-name = "hp_5v"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vddio_ao1v8: LDO_REG5 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-name = "vddio_ao1v8"; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <1800000>; + }; + }; + + vddq_1v8: LDO_REG7 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-name = "vddq_1v8"; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <1800000>; + }; + }; + + vddio_c: LDO_REG9 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vddio_c"; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <3300000>; + }; + }; + + vcc_sd: SWITCH_REG { + regulator-name = "vcc_sd"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-state-mem { + regulator-on-in-suspend; + }; + }; + + OTG_SWITCH { + regulator-name = "otg_switch"; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + }; + }; +}; + +&i2c3 { + status = "okay"; + pinctrl-0 = <&i2c3_sda_a_pins>, <&i2c3_sck_a_pins>; + pinctrl-names = "default"; + + rk817: pmic@20 { + compatible = "rockchip,rk817"; + reg = <0x20>; + status = "okay"; + interrupt-parent = <&gpio_intc>; + + interrupts = <5 IRQ_TYPE_LEVEL_LOW>; /* GPIOAO_5 */ + + vcc1-supply = <&vdd_sys>; + vcc2-supply = <&vdd_sys>; + vcc3-supply = <&vdd_sys>; + vcc4-supply = <&vdd_sys>; + vcc5-supply = <&vdd_sys>; + vcc6-supply = <&vdd_sys>; + vcc7-supply = <&vdd_sys>; + vcc8-supply = <&vdd_sys>; + vcc9-supply = <&rk817_boost>; + + #sound-dai-cells = <0>; + clocks = <&codec_clk>; + clock-names = "mclk"; + + #clock-cells = <1>; + + regulators { + vddcpu_b: DCDC_REG2 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <737500>; + regulator-max-microvolt = <1012500>; + regulator-ramp-delay = <6001>; + regulator-initial-mode = <0x2>; + regulator-name = "vddcpu_b"; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <1000000>; + }; + }; + + vcc_2v3: DCDC_REG3 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <2300000>; + regulator-max-microvolt = <2400000>; + regulator-initial-mode = <0x2>; + regulator-name = "vcc_2v3"; + regulator-state-mem { + regulator-on-in-suspend; + }; + }; + + LDO_REG4 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vdd_codec"; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc_lcd: LDO_REG8 { + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc_lcd"; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + rk817_boost: BOOST { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5400000>; + regulator-name = "rk817_boost"; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + usb_host: OTG_SWITCH { + regulator-name = "usb_host"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + }; + }; +}; + +&clkc_audio { + status = "okay"; +}; + +ð_phy { + status = "disabled"; +}; + +&frddr_a { + status = "okay"; +}; + +&periphs_pinctrl { + keypad_gpio_pins: keypad-gpio { + mux { + groups = "GPIOX_0", "GPIOX_1", "GPIOX_2", "GPIOX_3", + "GPIOX_4", "GPIOX_5", "GPIOX_6", "GPIOX_7", + "GPIOX_8", "GPIOX_9", "GPIOX_10", "GPIOX_11", + "GPIOX_12", "GPIOX_13", "GPIOX_14", "GPIOX_15", + "GPIOX_16", "GPIOX_17", "GPIOX_18", "GPIOX_19"; + function = "gpio_periphs"; + bias-pull-up; + output-disable; + }; + }; +}; + +&saradc { + status = "okay"; + vref-supply = <&vddio_ao1v8>; +}; + +/* SD card */ +&sd_emmc_b { + status = "okay"; + pinctrl-0 = <&sdcard_c_pins>; + pinctrl-1 = <&sdcard_clk_gate_c_pins>; + pinctrl-names = "default", "clk-gate"; + + bus-width = <4>; + cap-sd-highspeed; + max-frequency = <50000000>; + disable-wp; + + cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>; + vmmc-supply = <&vcc_sd>; + vqmmc-supply = <&vddio_c>; + +}; + +/* eMMC */ +&sd_emmc_c { + status = "okay"; + pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_8b_pins>, <&emmc_ds_pins>; + pinctrl-1 = <&emmc_clk_gate_pins>; + pinctrl-names = "default", "clk-gate"; + + bus-width = <8>; + cap-mmc-highspeed; + mmc-ddr-1_8v; + mmc-hs200-1_8v; + max-frequency = <200000000>; + disable-wp; + + mmc-pwrseq = <&emmc_pwrseq>; + vmmc-supply = <&vcc_sd>; + vqmmc-supply = <&vddio_ao1v8>; +}; + + +&tdmif_b { + pinctrl-0 = <&tdm_b_dout0_pins>, <&tdm_b_fs_pins>, <&tdm_b_sclk_pins>, <&tdm_b_din1_pins>; + pinctrl-names = "default"; + status = "okay"; + + assigned-clocks = <&clkc_audio AUD_CLKID_TDM_SCLK_PAD1>, + <&clkc_audio AUD_CLKID_TDM_LRCLK_PAD1>; + assigned-clock-parents = <&clkc_audio AUD_CLKID_MST_B_SCLK>, + <&clkc_audio AUD_CLKID_MST_B_LRCLK>; + assigned-clock-rates = <0>, <0>; +}; + +&tdmin_b { + status = "okay"; +}; + +&tdmout_b { + status = "okay"; +}; + +&toddr_a { + status = "okay"; +}; + +&uart_AO { + status = "okay"; + pinctrl-0 = <&uart_ao_a_pins>; + pinctrl-names = "default"; +}; + +&usb { + status = "okay"; + dr_mode = "peripheral"; +}; + +&usb2_phy0 { + status = "okay"; +}; + +&usb2_phy1 { + status = "okay"; + phy-supply = <&usb_host>; +};