From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2a00:1450:4864:20::142; helo=mail-lf1-x142.google.com; envelope-from=mw@semihalf.com; receiver=edk2-devel@lists.01.org Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) (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 1B77321168223 for ; Fri, 12 Oct 2018 01:33:13 -0700 (PDT) Received: by mail-lf1-x142.google.com with SMTP id d4-v6so8743055lfa.3 for ; Fri, 12 Oct 2018 01:33:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=6Zg5y2u3uctd7qeiwsprRuZbXoDjXSsD/o4csasFJF4=; b=bP1GKUdZKNZBVDBHA4l2gBueH5x4RclNTIgWg+CLAkFpQoHnvWglyj2i1443Nmz7yY bvwnFh7jvrVFEDV63A2/hMY7zRtIm41fEPyX+BlRTNvSFwPmYBmhKGXQEKAtqlser34Z WhribACuowwsD2Gj8aM8k62Un4SMV6+AlXGNfL8nn2LzBEsyYvPfVwXBLh/pKRjPhptu quftxGG/q4k/p9lQ4f1zFaNIt3qYu2ic0kYsEXT4yz2gMzgd5oWxu1DYEdyfo9j9FOvV 6Z0IcN9UpVPLtL6cPvdnp8gcTfeK2tZhxVonJay9GvE2zjvkJgDAlEnip1Jzagn0FEgb racA== 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; bh=6Zg5y2u3uctd7qeiwsprRuZbXoDjXSsD/o4csasFJF4=; b=dnhSVZEkSknh4cLHaKrrVp0jdnNm5Ir3x6en/J1xTidxmrGaYwt2Kethziq4cbTw/s IkisD3DwzTulKEa/5VdteGScv3uNfEs5u3HoXyqU7ZlPsy80c74aVWLYppYdTTyvqZdw Aa1kNROLk/AHYL5UmB2KMvxyXvU6WqqVNfVmQw3JDiTp8lUAEK1tmczpMKRmpMM94/rt U0u+yXumizZmV/Yo8lghQ/4gFelc/6LapwVAbtNhxbkFQmzlfHJhXEJlSREkytzhHUOo XI9pbJeVrztvn6BgLY9Ue5Xi2kM30FH083tkBd00nUSlwecG6xQcfKiCzuZFLSsl2NEY 450Q== X-Gm-Message-State: ABuFfojw97EPDpSx2svKsiJBBtEiSBQp6JdW3bDN8tyjsPCDGLd5Vuax vYu2BkfY42zPoVhPwuPxmP0uBT5UVQo= X-Google-Smtp-Source: ACcGV61VGh5SoDqE1YoXToROpXwM5o3G17/hOuI6nz+2v8Wl8beAvqh1xjGcHh193RExK/K0oPufEA== X-Received: by 2002:a19:4bc7:: with SMTP id y190-v6mr3224941lfa.144.1539333190422; Fri, 12 Oct 2018 01:33:10 -0700 (PDT) Received: from gilgamesh.semihalf.com (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id w202-v6sm107027lff.71.2018.10.12.01.33.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Oct 2018 01:33:09 -0700 (PDT) From: Marcin Wojtas To: edk2-devel@lists.01.org Cc: leif.lindholm@linaro.org, ard.biesheuvel@linaro.org, steve.capper@linaro.org, nadavh@marvell.com, mw@semihalf.com, jsd@semihalf.com, jaz@semihalf.com Date: Fri, 12 Oct 2018 10:32:16 +0200 Message-Id: <1539333136-28509-1-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 2.7.4 Subject: [platforms: PATCH 1/1] Marvell/Armada7k8k: DeviceTree: Use fixed clocks 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: Fri, 12 Oct 2018 08:33:13 -0000 This patch enables relying on clocks configured by firmware. Configure the device tree in a way, that all consumers use a fixed-clock tree instead of the real cp110-system-controller driver. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marcin Wojtas --- Silicon/Marvell/Armada7k8k/DeviceTree/armada-cp110.dtsi | 142 ++++++++++++++------ 1 file changed, 99 insertions(+), 43 deletions(-) diff --git a/Silicon/Marvell/Armada7k8k/DeviceTree/armada-cp110.dtsi b/Silicon/Marvell/Armada7k8k/DeviceTree/armada-cp110.dtsi index 3337034..5e8e524 100644 --- a/Silicon/Marvell/Armada7k8k/DeviceTree/armada-cp110.dtsi +++ b/Silicon/Marvell/Armada7k8k/DeviceTree/armada-cp110.dtsi @@ -40,9 +40,9 @@ CP110_LABEL(ethernet): ethernet@0 { compatible = "marvell,armada-7k-pp22"; reg = <0x0 0x100000>, <0x129000 0xb000>; - clocks = <&CP110_LABEL(clk) 1 3>, <&CP110_LABEL(clk) 1 9>, - <&CP110_LABEL(clk) 1 5>, <&CP110_LABEL(clk) 1 6>, - <&CP110_LABEL(clk) 1 18>; + clocks = <&CP110_LABEL(ppv2_clk)>, <&CP110_LABEL(ppv2_clk)>, + <&CP110_LABEL(ppv2_clk)>, <&CP110_LABEL(core_clk)>, + <&CP110_LABEL(core_clk)>; clock-names = "pp_clk", "gop_clk", "mg_clk", "mg_core_clk", "axi_clk"; marvell,system-controller = <&CP110_LABEL(syscon0)>; @@ -135,8 +135,8 @@ #size-cells = <0>; compatible = "marvell,orion-mdio"; reg = <0x12a200 0x10>; - clocks = <&CP110_LABEL(clk) 1 9>, <&CP110_LABEL(clk) 1 5>, - <&CP110_LABEL(clk) 1 6>, <&CP110_LABEL(clk) 1 18>; + clocks = <&CP110_LABEL(ppv2_clk)>, <&CP110_LABEL(ppv2_clk)>, + <&CP110_LABEL(core_clk)>, <&CP110_LABEL(core_clk)>; status = "disabled"; }; @@ -145,8 +145,8 @@ #size-cells = <0>; compatible = "marvell,xmdio"; reg = <0x12a600 0x10>; - clocks = <&CP110_LABEL(clk) 1 5>, - <&CP110_LABEL(clk) 1 6>, <&CP110_LABEL(clk) 1 18>; + clocks = <&CP110_LABEL(ppv2_clk)>, <&CP110_LABEL(ppv2_clk)>, + <&CP110_LABEL(core_clk)>; status = "disabled"; }; @@ -178,6 +178,7 @@ CP110_LABEL(clk): clock { compatible = "marvell,cp110-clock"; + status = "disabled"; #clock-cells = <2>; }; @@ -219,8 +220,8 @@ dma-coherent; interrupts = ; clock-names = "core", "reg"; - clocks = <&CP110_LABEL(clk) 1 22>, - <&CP110_LABEL(clk) 1 16>; + clocks = <&CP110_LABEL(core_clk)>, + <&CP110_LABEL(core_clk)>; status = "disabled"; }; @@ -231,8 +232,8 @@ dma-coherent; interrupts = ; clock-names = "core", "reg"; - clocks = <&CP110_LABEL(clk) 1 23>, - <&CP110_LABEL(clk) 1 16>; + clocks = <&CP110_LABEL(core_clk)>, + <&CP110_LABEL(core_clk)>; status = "disabled"; }; @@ -242,8 +243,8 @@ reg = <0x540000 0x30000>; dma-coherent; interrupts = ; - clocks = <&CP110_LABEL(clk) 1 15>, - <&CP110_LABEL(clk) 1 16>; + clocks = <&CP110_LABEL(core_clk)>, + <&CP110_LABEL(core_clk)>; status = "disabled"; }; @@ -253,8 +254,8 @@ dma-coherent; msi-parent = <&gic_v2m0>; clock-names = "core", "reg"; - clocks = <&CP110_LABEL(clk) 1 8>, - <&CP110_LABEL(clk) 1 14>; + clocks = <&CP110_LABEL(core_clk)>, + <&CP110_LABEL(x2core_clk)>; }; CP110_LABEL(xor1): xor@6c0000 { @@ -263,8 +264,8 @@ dma-coherent; msi-parent = <&gic_v2m0>; clock-names = "core", "reg"; - clocks = <&CP110_LABEL(clk) 1 7>, - <&CP110_LABEL(clk) 1 14>; + clocks = <&CP110_LABEL(core_clk)>, + <&CP110_LABEL(x2core_clk)>; }; CP110_LABEL(spi0): spi@700600 { @@ -273,8 +274,8 @@ #address-cells = <0x1>; #size-cells = <0x0>; clock-names = "core", "axi"; - clocks = <&CP110_LABEL(clk) 1 21>, - <&CP110_LABEL(clk) 1 17>; + clocks = <&CP110_LABEL(slow_io_clk)>, + <&CP110_LABEL(x2core_clk)>; status = "disabled"; }; @@ -284,8 +285,8 @@ #address-cells = <1>; #size-cells = <0>; clock-names = "core", "axi"; - clocks = <&CP110_LABEL(clk) 1 21>, - <&CP110_LABEL(clk) 1 17>; + clocks = <&CP110_LABEL(slow_io_clk)>, + <&CP110_LABEL(x2core_clk)>; status = "disabled"; }; @@ -296,8 +297,8 @@ #size-cells = <0>; interrupts = ; clock-names = "core", "reg"; - clocks = <&CP110_LABEL(clk) 1 21>, - <&CP110_LABEL(clk) 1 17>; + clocks = <&CP110_LABEL(slow_io_clk)>, + <&CP110_LABEL(x2core_clk)>; status = "disabled"; }; @@ -308,8 +309,8 @@ #size-cells = <0>; interrupts = ; clock-names = "core", "reg"; - clocks = <&CP110_LABEL(clk) 1 21>, - <&CP110_LABEL(clk) 1 17>; + clocks = <&CP110_LABEL(slow_io_clk)>, + <&CP110_LABEL(x2core_clk)>; status = "disabled"; }; @@ -320,8 +321,8 @@ interrupts = ; reg-io-width = <1>; clock-names = "baudclk", "apb_pclk"; - clocks = <&CP110_LABEL(clk) 1 21>, - <&CP110_LABEL(clk) 1 17>; + clocks = <&CP110_LABEL(slow_io_clk)>, + <&CP110_LABEL(x2core_clk)>; status = "disabled"; }; @@ -332,8 +333,8 @@ interrupts = ; reg-io-width = <1>; clock-names = "baudclk", "apb_pclk"; - clocks = <&CP110_LABEL(clk) 1 21>, - <&CP110_LABEL(clk) 1 17>; + clocks = <&CP110_LABEL(slow_io_clk)>, + <&CP110_LABEL(x2core_clk)>; status = "disabled"; }; @@ -344,8 +345,8 @@ interrupts = ; reg-io-width = <1>; clock-names = "baudclk", "apb_pclk"; - clocks = <&CP110_LABEL(clk) 1 21>, - <&CP110_LABEL(clk) 1 17>; + clocks = <&CP110_LABEL(slow_io_clk)>, + <&CP110_LABEL(x2core_clk)>; status = "disabled"; }; @@ -356,8 +357,8 @@ interrupts = ; reg-io-width = <1>; clock-names = "baudclk", "apb_pclk"; - clocks = <&CP110_LABEL(clk) 1 21>, - <&CP110_LABEL(clk) 1 17>; + clocks = <&CP110_LABEL(slow_io_clk)>, + <&CP110_LABEL(x2core_clk)>; status = "disabled"; }; @@ -374,8 +375,8 @@ #size-cells = <0>; interrupts = ; clock-names = "core", "reg"; - clocks = <&CP110_LABEL(clk) 1 2>, - <&CP110_LABEL(clk) 1 17>; + clocks = <&CP110_LABEL(nand_clk)>, + <&CP110_LABEL(x2core_clk)>; marvell,system-controller = <&CP110_LABEL(syscon0)>; status = "disabled"; }; @@ -386,8 +387,8 @@ reg = <0x760000 0x7d>; interrupts = ; clock-names = "core", "reg"; - clocks = <&CP110_LABEL(clk) 1 25>, - <&CP110_LABEL(clk) 1 17>; + clocks = <&CP110_LABEL(x2core_clk)>, + <&CP110_LABEL(x2core_clk)>; status = "okay"; }; @@ -396,7 +397,7 @@ reg = <0x780000 0x300>; interrupts = ; clock-names = "core", "axi"; - clocks = <&CP110_LABEL(clk) 1 4>, <&CP110_LABEL(clk) 1 18>; + clocks = <&CP110_LABEL(sdio_clk)>, <&CP110_LABEL(core_clk)>; dma-coherent; status = "disabled"; }; @@ -413,8 +414,8 @@ interrupt-names = "mem", "ring0", "ring1", "ring2", "ring3", "eip"; clock-names = "core", "reg"; - clocks = <&CP110_LABEL(clk) 1 26>, - <&CP110_LABEL(clk) 1 17>; + clocks = <&CP110_LABEL(x2core_clk)>, + <&CP110_LABEL(x2core_clk)>; dma-coherent; }; }; @@ -442,7 +443,7 @@ interrupts = ; num-lanes = <1>; clock-names = "core", "reg"; - clocks = <&CP110_LABEL(clk) 1 13>, <&CP110_LABEL(clk) 1 14>; + clocks = <&CP110_LABEL(core_clk)>, <&CP110_LABEL(x2core_clk)>; status = "disabled"; }; @@ -470,7 +471,7 @@ num-lanes = <1>; clock-names = "core", "reg"; - clocks = <&CP110_LABEL(clk) 1 11>, <&CP110_LABEL(clk) 1 14>; + clocks = <&CP110_LABEL(core_clk)>, <&CP110_LABEL(x2core_clk)>; status = "disabled"; }; @@ -498,7 +499,62 @@ num-lanes = <1>; clock-names = "core", "reg"; - clocks = <&CP110_LABEL(clk) 1 12>, <&CP110_LABEL(clk) 1 14>; + clocks = <&CP110_LABEL(core_clk)>, <&CP110_LABEL(x2core_clk)>; status = "disabled"; }; + + /* 1 GHz fixed main PLL */ + CP110_LABEL(mainpll): CP110_LABEL(mainpll) { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <1000000000>; + }; + + CP110_LABEL(x2core_clk): CP110_LABEL(x2core_clk) { + compatible = "fixed-factor-clock"; + clocks = <&CP110_LABEL(mainpll)>; + #clock-cells = <0>; + clock-mult = <1>; + clock-div = <2>; + }; + + CP110_LABEL(core_clk): CP110_LABEL(core_clk) { + compatible = "fixed-factor-clock"; + clocks = <&CP110_LABEL(mainpll)>; + #clock-cells = <0>; + clock-mult = <1>; + clock-div = <2>; + }; + + CP110_LABEL(sdio_clk): CP110_LABEL(sdio_clk) { + compatible = "fixed-factor-clock"; + clocks = <&CP110_LABEL(mainpll)>; + #clock-cells = <0>; + clock-mult = <2>; + clock-div = <5>; + }; + + CP110_LABEL(nand_clk): CP110_LABEL(nand_clk) { + compatible = "fixed-factor-clock"; + clocks = <&CP110_LABEL(mainpll)>; + #clock-cells = <0>; + clock-mult = <2>; + clock-div = <5>; + }; + + CP110_LABEL(ppv2_clk): CP110_LABEL(ppv2_clk) { + compatible = "fixed-factor-clock"; + clocks = <&CP110_LABEL(mainpll)>; + #clock-cells = <0>; + clock-mult = <1>; + clock-div = <3>; + }; + + CP110_LABEL(slow_io_clk): CP110_LABEL(slow_io_clk) { + compatible = "fixed-factor-clock"; + clocks = <&CP110_LABEL(mainpll)>; + #clock-cells = <0>; + clock-mult = <1>; + clock-div = <4>; + }; }; -- 2.7.4