[v5,00/26] clk: Add Allwinner CLK, RESET support
| Message ID | 20181231165927.13803-1-jagan@amarulasolutions.com |
|---|---|
| Headers |
Return-Path: <linux-amarula+bncBD7MFH7A7EEBBKEWVHQQKGQE7PDIUVQ@amarulasolutions.com> X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f198.google.com (cartago.priv [10.11.12.1]) by cassiopea.amarulasolutions.com (Postfix) with ESMTPS id 522852E002E for <linux-amarula@patchwork.amarulasolutions.com>; Mon, 31 Dec 2018 18:00:27 +0100 (CET) Received: by mail-pl1-f198.google.com with SMTP id p3sf21972414plk.9 for <linux-amarula@patchwork.amarulasolutions.com>; Mon, 31 Dec 2018 09:00:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1546275625; cv=pass; d=google.com; s=arc-20160816; b=SDf1Jqggv4Fz+6KeKcJbsgU4vyZGNnE/o1pjmuY08OwD8tEjo6ezUDSVtSo3Pne/dn x15fC4hbkign5uP+ypoQ6R1aYN8maoxwk6SIgt8Gq0SkmyMe2b0ImEw4oIoaMsQTC9L8 7HtPyfNE+VAvGj4vpgz+fdFzDRR/2EK0YjJXV8TqnUF2BqFWIvkHxhQxxGMAkGBJghP7 aRALL2fGMOrTYpmLcDTAVtn3S1dyj8cf6bJDxZ1vvmZlkm2VA8SePaWHQEG46TqxTiXP 2wOFI45DXzdb13SCSk8VPFDfyprgdr/LLKcLHJEk00ESW9mWkEHAFWmK/GqVc2tfndOF jFJg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=E842/zVSyXZeoy5l+s/DzfBYplelbNV453IGF09E+og=; b=PZrXPMUnSgtWEG1QThLMydv7HjIYlIgXQ56WUyrcCKxX9gRI8PVmOlEmxxnq4UvzHJ mJN5HMzqGJwtcIoH/4Xp+FRvdNhmg4qI81s/pTfL2XAM2f3VDsXMI/3BEjHT7f9oQG3L kBSru9CYu7MyxRNaAdfiNj1epgVfTdG+RXkDtII1oZH7Ej8XxUC3r6vaYk3yECes0g27 xdnl/GW4mU/iaCyxVftP4YFydNIOveJNgj3iygBH9JFQoQBYn9FBPhkCIp4yljM+fKAo G9igi+KVonKy3Daa77GX4q/189ZHZQ+Uh4GTkRNHn7uvEFEU49CkgJZc6wX2n2Cd6mKH Hv2A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=FPz50mgx; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=E842/zVSyXZeoy5l+s/DzfBYplelbNV453IGF09E+og=; b=iMf5JNvs0O6VVirgho17Sg6bnHBUI+FpRQj4tydFzHTPQ3FrHHJCHg/0F+L/tKGL16 gkTcBgRnE7bPX9f8e729AmJid327iBKXhlae6+uQAvhednrAYgXfnLA1uAyB/gV1UDQ3 pWdv806FW8sw6L2pC9Q/9OZt8vK5pY/i+CUZs= 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:mime-version :content-transfer-encoding:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=E842/zVSyXZeoy5l+s/DzfBYplelbNV453IGF09E+og=; b=juzmEGo5U4vt1e3t2SJxBSHp8LXrdwc3DrO1CwzdEXqvx4EZDXzLtAHyr5q0qElcXA s+fitYl6m1V4wiQLxCr407+8BWFItsJenH9WOSl5gQsYt1zHuiNwkufZU4uZM76jly2Y wfQBxw3I2310G1oaxjY6HYRIbm8XcECmvPPTnGLVPg52rrahRjjFTb47vj9TSK0/Jl0K JJRBSuy8LYdYy9PyqhANwrW6ofiB30xO0224oerK0VVZBRM+pO4Ml0Z3k5vMEg+0jFM7 SuG4Hla7RtKwI9L4RlqdnFaI3+ZE+AnF7b/cXqHXvjgb1gwXBc/L4tMnVjE3XNOPveqJ DyHQ== X-Gm-Message-State: AJcUukfQMuqoIMnctTIEMpN1oCB+QyWGhkWXEl82c+zcVO2pmfCaApOe 88nNIIEdaeeW2RhGQMnR2hKd+xa4 X-Google-Smtp-Source: ALg8bN6gjSLWHKPZIb2eD1tOwv/wQFkfgDRdJpVHeGmNdt40CY8sptmFKm55y+jN5VqkBP82W0V0pQ== X-Received: by 2002:a17:902:aa86:: with SMTP id d6mr14483619plr.21.1546275624076; Mon, 31 Dec 2018 09:00:24 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a62:8909:: with SMTP id v9ls12627456pfd.3.gmail; Mon, 31 Dec 2018 09:00:23 -0800 (PST) X-Received: by 2002:aa7:85d7:: with SMTP id z23mr40085818pfn.205.1546275623636; Mon, 31 Dec 2018 09:00:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546275623; cv=none; d=google.com; s=arc-20160816; b=Nc7D1xCW4KIinMCCzB9cCAkc0rNS1rFsoeq6mvb4q42klkZVexu9TnmgtQKYAp9fMM h116oOthQ63z5rz6RNLD4MHbQifiZkJ9OWudxz/+PlgGcXXmb//SSdAVIxZU9ZIjNu6Z nQl35qXri/Z9rRYzIdO72JVhOqvWyGLO5W7SPbGmcV9oQf+dHF3ZZg0eH8litCWyKwCB TP2229Z+onDY7Y1OhtVEot8S60QDGeO6iJAlwlJ3NkU03Nr0WAfhEtK4P7o9BsEO6l0e SGbDnniSulAKan1SNFg7ujWLPmZyroOM62L+TUoi/7C9tvfGfQ/wUFm6o85SFv/tn7iL CnLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=E842/zVSyXZeoy5l+s/DzfBYplelbNV453IGF09E+og=; b=VhPImPGrM3b1KJG5y4kfCk88lKyQ0oYQsv+4p8jY64wG3uUrcnx6hwZ7U3XNNXIMhl UPDEIg50syjT1aSPBPV5agxPAFa/8N7llWqb/ZIEoETuD97d5EfH2ur1vafAhnfEWdvP /8jW5AThRQKB1E5DUi9zm/k6tnSPGO9TXcOMI+Broqao+HX4BrnC3diZbRjPTtB7JaGv IPAVo2IxwwBxkRuo5xmZhvI8ZHKsLFxM7pYVezXH2rApKIKzd+DlWtC1i9f3hJSH5ACU NpcAKdQtB/L9OmiL3q8wHb30TnRkxsSwiYbtfxoH13Q4MPIvrc0jmBhNgFSDadYGokh1 AYqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=FPz50mgx; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id m5sor13514439pls.2.2018.12.31.09.00.23 for <linux-amarula@amarulasolutions.com> (Google Transport Security); Mon, 31 Dec 2018 09:00:23 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:902:8e8a:: with SMTP id bg10mr37863102plb.192.1546275622719; Mon, 31 Dec 2018 09:00:22 -0800 (PST) Received: from localhost.localdomain ([115.97.184.237]) by smtp.gmail.com with ESMTPSA id p7sm90692925pfj.72.2018.12.31.09.00.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 31 Dec 2018 09:00:22 -0800 (PST) From: Jagan Teki <jagan@amarulasolutions.com> To: Maxime Ripard <maxime.ripard@bootlin.com>, Andre Przywara <andre.przywara@arm.com> Cc: Chen-Yu Tsai <wens@csie.org>, Simon Glass <sjg@chromium.org>, Tom Rini <trini@konsulko.com>, u-boot@lists.denx.de, linux-sunxi@googlegroups.com, Michael Trimarchi <michael@amarulasolutions.com>, linux-amarula@amarulasolutions.com, Jagan Teki <jagan@amarulasolutions.com> Subject: [PATCH v5 00/26] clk: Add Allwinner CLK, RESET support Date: Mon, 31 Dec 2018 22:29:01 +0530 Message-Id: <20181231165927.13803-1-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=FPz50mgx; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: <linux-amarula.amarulasolutions.com> X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/post>, <mailto:linux-amarula@amarulasolutions.com> List-Help: <https://support.google.com/a/amarulasolutions.com/bin/topic.py?topic=25838>, <mailto:linux-amarula+help@amarulasolutions.com> List-Archive: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/> List-Unsubscribe: <mailto:googlegroups-manage+476853432473+unsubscribe@googlegroups.com>, <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/subscribe> |
Message
Jagan Teki
Dec. 31, 2018, 4:59 p.m. UTC
Although the previous version[1] is properly handled the clock gates with enable and disable management, but this series is trying to add some more complex Allwinner CLK architecture by handling parent clock and other CLK attributes. Allwinner Clock control unit comprises of parent clocks, gates, multiplexers, dividers, multipliers, pre/post dividers and flags etc. So, the U-Boot implementation of ccu has divided into gates and tree. gates are generic clock configuration of enable/disable bit management and these can be handled via ccu_clock_gate, which is almost same as previous version changes. Tree clock has more Allwinner CLK attributes like clock type, fixed clocks, misc clocks, mp, nk, nkm, nkmp, pre/post div, flags etc and these can be managed via ccu_clock_tree. On top of initial clock gates supported from previous version, this series is trying to add support for MP, NK, MISC, FIXED clock types with get_rate functionality and that can eventually used by uart driver. On the summary, this would be an initial infrasture that can fit into remaining clock handle support like set_rate, so the rest of code will add on the requirement basics. Once this is fine, I will try to add code for other parts especially for MMC since we have migration deadline for BLK, MMC, SCSI. So, please do let me know if anyone have any inputs. All these changes available at u-boot-sunxi/clk-next thanks, Jagan. [1] https://patchwork.ozlabs.org/cover/962226/ Jagan Teki (26): clk: Add Allwinner A64 CLK driver reset: Add Allwinner RESET driver clk: sunxi: Add Allwinner H3/H5 CLK driver clk: sunxi: Add Allwinner A10/A20 CLK driver clk: sunxi: Add Allwinner A10s/A13 CLK driver clk: sunxi: Add Allwinner A31 CLK driver clk: sunxi: Add Allwinner A23/A33 CLK driver clk: sunxi: Add Allwinner A83T CLK driver clk: sunxi: Add Allwinner R40 CLK driver clk: sunxi: Add Allwinner V3S CLK driver clk: sunxi: Implement UART clocks clk: sunxi: Implement UART resets clk: sunxi: Add Allwinner H6 CLK driver sunxi: A64: Update sun50i-a64-ccu.h clk: sunxi: Add ccu clock tree support sunxi: Enable CLK phy: sun4i-usb: Use CLK and RESET support reset: Add reset valid musb-new: sunxi: Use CLK and RESET support sunxi: usb: Switch to Generic host controllers usb: host: Drop [e-o]hci-sunxi drivers clk: sunxi: Implement SPI clocks spi: sun4i: Add CLK support clk: sunxi: Implement A64 SPI clocks, resets spi: Add Allwinner A31 SPI driver board: sopine: Enable SPI/SPI-FLASH .../sun50i-a64-sopine-baseboard-u-boot.dtsi | 16 + arch/arm/include/asm/arch-sunxi/ccu.h | 284 +++++++++++++ arch/arm/mach-sunxi/Kconfig | 12 + configs/A10-OLinuXino-Lime_defconfig | 1 + configs/A10s-OLinuXino-M_defconfig | 1 + configs/A13-OLinuXinoM_defconfig | 1 + configs/A13-OLinuXino_defconfig | 1 + configs/A20-OLinuXino-Lime2-eMMC_defconfig | 1 + configs/A20-OLinuXino-Lime2_defconfig | 1 + configs/A20-OLinuXino-Lime_defconfig | 1 + configs/A20-Olimex-SOM204-EVB_defconfig | 1 + configs/Auxtek-T003_defconfig | 1 + configs/Auxtek-T004_defconfig | 1 + configs/Bananapi_defconfig | 1 + configs/Bananapi_m2m_defconfig | 1 + configs/Bananapro_defconfig | 1 + configs/CHIP_defconfig | 1 + configs/CHIP_pro_defconfig | 1 + configs/CSQ_CS908_defconfig | 1 + configs/Colombus_defconfig | 1 + configs/Cubieboard2_defconfig | 1 + configs/Cubieboard_defconfig | 1 + configs/Cubietruck_plus_defconfig | 1 + configs/Hummingbird_A31_defconfig | 1 + configs/Itead_Ibox_A20_defconfig | 1 + configs/Linksprite_pcDuino3_Nano_defconfig | 1 + configs/Linksprite_pcDuino3_defconfig | 1 + configs/Linksprite_pcDuino_defconfig | 1 + configs/MK808C_defconfig | 1 + configs/Marsboard_A10_defconfig | 1 + configs/Mele_A1000G_quad_defconfig | 1 + configs/Mele_A1000_defconfig | 1 + configs/Mele_I7_defconfig | 1 + configs/Mele_M3_defconfig | 1 + configs/Mele_M5_defconfig | 1 + configs/Mele_M9_defconfig | 1 + configs/Mini-X_defconfig | 1 + configs/Orangepi_defconfig | 1 + configs/Orangepi_mini_defconfig | 1 + configs/Sinlinx_SinA31s_defconfig | 1 + configs/Sinlinx_SinA33_defconfig | 1 + configs/Sinovoip_BPI_M2_Plus_defconfig | 1 + configs/Sinovoip_BPI_M2_defconfig | 1 + configs/Sinovoip_BPI_M3_defconfig | 1 + configs/Wexler_TAB7200_defconfig | 1 + configs/Wobo_i5_defconfig | 1 + configs/a64-olinuxino_defconfig | 1 + configs/ba10_tv_box_defconfig | 1 + configs/bananapi_m1_plus_defconfig | 1 + configs/bananapi_m64_defconfig | 1 + configs/ga10h_v1_1_defconfig | 1 + configs/h8_homlet_v2_defconfig | 1 + configs/i12-tvbox_defconfig | 1 + configs/icnova-a20-swac_defconfig | 1 + configs/inet1_defconfig | 1 + configs/inet_q972_defconfig | 1 + configs/jesurun_q5_defconfig | 1 + configs/libretech_all_h3_cc_h2_plus_defconfig | 1 + configs/libretech_all_h3_cc_h3_defconfig | 1 + configs/libretech_all_h3_cc_h5_defconfig | 1 + configs/mixtile_loftq_defconfig | 1 + configs/mk802_a10s_defconfig | 1 + configs/mk802_defconfig | 1 + configs/mk802ii_defconfig | 1 + configs/nanopi_a64_defconfig | 1 + configs/nanopi_m1_defconfig | 1 + configs/nanopi_m1_plus_defconfig | 1 + configs/nanopi_neo2_defconfig | 1 + configs/nanopi_neo_air_defconfig | 1 + configs/nanopi_neo_defconfig | 1 + configs/nanopi_neo_plus2_defconfig | 1 + configs/orangepi_2_defconfig | 1 + configs/orangepi_lite_defconfig | 1 + configs/orangepi_one_defconfig | 1 + configs/orangepi_pc2_defconfig | 1 + configs/orangepi_pc_defconfig | 1 + configs/orangepi_pc_plus_defconfig | 1 + configs/orangepi_plus2e_defconfig | 1 + configs/orangepi_plus_defconfig | 1 + configs/orangepi_prime_defconfig | 1 + configs/orangepi_r1_defconfig | 1 + configs/orangepi_win_defconfig | 1 + configs/orangepi_zero_defconfig | 1 + configs/orangepi_zero_plus2_defconfig | 1 + configs/orangepi_zero_plus_defconfig | 1 + configs/parrot_r16_defconfig | 1 + configs/pine64_plus_defconfig | 1 + configs/r7-tv-dongle_defconfig | 1 + configs/sopine_baseboard_defconfig | 8 + configs/sun8i_a23_evb_defconfig | 1 + configs/sunxi_Gemei_G9_defconfig | 1 + configs/tbs_a711_defconfig | 1 + drivers/clk/Kconfig | 1 + drivers/clk/Makefile | 1 + drivers/clk/sunxi/Kconfig | 82 ++++ drivers/clk/sunxi/Makefile | 18 + drivers/clk/sunxi/clk_a10.c | 77 ++++ drivers/clk/sunxi/clk_a10s.c | 68 +++ drivers/clk/sunxi/clk_a23.c | 75 ++++ drivers/clk/sunxi/clk_a31.c | 82 ++++ drivers/clk/sunxi/clk_a64.c | 125 ++++++ drivers/clk/sunxi/clk_a83t.c | 75 ++++ drivers/clk/sunxi/clk_h3.c | 89 ++++ drivers/clk/sunxi/clk_h6.c | 53 +++ drivers/clk/sunxi/clk_r40.c | 88 ++++ drivers/clk/sunxi/clk_sunxi.c | 256 +++++++++++ drivers/clk/sunxi/clk_v3s.c | 59 +++ drivers/phy/allwinner/phy-sun4i-usb.c | 77 +++- drivers/reset/Kconfig | 8 + drivers/reset/Makefile | 1 + drivers/reset/reset-sunxi.c | 125 ++++++ drivers/spi/Kconfig | 6 + drivers/spi/Makefile | 1 + drivers/spi/sun4i_spi.c | 46 +- drivers/spi/sun6i_spi.c | 398 ++++++++++++++++++ drivers/usb/host/Kconfig | 2 + drivers/usb/host/Makefile | 2 - drivers/usb/host/ehci-sunxi.c | 204 --------- drivers/usb/host/ohci-sunxi.c | 233 ---------- drivers/usb/musb-new/sunxi.c | 81 ++-- include/configs/sun4i.h | 4 - include/configs/sun50i.h | 5 - include/configs/sun5i.h | 4 - include/configs/sun6i.h | 4 - include/configs/sun7i.h | 4 - include/configs/sun8i.h | 4 - include/configs/sunxi-common.h | 1 - include/dt-bindings/clock/sun50i-a64-ccu.h | 2 + include/reset.h | 11 + scripts/config_whitelist.txt | 2 - 130 files changed, 2248 insertions(+), 534 deletions(-) create mode 100644 arch/arm/dts/sun50i-a64-sopine-baseboard-u-boot.dtsi create mode 100644 arch/arm/include/asm/arch-sunxi/ccu.h create mode 100644 drivers/clk/sunxi/Kconfig create mode 100644 drivers/clk/sunxi/Makefile create mode 100644 drivers/clk/sunxi/clk_a10.c create mode 100644 drivers/clk/sunxi/clk_a10s.c create mode 100644 drivers/clk/sunxi/clk_a23.c create mode 100644 drivers/clk/sunxi/clk_a31.c create mode 100644 drivers/clk/sunxi/clk_a64.c create mode 100644 drivers/clk/sunxi/clk_a83t.c create mode 100644 drivers/clk/sunxi/clk_h3.c create mode 100644 drivers/clk/sunxi/clk_h6.c create mode 100644 drivers/clk/sunxi/clk_r40.c create mode 100644 drivers/clk/sunxi/clk_sunxi.c create mode 100644 drivers/clk/sunxi/clk_v3s.c create mode 100644 drivers/reset/reset-sunxi.c create mode 100644 drivers/spi/sun6i_spi.c delete mode 100644 drivers/usb/host/ehci-sunxi.c delete mode 100644 drivers/usb/host/ohci-sunxi.c
Comments
On Mon, Dec 31, 2018 at 10:30 PM Jagan Teki <jagan@amarulasolutions.com> wrote: > > Although the previous version[1] is properly handled the clock gates > with enable and disable management, but this series is trying to add > some more complex Allwinner CLK architecture by handling parent clock > and other CLK attributes. > > Allwinner Clock control unit comprises of parent clocks, gates, multiplexers, > dividers, multipliers, pre/post dividers and flags etc. > > So, the U-Boot implementation of ccu has divided into gates and tree. > gates are generic clock configuration of enable/disable bit management > and these can be handled via ccu_clock_gate, which is almost same as > previous version changes. > > Tree clock has more Allwinner CLK attributes like clock type, fixed clocks, > misc clocks, mp, nk, nkm, nkmp, pre/post div, flags etc and these can be > managed via ccu_clock_tree. > > On top of initial clock gates supported from previous version, this > series is trying to add support for MP, NK, MISC, FIXED clock types > with get_rate functionality and that can eventually used by uart driver. > > On the summary, this would be an initial infrasture that can fit into > remaining clock handle support like set_rate, so the rest of code will > add on the requirement basics. > > Once this is fine, I will try to add code for other parts especially for > MMC since we have migration deadline for BLK, MMC, SCSI. > > So, please do let me know if anyone have any inputs. > > All these changes available at u-boot-sunxi/clk-next > > thanks, > Jagan. > > [1] https://patchwork.ozlabs.org/cover/962226/ > > Jagan Teki (26): > clk: Add Allwinner A64 CLK driver > reset: Add Allwinner RESET driver > clk: sunxi: Add Allwinner H3/H5 CLK driver > clk: sunxi: Add Allwinner A10/A20 CLK driver > clk: sunxi: Add Allwinner A10s/A13 CLK driver > clk: sunxi: Add Allwinner A31 CLK driver > clk: sunxi: Add Allwinner A23/A33 CLK driver > clk: sunxi: Add Allwinner A83T CLK driver > clk: sunxi: Add Allwinner R40 CLK driver > clk: sunxi: Add Allwinner V3S CLK driver > clk: sunxi: Implement UART clocks > clk: sunxi: Implement UART resets > clk: sunxi: Add Allwinner H6 CLK driver > sunxi: A64: Update sun50i-a64-ccu.h > clk: sunxi: Add ccu clock tree support > sunxi: Enable CLK > phy: sun4i-usb: Use CLK and RESET support > reset: Add reset valid > musb-new: sunxi: Use CLK and RESET support > sunxi: usb: Switch to Generic host controllers > usb: host: Drop [e-o]hci-sunxi drivers > clk: sunxi: Implement SPI clocks > spi: sun4i: Add CLK support > clk: sunxi: Implement A64 SPI clocks, resets > spi: Add Allwinner A31 SPI driver > board: sopine: Enable SPI/SPI-FLASH I'm planning to pick gate clock patches and keep tree based clock for next version, let me know if anyone have any questions.
On 31/12/2018 16:59, Jagan Teki wrote: Hi Jagan, many thanks for picking this up, I was about to come back to this myself. I am looking at the pinctrl part at the moment, so good you are working on the clocks! TL;DR: I am good with the first patches, but would like to drop the last five 5 patches from this series, and discuss the whole tree approach (or at least the patch) further. > Although the previous version[1] is properly handled the clock gates > with enable and disable management, but this series is trying to add > some more complex Allwinner CLK architecture by handling parent clock > and other CLK attributes. > > Allwinner Clock control unit comprises of parent clocks, gates, multiplexers, > dividers, multipliers, pre/post dividers and flags etc. > > So, the U-Boot implementation of ccu has divided into gates and tree. > gates are generic clock configuration of enable/disable bit management > and these can be handled via ccu_clock_gate, which is almost same as > previous version changes. So I like this part very much, all those gates and resets are nicely readable. Also the removal of the special sunxi USB drivers is very welcome. So up until patch including 21/26, except 15/26, I am all in. > Tree clock has more Allwinner CLK attributes like clock type, fixed clocks, > misc clocks, mp, nk, nkm, nkmp, pre/post div, flags etc and these can be > managed via ccu_clock_tree. Mmmh, this looks quite complex for U-Boot's very limited needs to me. As far as I can see we basically have a static setup for most devices, the ones where we actually change the parent clocks are only clock consumers, namely DE/TCON and MMC. The former chooses a parent once, based on the calculated clock rate. Only for MMC we switch it from OSC24 (for the initial SPI-like setup phase) to PLL_PERIPH0 at runtime. But however this does not really affect the tree, and also we never do re-parenting. Under this premises, can't we do this somewhat simpler? At the end of the day this is U-Boot, not a sophisticated kernel, and we got away with quite simple clock code so far. Meanwhile I am struggling to understand your approach, which looks impressive on the first glance, but leave me scratching my head when looking at details. I will comment on 15/26 for the parts I am wondering about. I was trying to add MMC support and hit some issues. On the SPI part: I am bit puzzled about the last 5 patches dealing with SPI. I see that they depend on the others, but would like to deal with them separately. First, patch 25/26 (the sun6i SPI driver) is a bit surprising to find in here. I guess you want to have an easy user for another clock, but I believe this should be a separate series. There were other posts already for a sun6i driver, also I think we should have a unified driver instead of duplicating most of it again. See Oskari's latest post. Secondly: I don't think the SPI clocks are correct. You model them as simple gates only, kind of ignoring the divider settings. This is what the current sun4i driver does as well, but: it writes 1U << 31 into the clock register, which explicitly writes 0 to the other bits, setting 24 MHz as the input rate. Your approach would read-modify-write the register, just setting bit 31 and leaving the other ones as they were before. So why isn't that using your new tree approach? Looks like a standard mux/divider clock to me. Cheers, Andre. > On top of initial clock gates supported from previous version, this > series is trying to add support for MP, NK, MISC, FIXED clock types > with get_rate functionality and that can eventually used by uart driver. > > On the summary, this would be an initial infrasture that can fit into > remaining clock handle support like set_rate, so the rest of code will > add on the requirement basics. > > Once this is fine, I will try to add code for other parts especially for > MMC since we have migration deadline for BLK, MMC, SCSI. > > So, please do let me know if anyone have any inputs. > > All these changes available at u-boot-sunxi/clk-next > > thanks, > Jagan. > > [1] https://patchwork.ozlabs.org/cover/962226/ > > Jagan Teki (26): > clk: Add Allwinner A64 CLK driver > reset: Add Allwinner RESET driver > clk: sunxi: Add Allwinner H3/H5 CLK driver > clk: sunxi: Add Allwinner A10/A20 CLK driver > clk: sunxi: Add Allwinner A10s/A13 CLK driver > clk: sunxi: Add Allwinner A31 CLK driver > clk: sunxi: Add Allwinner A23/A33 CLK driver > clk: sunxi: Add Allwinner A83T CLK driver > clk: sunxi: Add Allwinner R40 CLK driver > clk: sunxi: Add Allwinner V3S CLK driver > clk: sunxi: Implement UART clocks > clk: sunxi: Implement UART resets > clk: sunxi: Add Allwinner H6 CLK driver > sunxi: A64: Update sun50i-a64-ccu.h > clk: sunxi: Add ccu clock tree support > sunxi: Enable CLK > phy: sun4i-usb: Use CLK and RESET support > reset: Add reset valid > musb-new: sunxi: Use CLK and RESET support > sunxi: usb: Switch to Generic host controllers > usb: host: Drop [e-o]hci-sunxi drivers > clk: sunxi: Implement SPI clocks > spi: sun4i: Add CLK support > clk: sunxi: Implement A64 SPI clocks, resets > spi: Add Allwinner A31 SPI driver > board: sopine: Enable SPI/SPI-FLASH > > .../sun50i-a64-sopine-baseboard-u-boot.dtsi | 16 + > arch/arm/include/asm/arch-sunxi/ccu.h | 284 +++++++++++++ > arch/arm/mach-sunxi/Kconfig | 12 + > configs/A10-OLinuXino-Lime_defconfig | 1 + > configs/A10s-OLinuXino-M_defconfig | 1 + > configs/A13-OLinuXinoM_defconfig | 1 + > configs/A13-OLinuXino_defconfig | 1 + > configs/A20-OLinuXino-Lime2-eMMC_defconfig | 1 + > configs/A20-OLinuXino-Lime2_defconfig | 1 + > configs/A20-OLinuXino-Lime_defconfig | 1 + > configs/A20-Olimex-SOM204-EVB_defconfig | 1 + > configs/Auxtek-T003_defconfig | 1 + > configs/Auxtek-T004_defconfig | 1 + > configs/Bananapi_defconfig | 1 + > configs/Bananapi_m2m_defconfig | 1 + > configs/Bananapro_defconfig | 1 + > configs/CHIP_defconfig | 1 + > configs/CHIP_pro_defconfig | 1 + > configs/CSQ_CS908_defconfig | 1 + > configs/Colombus_defconfig | 1 + > configs/Cubieboard2_defconfig | 1 + > configs/Cubieboard_defconfig | 1 + > configs/Cubietruck_plus_defconfig | 1 + > configs/Hummingbird_A31_defconfig | 1 + > configs/Itead_Ibox_A20_defconfig | 1 + > configs/Linksprite_pcDuino3_Nano_defconfig | 1 + > configs/Linksprite_pcDuino3_defconfig | 1 + > configs/Linksprite_pcDuino_defconfig | 1 + > configs/MK808C_defconfig | 1 + > configs/Marsboard_A10_defconfig | 1 + > configs/Mele_A1000G_quad_defconfig | 1 + > configs/Mele_A1000_defconfig | 1 + > configs/Mele_I7_defconfig | 1 + > configs/Mele_M3_defconfig | 1 + > configs/Mele_M5_defconfig | 1 + > configs/Mele_M9_defconfig | 1 + > configs/Mini-X_defconfig | 1 + > configs/Orangepi_defconfig | 1 + > configs/Orangepi_mini_defconfig | 1 + > configs/Sinlinx_SinA31s_defconfig | 1 + > configs/Sinlinx_SinA33_defconfig | 1 + > configs/Sinovoip_BPI_M2_Plus_defconfig | 1 + > configs/Sinovoip_BPI_M2_defconfig | 1 + > configs/Sinovoip_BPI_M3_defconfig | 1 + > configs/Wexler_TAB7200_defconfig | 1 + > configs/Wobo_i5_defconfig | 1 + > configs/a64-olinuxino_defconfig | 1 + > configs/ba10_tv_box_defconfig | 1 + > configs/bananapi_m1_plus_defconfig | 1 + > configs/bananapi_m64_defconfig | 1 + > configs/ga10h_v1_1_defconfig | 1 + > configs/h8_homlet_v2_defconfig | 1 + > configs/i12-tvbox_defconfig | 1 + > configs/icnova-a20-swac_defconfig | 1 + > configs/inet1_defconfig | 1 + > configs/inet_q972_defconfig | 1 + > configs/jesurun_q5_defconfig | 1 + > configs/libretech_all_h3_cc_h2_plus_defconfig | 1 + > configs/libretech_all_h3_cc_h3_defconfig | 1 + > configs/libretech_all_h3_cc_h5_defconfig | 1 + > configs/mixtile_loftq_defconfig | 1 + > configs/mk802_a10s_defconfig | 1 + > configs/mk802_defconfig | 1 + > configs/mk802ii_defconfig | 1 + > configs/nanopi_a64_defconfig | 1 + > configs/nanopi_m1_defconfig | 1 + > configs/nanopi_m1_plus_defconfig | 1 + > configs/nanopi_neo2_defconfig | 1 + > configs/nanopi_neo_air_defconfig | 1 + > configs/nanopi_neo_defconfig | 1 + > configs/nanopi_neo_plus2_defconfig | 1 + > configs/orangepi_2_defconfig | 1 + > configs/orangepi_lite_defconfig | 1 + > configs/orangepi_one_defconfig | 1 + > configs/orangepi_pc2_defconfig | 1 + > configs/orangepi_pc_defconfig | 1 + > configs/orangepi_pc_plus_defconfig | 1 + > configs/orangepi_plus2e_defconfig | 1 + > configs/orangepi_plus_defconfig | 1 + > configs/orangepi_prime_defconfig | 1 + > configs/orangepi_r1_defconfig | 1 + > configs/orangepi_win_defconfig | 1 + > configs/orangepi_zero_defconfig | 1 + > configs/orangepi_zero_plus2_defconfig | 1 + > configs/orangepi_zero_plus_defconfig | 1 + > configs/parrot_r16_defconfig | 1 + > configs/pine64_plus_defconfig | 1 + > configs/r7-tv-dongle_defconfig | 1 + > configs/sopine_baseboard_defconfig | 8 + > configs/sun8i_a23_evb_defconfig | 1 + > configs/sunxi_Gemei_G9_defconfig | 1 + > configs/tbs_a711_defconfig | 1 + > drivers/clk/Kconfig | 1 + > drivers/clk/Makefile | 1 + > drivers/clk/sunxi/Kconfig | 82 ++++ > drivers/clk/sunxi/Makefile | 18 + > drivers/clk/sunxi/clk_a10.c | 77 ++++ > drivers/clk/sunxi/clk_a10s.c | 68 +++ > drivers/clk/sunxi/clk_a23.c | 75 ++++ > drivers/clk/sunxi/clk_a31.c | 82 ++++ > drivers/clk/sunxi/clk_a64.c | 125 ++++++ > drivers/clk/sunxi/clk_a83t.c | 75 ++++ > drivers/clk/sunxi/clk_h3.c | 89 ++++ > drivers/clk/sunxi/clk_h6.c | 53 +++ > drivers/clk/sunxi/clk_r40.c | 88 ++++ > drivers/clk/sunxi/clk_sunxi.c | 256 +++++++++++ > drivers/clk/sunxi/clk_v3s.c | 59 +++ > drivers/phy/allwinner/phy-sun4i-usb.c | 77 +++- > drivers/reset/Kconfig | 8 + > drivers/reset/Makefile | 1 + > drivers/reset/reset-sunxi.c | 125 ++++++ > drivers/spi/Kconfig | 6 + > drivers/spi/Makefile | 1 + > drivers/spi/sun4i_spi.c | 46 +- > drivers/spi/sun6i_spi.c | 398 ++++++++++++++++++ > drivers/usb/host/Kconfig | 2 + > drivers/usb/host/Makefile | 2 - > drivers/usb/host/ehci-sunxi.c | 204 --------- > drivers/usb/host/ohci-sunxi.c | 233 ---------- > drivers/usb/musb-new/sunxi.c | 81 ++-- > include/configs/sun4i.h | 4 - > include/configs/sun50i.h | 5 - > include/configs/sun5i.h | 4 - > include/configs/sun6i.h | 4 - > include/configs/sun7i.h | 4 - > include/configs/sun8i.h | 4 - > include/configs/sunxi-common.h | 1 - > include/dt-bindings/clock/sun50i-a64-ccu.h | 2 + > include/reset.h | 11 + > scripts/config_whitelist.txt | 2 - > 130 files changed, 2248 insertions(+), 534 deletions(-) > create mode 100644 arch/arm/dts/sun50i-a64-sopine-baseboard-u-boot.dtsi > create mode 100644 arch/arm/include/asm/arch-sunxi/ccu.h > create mode 100644 drivers/clk/sunxi/Kconfig > create mode 100644 drivers/clk/sunxi/Makefile > create mode 100644 drivers/clk/sunxi/clk_a10.c > create mode 100644 drivers/clk/sunxi/clk_a10s.c > create mode 100644 drivers/clk/sunxi/clk_a23.c > create mode 100644 drivers/clk/sunxi/clk_a31.c > create mode 100644 drivers/clk/sunxi/clk_a64.c > create mode 100644 drivers/clk/sunxi/clk_a83t.c > create mode 100644 drivers/clk/sunxi/clk_h3.c > create mode 100644 drivers/clk/sunxi/clk_h6.c > create mode 100644 drivers/clk/sunxi/clk_r40.c > create mode 100644 drivers/clk/sunxi/clk_sunxi.c > create mode 100644 drivers/clk/sunxi/clk_v3s.c > create mode 100644 drivers/reset/reset-sunxi.c > create mode 100644 drivers/spi/sun6i_spi.c > delete mode 100644 drivers/usb/host/ehci-sunxi.c > delete mode 100644 drivers/usb/host/ohci-sunxi.c >
On Sun, Jan 6, 2019 at 6:49 PM André Przywara <andre.przywara@arm.com> wrote: > > On 31/12/2018 16:59, Jagan Teki wrote: > > Hi Jagan, > > many thanks for picking this up, I was about to come back to this > myself. I am looking at the pinctrl part at the moment, so good you are > working on the clocks! > > TL;DR: I am good with the first patches, but would like to drop the last > five 5 patches from this series, and discuss the whole tree approach (or > at least the patch) further. > > > Although the previous version[1] is properly handled the clock gates > > with enable and disable management, but this series is trying to add > > some more complex Allwinner CLK architecture by handling parent clock > > and other CLK attributes. > > > > Allwinner Clock control unit comprises of parent clocks, gates, multiplexers, > > dividers, multipliers, pre/post dividers and flags etc. > > > > So, the U-Boot implementation of ccu has divided into gates and tree. > > gates are generic clock configuration of enable/disable bit management > > and these can be handled via ccu_clock_gate, which is almost same as > > previous version changes. > > So I like this part very much, all those gates and resets are nicely > readable. > Also the removal of the special sunxi USB drivers is very welcome. > So up until patch including 21/26, except 15/26, I am all in. Yes my plan is to do the same. > > > Tree clock has more Allwinner CLK attributes like clock type, fixed clocks, > > misc clocks, mp, nk, nkm, nkmp, pre/post div, flags etc and these can be > > managed via ccu_clock_tree. > > Mmmh, this looks quite complex for U-Boot's very limited needs to me. > As far as I can see we basically have a static setup for most devices, > the ones where we actually change the parent clocks are only clock > consumers, namely DE/TCON and MMC. The former chooses a parent once, > based on the calculated clock rate. Only for MMC we switch it from OSC24 > (for the initial SPI-like setup phase) to PLL_PERIPH0 at runtime. > But however this does not really affect the tree, and also we never do > re-parenting. > Under this premises, can't we do this somewhat simpler? At the end of > the day this is U-Boot, not a sophisticated kernel, and we got away with > quite simple clock code so far. Yes, Idea is to go with limited clock setups but the thing is as you know Allwinner deals numerous number of clock attributes and I found it difficult to handle them w/o traversing the re-parenting stuff. I have tried simple version of set_rate in previous version[2] but it wouldn't ended as we desired. These operations need re-parenting, so we have to handle parents in clock attributes. So finally I came up with tree structure. My idea here is to support get and set rate with minimal re-parenting like OSC24, PLL_PERIPH0, PLL_PERIPH1 not adding much code like Linux does. Like GATE macro, TREE macro is also a readable structure with all possible/needed clk attributes at one glance. The code that handle these tree attributes may look confusing, but it is obvious because it would need to handle re-parenting. If SoC has a big CLK architecture like this and to support all or needed clock operations, re-parenting may be one of painful code for SoC driver in U-Boot, Since CLK framework doesn't handle these generically(may be no need) as compared to Linux. and the existing SoC like mediatek clock code does the same. At, this point, I think this tree approach can be possible way to move since it handle all clock attribute types and yes we can only support clock re-parenting which are required for U-Boot. > Meanwhile I am struggling to understand your approach, which looks > impressive on the first glance, but leave me scratching my head when > looking at details. I will comment on 15/26 for the parts I am wondering > about. I was trying to add MMC support and hit some issues. As I said above there is no generic way to handle re-parenting in U-Boot, and we need to traverse based on the SoC Clock architecture. 15/26 handling get_rate, say for example UART request a get_rate. |==> OSC_32K UART-->APB2--->|==> OSC_24M |==> PLL_PH0 ===> OSC_24M |==> PLL_PH0 Each clock tree, has clock type so UART is marked as MISC since it can't not usual clock tree unlike MMC. MMC can be MP clock type and so..on So, if driver requesting get_rate with UART clock, then we need to traverse all the UART clock tree and get the rate based on the type and identified parent clock. UART is MISC so it can directly trigger parent clock abp2, apb2 need to find the parent using mux shift, width, once apb2 found the parent it will go to next as so on. > > On the SPI part: > I am bit puzzled about the last 5 patches dealing with SPI. I see that > they depend on the others, but would like to deal with them separately. True, but these are previous version changes ie reason I grouped it here. anyway will handle accordingly in next versions. > First, patch 25/26 (the sun6i SPI driver) is a bit surprising to find in > here. I guess you want to have an easy user for another clock, but I > believe this should be a separate series. There were other posts already > for a sun6i driver, also I think we should have a unified driver instead > of duplicating most of it again. See Oskari's latest post. Yes, I saw this sun6i driver is lasting for many releases and my plan it to unified the driver w/o any ifdef. > > Secondly: I don't think the SPI clocks are correct. You model them as > simple gates only, kind of ignoring the divider settings. This is what > the current sun4i driver does as well, but: it writes 1U << 31 into the > clock register, which explicitly writes 0 to the other bits, setting 24 > MHz as the input rate. Your approach would read-modify-write the > register, just setting bit 31 and leaving the other ones as they were > before. > So why isn't that using your new tree approach? Looks like a standard > mux/divider clock to me. Yes these yet to implement, ie reason I have just added clk tree only on A64. Idea is to send next version for full support on all SoC types. [2] https://patchwork.ozlabs.org/patch/955993/
On 06/01/2019 19:22, Jagan Teki wrote: > On Sun, Jan 6, 2019 at 6:49 PM André Przywara <andre.przywara@arm.com> wrote: >> >> On 31/12/2018 16:59, Jagan Teki wrote: >> >> Hi Jagan, >> >> many thanks for picking this up, I was about to come back to this >> myself. I am looking at the pinctrl part at the moment, so good you are >> working on the clocks! >> >> TL;DR: I am good with the first patches, but would like to drop the last >> five 5 patches from this series, and discuss the whole tree approach (or >> at least the patch) further. >> >>> Although the previous version[1] is properly handled the clock gates >>> with enable and disable management, but this series is trying to add >>> some more complex Allwinner CLK architecture by handling parent clock >>> and other CLK attributes. >>> >>> Allwinner Clock control unit comprises of parent clocks, gates, multiplexers, >>> dividers, multipliers, pre/post dividers and flags etc. >>> >>> So, the U-Boot implementation of ccu has divided into gates and tree. >>> gates are generic clock configuration of enable/disable bit management >>> and these can be handled via ccu_clock_gate, which is almost same as >>> previous version changes. >> >> So I like this part very much, all those gates and resets are nicely >> readable. >> Also the removal of the special sunxi USB drivers is very welcome. >> So up until patch including 21/26, except 15/26, I am all in. > > Yes my plan is to do the same. > >> >>> Tree clock has more Allwinner CLK attributes like clock type, fixed clocks, >>> misc clocks, mp, nk, nkm, nkmp, pre/post div, flags etc and these can be >>> managed via ccu_clock_tree. >> >> Mmmh, this looks quite complex for U-Boot's very limited needs to me. >> As far as I can see we basically have a static setup for most devices, >> the ones where we actually change the parent clocks are only clock >> consumers, namely DE/TCON and MMC. The former chooses a parent once, >> based on the calculated clock rate. Only for MMC we switch it from OSC24 >> (for the initial SPI-like setup phase) to PLL_PERIPH0 at runtime. >> But however this does not really affect the tree, and also we never do >> re-parenting. >> Under this premises, can't we do this somewhat simpler? At the end of >> the day this is U-Boot, not a sophisticated kernel, and we got away with >> quite simple clock code so far. > > Yes, Idea is to go with limited clock setups but the thing is as you > know Allwinner deals numerous number of clock attributes and I found > it difficult to handle them w/o traversing the re-parenting stuff. I > have tried simple version of set_rate in previous version[2] but it > wouldn't ended as we desired. These operations need re-parenting, so > we have to handle parents in clock attributes. Just for clarification: with re-parenting I meant selecting a different parent clock *at runtime*, potentially adjusting other clocks which depend on that. We would not need that in U-Boot, fortunately. > So finally I came up with tree structure. Yeah, so looking at patch 15/26 in more detail this is probably the way to go. I was just hit by that wall of code. Implementing get_rate in a recursive fashion reduces the file size drastically, see the reply to that patch. I was just concerned that making this all data structure based (as opposed to handle them all in a giant switch/case) would require to abstract this too much, up to a point where it gets more complicated. Especially when it comes to special clocks like the MMC beast with its new clock mode. > My idea here is to support get and set rate with minimal re-parenting > like OSC24, PLL_PERIPH0, PLL_PERIPH1 not adding much code like Linux > does. Like GATE macro, TREE macro is also a readable structure with > all possible/needed clk attributes at one glance. The code that handle > these tree attributes may look confusing, but it is obvious because it > would need to handle re-parenting. > > If SoC has a big CLK architecture like this and to support all or > needed clock operations, re-parenting may be one of painful code for > SoC driver in U-Boot, Since CLK framework doesn't handle these > generically(may be no need) as compared to Linux. and the existing SoC > like mediatek clock code does the same. > > At, this point, I think this tree approach can be possible way to move > since it handle all clock attribute types and yes we can only support > clock re-parenting which are required for U-Boot. Yeah, so we need to traverse a clock tree to get and set the parent rate. I think with the recursive rework this is now quite neat, especially as we can keep the per-SoC code small. We just have to see how the special clocks blend in there. >> Meanwhile I am struggling to understand your approach, which looks >> impressive on the first glance, but leave me scratching my head when >> looking at details. I will comment on 15/26 for the parts I am wondering >> about. I was trying to add MMC support and hit some issues. > > As I said above there is no generic way to handle re-parenting in > U-Boot, and we need to traverse based on the SoC Clock architecture. > > 15/26 handling get_rate, say for example UART request a get_rate. > > > |==> OSC_32K > UART-->APB2--->|==> OSC_24M > |==> PLL_PH0 ===> OSC_24M > |==> PLL_PH0 > > Each clock tree, has clock type so UART is marked as MISC since it > can't not usual clock tree unlike MMC. MMC can be MP clock type and > so..on > > So, if driver requesting get_rate with UART clock, then we need to > traverse all the UART clock tree and get the rate based on the type > and identified parent clock. UART is MISC so it can directly trigger > parent clock abp2, apb2 need to find the parent using mux shift, > width, once apb2 found the parent it will go to next as so on. Yeah, I understand this, but was hoping we could handle this in a switch/case, for clarity. Those macro designs look nice, but are hard to understand for outsiders. But I now think that your data driven approach is better to support multiple SoCs. I can write up some documentation for this. >> On the SPI part: >> I am bit puzzled about the last 5 patches dealing with SPI. I see that >> they depend on the others, but would like to deal with them separately. > > True, but these are previous version changes ie reason I grouped it > here. anyway will handle accordingly in next versions. > >> First, patch 25/26 (the sun6i SPI driver) is a bit surprising to find in >> here. I guess you want to have an easy user for another clock, but I >> believe this should be a separate series. There were other posts already >> for a sun6i driver, also I think we should have a unified driver instead >> of duplicating most of it again. See Oskari's latest post. > > Yes, I saw this sun6i driver is lasting for many releases and my plan > it to unified the driver w/o any ifdef. So I did this, basically by introducing a register map for both versions. That works, but is not very nice. Oskari's patch has the advantage of being quite small, and we will probably never need to support both SPI devices in one build. >> Secondly: I don't think the SPI clocks are correct. You model them as >> simple gates only, kind of ignoring the divider settings. This is what >> the current sun4i driver does as well, but: it writes 1U << 31 into the >> clock register, which explicitly writes 0 to the other bits, setting 24 >> MHz as the input rate. Your approach would read-modify-write the >> register, just setting bit 31 and leaving the other ones as they were >> before. >> So why isn't that using your new tree approach? Looks like a standard >> mux/divider clock to me. > > Yes these yet to implement, ie reason I have just added clk tree only > on A64. Idea is to send next version for full support on all SoC > types. Do we need to merge this for all SoCs in the beginning? I think it would be safer to test this on one SoC (A64) first, to avoid breaking everyone in case of problems. Especially if we can't test this on every board. Cheers, Andre. > [2] https://patchwork.ozlabs.org/patch/955993/ >