* [PATCH v4 0/7] arm64: Allwinner A64 support @ 2016-08-08 17:21 Andre Przywara 2016-08-08 17:21 ` [PATCH v4 1/7] arm64: sunxi: Kconfig: add essential pinctrl driver Andre Przywara ` (6 more replies) 0 siblings, 7 replies; 16+ messages in thread From: Andre Przywara @ 2016-08-08 17:21 UTC (permalink / raw) To: Maxime Ripard, Chen-Yu Tsai; +Cc: linux-sunxi, linux-arm-kernel, linux-kernel This is a new attempt on proper upstream Allwinner A64 support. It builds on the bits that have already been merged (arm64 architecture support and the pinctrl driver), and mostly completes it with some DT files. I chose a new approach on the clock system: - For the basic PLL clocks we go with fixed-clocks now, as Allwinner recommends fixed frequencies for those anyway. I am not sure whether we should express the dependencies between those clocks as fixed-factor clocks or not. - The clock gates are left as in the previous post, so using a flexible, DT driver based on the existing simple-gates.c. There are ways to get away without it, but those approaches are more hideous and I still consider this approach pretty clean. - Any other clock is expected to be handled by firmware using the SCPI protocol (which ARM's Juno board uses as well). While this is not the most flexible and all-encompassing interface, it fits the bill for our clocks for now and enjoys upstream support on the Linux side already, so there are no patches needed on this front. I will send RFC patches demonstrating this just after this series. This series focusses on the basic peripherals. The MMC support, which was part of former revisions of this series, is dropped for now as the current driver lacks some bits to properly support the enhanced A64 MMC controller, which becomes evident when trying to use it on an eMMC device. There are patches floating around to tackle this, but this workd shouldn't delay upstreaming the basic bits first. This series has been tested (with an initrd) on the Pine64 and BananaPi M64 boards. As Maxime's latest post uses a completely different clock system, I wanted to put this forward as a simpler and more sustainable approach to tackle the tricky Allwinner CCU subsystem. I am happy to collaborate and to find the right way (TM) to support this (and future!) SoCs. Any comments are welcome! Cheers, Andre. Changelog v3..v4: - add proper Kconfig bits to build the pinctrl driver - adapt Maxime's approach of avoiding pine64-common.dtsi - add PMU DT node - use fixed-clocks for basic PLL clocks - use clock names based on manual (periph0 & friends) - move clocks out of their own subnode into a separate file - add .dts for BananaPi-M64 (thanks to Nora Lee for a sample board) Andre Przywara (7): arm64: sunxi: Kconfig: add essential pinctrl driver DT: clk: sunxi: add binding doc for the multi-bus-gates clock clk: sunxi: add generic multi-parent bus clock gates driver of: add vendor prefix for Pine64 arm64: dts: add Allwinner A64 SoC .dtsi arm64: dts: add Pine64 support arm64: dts: add BananaPi M64 support Documentation/devicetree/bindings/arm/sunxi.txt | 1 + Documentation/devicetree/bindings/clock/sunxi.txt | 7 + .../devicetree/bindings/vendor-prefixes.txt | 1 + arch/arm64/Kconfig.platforms | 2 + arch/arm64/boot/dts/Makefile | 1 + arch/arm64/boot/dts/allwinner/Makefile | 6 + .../boot/dts/allwinner/sun50i-a64-bananapi-m64.dts | 74 ++++ .../boot/dts/allwinner/sun50i-a64-clocks.dtsi | 140 ++++++++ .../boot/dts/allwinner/sun50i-a64-pine64-plus.dts | 48 +++ .../arm64/boot/dts/allwinner/sun50i-a64-pine64.dts | 74 ++++ arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 398 +++++++++++++++++++++ drivers/clk/sunxi/Makefile | 1 + drivers/clk/sunxi/clk-multi-gates.c | 105 ++++++ 13 files changed, 858 insertions(+) create mode 100644 arch/arm64/boot/dts/allwinner/Makefile create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-clocks.dtsi create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-plus.dts create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi create mode 100644 drivers/clk/sunxi/clk-multi-gates.c -- 2.9.0 ^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v4 1/7] arm64: sunxi: Kconfig: add essential pinctrl driver 2016-08-08 17:21 [PATCH v4 0/7] arm64: Allwinner A64 support Andre Przywara @ 2016-08-08 17:21 ` Andre Przywara 2016-08-23 19:37 ` Maxime Ripard 2016-08-08 17:21 ` [PATCH v4 2/7] DT: clk: sunxi: add binding doc for the multi-bus-gates clock Andre Przywara ` (5 subsequent siblings) 6 siblings, 1 reply; 16+ messages in thread From: Andre Przywara @ 2016-08-08 17:21 UTC (permalink / raw) To: Maxime Ripard, Chen-Yu Tsai Cc: linux-sunxi, linux-arm-kernel, linux-kernel, Will Deacon, Catalin Marinas The pinctrl driver is essential for the Allwinner SoCs to work. Add the driver's config symbol to the Kconfig entry to always compile it in. We can't use the arm approach to make the _driver's_ Kconfig symbol def_bool, because we lack the MACH_* symbols in arm64. That line was in the original pinctrl driver patch, but got removed to avoid the dependency on the Kconfig patch [1]. Also add the general PINCTRL symbol, which isn't selected automatically for the same reason. Reported-by: Jeroen Dekien <dekien@gmail.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com> [1]: http://lists.infradead.org/pipermail/linux-arm-kernel/2016-March/414086.html --- arch/arm64/Kconfig.platforms | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms index bb2616b..e3dc1a4 100644 --- a/arch/arm64/Kconfig.platforms +++ b/arch/arm64/Kconfig.platforms @@ -3,6 +3,8 @@ menu "Platform selection" config ARCH_SUNXI bool "Allwinner sunxi 64-bit SoC Family" select GENERIC_IRQ_CHIP + select PINCTRL + select PINCTRL_SUN50I_A64 help This enables support for Allwinner sunxi based SoCs like the A64. -- 2.9.0 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH v4 1/7] arm64: sunxi: Kconfig: add essential pinctrl driver 2016-08-08 17:21 ` [PATCH v4 1/7] arm64: sunxi: Kconfig: add essential pinctrl driver Andre Przywara @ 2016-08-23 19:37 ` Maxime Ripard 0 siblings, 0 replies; 16+ messages in thread From: Maxime Ripard @ 2016-08-23 19:37 UTC (permalink / raw) To: Andre Przywara Cc: Chen-Yu Tsai, linux-sunxi, linux-arm-kernel, linux-kernel, Will Deacon, Catalin Marinas [-- Attachment #1: Type: text/plain, Size: 897 bytes --] On Mon, Aug 08, 2016 at 06:21:43PM +0100, Andre Przywara wrote: > The pinctrl driver is essential for the Allwinner SoCs to work. > Add the driver's config symbol to the Kconfig entry to always compile > it in. We can't use the arm approach to make the _driver's_ Kconfig > symbol def_bool, because we lack the MACH_* symbols in arm64. > That line was in the original pinctrl driver patch, but got removed > to avoid the dependency on the Kconfig patch [1]. > Also add the general PINCTRL symbol, which isn't selected automatically > for the same reason. > > Reported-by: Jeroen Dekien <dekien@gmail.com> > Signed-off-by: Andre Przywara <andre.przywara@arm.com> > > [1]: http://lists.infradead.org/pipermail/linux-arm-kernel/2016-March/414086.html Applied, thanks Maxime -- Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v4 2/7] DT: clk: sunxi: add binding doc for the multi-bus-gates clock 2016-08-08 17:21 [PATCH v4 0/7] arm64: Allwinner A64 support Andre Przywara 2016-08-08 17:21 ` [PATCH v4 1/7] arm64: sunxi: Kconfig: add essential pinctrl driver Andre Przywara @ 2016-08-08 17:21 ` Andre Przywara 2016-08-08 17:21 ` [PATCH v4 3/7] clk: sunxi: add generic multi-parent bus clock gates driver Andre Przywara ` (4 subsequent siblings) 6 siblings, 0 replies; 16+ messages in thread From: Andre Przywara @ 2016-08-08 17:21 UTC (permalink / raw) To: Maxime Ripard, Chen-Yu Tsai Cc: linux-sunxi, linux-arm-kernel, linux-kernel, Rob Herring, Mark Rutland, devicetree Recent Allwinner SoCs introduced a bus gates clock which can have different parents for individual gates, even within a single register. For the time being we encoded this relation in the driver. This commit specifies a new binding which allows to encode this in the DT by using a child node for each parent clock used. This allows to specify any kind of relation efficiently and also keeps the very same kernel driver for all SoCs at the same time. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Acked-by: Rob Herring <robh@kernel.org> --- Documentation/devicetree/bindings/clock/sunxi.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/devicetree/bindings/clock/sunxi.txt b/Documentation/devicetree/bindings/clock/sunxi.txt index 8f7619d..7d4197e 100644 --- a/Documentation/devicetree/bindings/clock/sunxi.txt +++ b/Documentation/devicetree/bindings/clock/sunxi.txt @@ -87,6 +87,8 @@ Required properties: "allwinner,sun9i-a80-usb-phy-clk" - for usb phy gates + resets on A80 "allwinner,sun4i-a10-ve-clk" - for the Video Engine clock "allwinner,sun6i-a31-display-clk" - for the display clocks + "allwinner,sunxi-multi-bus-gates-clk" - for the multi-parent bus gates + "allwinner,sun50i-a64-bus-gates-clk" - for the bus gates on A64 Required properties for all clocks: - reg : shall be the control register address for the clock. @@ -127,6 +129,11 @@ For "allwinner,sun6i-a31-pll6-clk", there are 2 outputs. The first output is the normal PLL6 output, or "pll6". The second output is rate doubled PLL6, or "pll6x2". +The "allwinner,sunxi-multi-bus-gates-clk" holds the actual clocks in +child nodes, where each one specifies the parent clock that the particular +gates are depending from. The child nodes each follow the common clock +binding as described in this document. + The "allwinner,*-mmc-clk" clocks have three different outputs: the main clock, with the ID 0, and the output and sample clocks, with the IDs 1 and 2, respectively. -- 2.9.0 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v4 3/7] clk: sunxi: add generic multi-parent bus clock gates driver 2016-08-08 17:21 [PATCH v4 0/7] arm64: Allwinner A64 support Andre Przywara 2016-08-08 17:21 ` [PATCH v4 1/7] arm64: sunxi: Kconfig: add essential pinctrl driver Andre Przywara 2016-08-08 17:21 ` [PATCH v4 2/7] DT: clk: sunxi: add binding doc for the multi-bus-gates clock Andre Przywara @ 2016-08-08 17:21 ` Andre Przywara 2016-08-08 18:15 ` Jean-Francois Moine 2016-08-23 20:00 ` Maxime Ripard 2016-08-08 17:21 ` [PATCH v4 4/7] of: add vendor prefix for Pine64 Andre Przywara ` (3 subsequent siblings) 6 siblings, 2 replies; 16+ messages in thread From: Andre Przywara @ 2016-08-08 17:21 UTC (permalink / raw) To: Maxime Ripard, Chen-Yu Tsai Cc: linux-sunxi, linux-arm-kernel, linux-kernel, Emilio López, Michael Turquette, Stephen Boyd, linux-clk The Allwinner H3 SoC introduced bus clock gates with potentially different parents per clock gate register. The H3 driver chose to hardcode the actual parent clock relation in the code. Add a new driver (which has the potential to drive the H3 and also the simple clock gates as well) which uses the power of DT to describe this relationship in an elegant and flexible way. Using one subnode for every parent clock we get away with a single DT compatible match, which can be used as a fallback value in the actual DTs without the need to add specific compatible strings to the code. This avoids adding a new driver or function for every new SoC. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Acked-by: Jean-Francois Moine <moinejf@free.fr> --- drivers/clk/sunxi/Makefile | 1 + drivers/clk/sunxi/clk-multi-gates.c | 105 ++++++++++++++++++++++++++++++++++++ 2 files changed, 106 insertions(+) create mode 100644 drivers/clk/sunxi/clk-multi-gates.c diff --git a/drivers/clk/sunxi/Makefile b/drivers/clk/sunxi/Makefile index 39d2044..caf2bf6 100644 --- a/drivers/clk/sunxi/Makefile +++ b/drivers/clk/sunxi/Makefile @@ -14,6 +14,7 @@ obj-y += clk-simple-gates.o obj-y += clk-sun4i-display.o obj-y += clk-sun4i-pll3.o obj-y += clk-sun4i-tcon-ch1.o +obj-y += clk-multi-gates.o obj-y += clk-sun8i-bus-gates.o obj-y += clk-sun8i-mbus.o obj-y += clk-sun9i-core.o diff --git a/drivers/clk/sunxi/clk-multi-gates.c b/drivers/clk/sunxi/clk-multi-gates.c new file mode 100644 index 0000000..76e715a --- /dev/null +++ b/drivers/clk/sunxi/clk-multi-gates.c @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2016 ARM Ltd. + * + * Based on clk-sun8i-bus-gates.c, which is: + * Copyright (C) 2015 Jens Kuske <jenskuske@gmail.com> + * Based on clk-simple-gates.c, which is: + * Copyright 2015 Maxime Ripard <maxime.ripard@free-electrons.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include <linux/clk-provider.h> +#include <linux/of.h> +#include <linux/of_address.h> +#include <linux/slab.h> +#include <linux/spinlock.h> + +static DEFINE_SPINLOCK(gates_lock); + +static void __init sunxi_parse_parent(struct device_node *node, + struct clk_onecell_data *clk_data, + void __iomem *reg) +{ + const char *parent = of_clk_get_parent_name(node, 0); + const char *clk_name; + struct property *prop; + struct clk *clk; + const __be32 *p; + int index, i = 0; + + of_property_for_each_u32(node, "clock-indices", prop, p, index) { + of_property_read_string_index(node, "clock-output-names", + i, &clk_name); + + clk = clk_register_gate(NULL, clk_name, parent, 0, + reg + 4 * (index / 32), index % 32, + 0, &gates_lock); + i++; + if (IS_ERR(clk)) { + pr_warn("could not register gate clock \"%s\"\n", + clk_name); + continue; + } + if (clk_data->clks[index]) + pr_warn("bus-gate clock %s: index #%d already registered as %s\n", + clk_name, index, "?"); + else + clk_data->clks[index] = clk; + } +} + +static void __init sunxi_multi_bus_gates_init(struct device_node *node) +{ + struct clk_onecell_data *clk_data; + struct device_node *child; + struct property *prop; + struct resource res; + void __iomem *reg; + const __be32 *p; + int number = 0; + int index; + + reg = of_io_request_and_map(node, 0, of_node_full_name(node)); + if (IS_ERR(reg)) + return; + + clk_data = kmalloc(sizeof(struct clk_onecell_data), GFP_KERNEL); + if (!clk_data) + goto err_unmap; + + for_each_child_of_node(node, child) + of_property_for_each_u32(child, "clock-indices", prop, p, index) + number = max(number, index); + + clk_data->clks = kcalloc(number + 1, sizeof(struct clk *), GFP_KERNEL); + if (!clk_data->clks) + goto err_free_data; + + for_each_child_of_node(node, child) + sunxi_parse_parent(child, clk_data, reg); + + clk_data->clk_num = number + 1; + if (of_clk_add_provider(node, of_clk_src_onecell_get, clk_data)) + pr_err("registering bus-gate clock %s failed\n", node->name); + + return; + +err_free_data: + kfree(clk_data); +err_unmap: + iounmap(reg); + of_address_to_resource(node, 0, &res); + release_mem_region(res.start, resource_size(&res)); +} + +CLK_OF_DECLARE(sunxi_multi_bus_gates, "allwinner,sunxi-multi-bus-gates-clk", + sunxi_multi_bus_gates_init); -- 2.9.0 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH v4 3/7] clk: sunxi: add generic multi-parent bus clock gates driver 2016-08-08 17:21 ` [PATCH v4 3/7] clk: sunxi: add generic multi-parent bus clock gates driver Andre Przywara @ 2016-08-08 18:15 ` Jean-Francois Moine 2016-08-09 10:02 ` [linux-sunxi] " Chen-Yu Tsai 2016-08-23 20:00 ` Maxime Ripard 1 sibling, 1 reply; 16+ messages in thread From: Jean-Francois Moine @ 2016-08-08 18:15 UTC (permalink / raw) To: Andre Przywara Cc: Maxime Ripard, Chen-Yu Tsai, Emilio López, Michael Turquette, Stephen Boyd, linux-kernel, linux-sunxi, linux-clk, linux-arm-kernel On Mon, 8 Aug 2016 18:21:45 +0100 Andre Przywara <andre.przywara@arm.com> wrote: > The Allwinner H3 SoC introduced bus clock gates with potentially > different parents per clock gate register. The H3 driver chose to > hardcode the actual parent clock relation in the code. > Add a new driver (which has the potential to drive the H3 and also > the simple clock gates as well) which uses the power of DT to describe > this relationship in an elegant and flexible way. > Using one subnode for every parent clock we get away with a single > DT compatible match, which can be used as a fallback value in the > actual DTs without the need to add specific compatible strings to the > code. This avoids adding a new driver or function for every new SoC. The 'parent's of the bus gates are of no interest. They are supposed to be (no clear documentation) apb1, apb2, ahb1 and ahb2, but, as you well noticed in the patch 5/7, these clocks are fixed and have no gate. Some of them are parents of real clocks, but they don't bring anything to the bus gates of the other clocks. As I wrote previously, the simplest is to ungate/gate the clocks in both the bus and clock registers on clk_prepare/unprepare. Then, your 'multi-bus-gates' would be simply a generic 'multi-gates'. -- Ken ar c'hentañ | ** Breizh ha Linux atav! ** Jef | http://moinejf.free.fr/ ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [linux-sunxi] Re: [PATCH v4 3/7] clk: sunxi: add generic multi-parent bus clock gates driver 2016-08-08 18:15 ` Jean-Francois Moine @ 2016-08-09 10:02 ` Chen-Yu Tsai 2016-08-09 17:27 ` Jean-Francois Moine 0 siblings, 1 reply; 16+ messages in thread From: Chen-Yu Tsai @ 2016-08-09 10:02 UTC (permalink / raw) To: Jean-François Moine Cc: Andre Przywara, Maxime Ripard, Chen-Yu Tsai, Emilio López, Michael Turquette, Stephen Boyd, linux-kernel, linux-sunxi, linux-clk, linux-arm-kernel On Tue, Aug 9, 2016 at 2:15 AM, Jean-Francois Moine <moinejf@free.fr> wrote: > On Mon, 8 Aug 2016 18:21:45 +0100 > Andre Przywara <andre.przywara@arm.com> wrote: > >> The Allwinner H3 SoC introduced bus clock gates with potentially >> different parents per clock gate register. The H3 driver chose to >> hardcode the actual parent clock relation in the code. >> Add a new driver (which has the potential to drive the H3 and also >> the simple clock gates as well) which uses the power of DT to describe >> this relationship in an elegant and flexible way. >> Using one subnode for every parent clock we get away with a single >> DT compatible match, which can be used as a fallback value in the >> actual DTs without the need to add specific compatible strings to the >> code. This avoids adding a new driver or function for every new SoC. > > The 'parent's of the bus gates are of no interest. > They are supposed to be (no clear documentation) apb1, apb2, ahb1 and > ahb2, but, as you well noticed in the patch 5/7, these clocks are fixed > and have no gate. Some of them are parents of real clocks, but they > don't bring anything to the bus gates of the other clocks. Yes they are. Some devices, such as UARTs and I2C controllers, need to get the clock rate of the gate and calculate the proper internal divider. > As I wrote previously, the simplest is to ungate/gate the clocks in > both the bus and clock registers on clk_prepare/unprepare. > Then, your 'multi-bus-gates' would be simply a generic 'multi-gates'. This is somewhat misleading. What "clock" registers are you referring to? There are no "bus" registers. The reason we call them "bus clock gates" is because they are mashed together, instead of having clearly separated registers for each AHB/APB bus. And if you want just a generic clock gates driver, we already have the "simple-gates" driver. Regards ChenYu ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [linux-sunxi] Re: [PATCH v4 3/7] clk: sunxi: add generic multi-parent bus clock gates driver 2016-08-09 10:02 ` [linux-sunxi] " Chen-Yu Tsai @ 2016-08-09 17:27 ` Jean-Francois Moine 0 siblings, 0 replies; 16+ messages in thread From: Jean-Francois Moine @ 2016-08-09 17:27 UTC (permalink / raw) To: Chen-Yu Tsai Cc: Andre Przywara, Maxime Ripard, Emilio López, Michael Turquette, Stephen Boyd, linux-kernel, linux-sunxi, linux-clk, linux-arm-kernel On Tue, 9 Aug 2016 18:02:47 +0800 Chen-Yu Tsai <wens@csie.org> wrote: > > The 'parent's of the bus gates are of no interest. > > They are supposed to be (no clear documentation) apb1, apb2, ahb1 and > > ahb2, but, as you well noticed in the patch 5/7, these clocks are fixed > > and have no gate. Some of them are parents of real clocks, but they > > don't bring anything to the bus gates of the other clocks. > > Yes they are. Some devices, such as UARTs and I2C controllers, need > to get the clock rate of the gate and calculate the proper internal > divider. You are right, the clocks of some subsystems have only a gate, but these are exceptions. Look at an ordinary clock, say the mmc0 of the H3. There is a "bus" gate (see below) in the CCU register 0x60, bit 8, and the "clock" gate in the CCU register 0x88, bit 31. The 'simple-gates' says that the "bus gate" is child of ahb1 (in all sunxi versions, the one prior to 'simple-gate', in the 'simple-gate', in 'sunxi-ng', and now in André's patch). But, where do you see a hardware relation between the mmc0 clock and the ahb1 clock? > > As I wrote previously, the simplest is to ungate/gate the clocks in > > both the bus and clock registers on clk_prepare/unprepare. > > Then, your 'multi-bus-gates' would be simply a generic 'multi-gates'. > > This is somewhat misleading. What "clock" registers are you referring > to? There are no "bus" registers. The reason we call them "bus clock > gates" is because they are mashed together, instead of having clearly > separated registers for each AHB/APB bus. > > And if you want just a generic clock gates driver, we already have > the "simple-gates" driver. Maybe I used the wrong words. The "clock" register is the one which defines the parameters of the clock (parents, mul/div factors, gate). For the H3 mmc0, it is the CCU register 0x60. The "bus" register is one of the so-called "Bus Clock Gating Register"s. For the H3 mmc0, it is the CCU register 0x88. -- Ken ar c'hentañ | ** Breizh ha Linux atav! ** Jef | http://moinejf.free.fr/ ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v4 3/7] clk: sunxi: add generic multi-parent bus clock gates driver 2016-08-08 17:21 ` [PATCH v4 3/7] clk: sunxi: add generic multi-parent bus clock gates driver Andre Przywara 2016-08-08 18:15 ` Jean-Francois Moine @ 2016-08-23 20:00 ` Maxime Ripard 1 sibling, 0 replies; 16+ messages in thread From: Maxime Ripard @ 2016-08-23 20:00 UTC (permalink / raw) To: Andre Przywara Cc: Chen-Yu Tsai, linux-sunxi, linux-arm-kernel, linux-kernel, Emilio López, Michael Turquette, Stephen Boyd, linux-clk [-- Attachment #1: Type: text/plain, Size: 1252 bytes --] On Mon, Aug 08, 2016 at 06:21:45PM +0100, Andre Przywara wrote: > The Allwinner H3 SoC introduced bus clock gates with potentially > different parents per clock gate register. The H3 driver chose to > hardcode the actual parent clock relation in the code. > Add a new driver (which has the potential to drive the H3 and also > the simple clock gates as well) which uses the power of DT to describe > this relationship in an elegant and flexible way. > Using one subnode for every parent clock we get away with a single > DT compatible match, which can be used as a fallback value in the > actual DTs without the need to add specific compatible strings to the > code. This avoids adding a new driver or function for every new SoC. > > Signed-off-by: Andre Przywara <andre.przywara@arm.com> > Acked-by: Jean-Francois Moine <moinejf@free.fr> > --- > drivers/clk/sunxi/Makefile | 1 + > drivers/clk/sunxi/clk-multi-gates.c | 105 ++++++++++++++++++++++++++++++++++++ Aside from my initial objections (that I still have), drivers/clk/sunxi is in maintainance-only mode, we won't merge any new drivers there. Maxime -- Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v4 4/7] of: add vendor prefix for Pine64 2016-08-08 17:21 [PATCH v4 0/7] arm64: Allwinner A64 support Andre Przywara ` (2 preceding siblings ...) 2016-08-08 17:21 ` [PATCH v4 3/7] clk: sunxi: add generic multi-parent bus clock gates driver Andre Przywara @ 2016-08-08 17:21 ` Andre Przywara 2016-08-08 17:21 ` [PATCH v4 5/7] arm64: dts: add Allwinner A64 SoC .dtsi Andre Przywara ` (2 subsequent siblings) 6 siblings, 0 replies; 16+ messages in thread From: Andre Przywara @ 2016-08-08 17:21 UTC (permalink / raw) To: Maxime Ripard, Chen-Yu Tsai Cc: linux-sunxi, linux-arm-kernel, linux-kernel, Rob Herring, Mark Rutland, devicetree Signed-off-by: Andre Przywara <andre.przywara@arm.com> Acked-by: Rob Herring <robh@kernel.org> --- Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index 1992aa9..492f92c 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt @@ -199,6 +199,7 @@ parade Parade Technologies Inc. pericom Pericom Technology Inc. phytec PHYTEC Messtechnik GmbH picochip Picochip Ltd +pine64 Pine64 plathome Plat'Home Co., Ltd. plda PLDA pixcir PIXCIR MICROELECTRONICS Co., Ltd -- 2.9.0 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v4 5/7] arm64: dts: add Allwinner A64 SoC .dtsi 2016-08-08 17:21 [PATCH v4 0/7] arm64: Allwinner A64 support Andre Przywara ` (3 preceding siblings ...) 2016-08-08 17:21 ` [PATCH v4 4/7] of: add vendor prefix for Pine64 Andre Przywara @ 2016-08-08 17:21 ` Andre Przywara 2016-08-10 20:00 ` Rob Herring 2016-08-23 20:03 ` Maxime Ripard 2016-08-08 17:21 ` [PATCH v4 6/7] arm64: dts: add Pine64 support Andre Przywara 2016-08-08 17:21 ` [PATCH v4 7/7] arm64: dts: add BananaPi M64 support Andre Przywara 6 siblings, 2 replies; 16+ messages in thread From: Andre Przywara @ 2016-08-08 17:21 UTC (permalink / raw) To: Maxime Ripard, Chen-Yu Tsai Cc: linux-sunxi, linux-arm-kernel, linux-kernel, Rob Herring, Mark Rutland, devicetree The Allwinner A64 SoC is a low-cost chip with 4 ARM Cortex-A53 cores and the typical tablet / TV box peripherals. The SoC is based on the (32-bit) Allwinner H3 chip, sharing most of the peripherals and the memory map. Although the cores are proper 64-bit ones, the whole SoC is actually limited to 4GB (including all the supported DRAM), so we use 32-bit address and size cells. This has the nice feature of us being able to reuse the DT for 32-bit kernels as well. This .dtsi lists the hardware that we support so far. Signed-off-by: Andre Przywara <andre.przywara@arm.com> --- Hi, I dropped Rob's previous ACK, as there were quite some changes. Cheers, Andre. Documentation/devicetree/bindings/arm/sunxi.txt | 1 + .../boot/dts/allwinner/sun50i-a64-clocks.dtsi | 140 ++++++++ arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 398 +++++++++++++++++++++ 3 files changed, 539 insertions(+) create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-clocks.dtsi create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi diff --git a/Documentation/devicetree/bindings/arm/sunxi.txt b/Documentation/devicetree/bindings/arm/sunxi.txt index 7e79fcc..7e59d8b 100644 --- a/Documentation/devicetree/bindings/arm/sunxi.txt +++ b/Documentation/devicetree/bindings/arm/sunxi.txt @@ -14,3 +14,4 @@ using one of the following compatible strings: allwinner,sun8i-a83t allwinner,sun8i-h3 allwinner,sun9i-a80 + allwinner,sun50i-a64 diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-clocks.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-clocks.dtsi new file mode 100644 index 0000000..9bfcd41 --- /dev/null +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-clocks.dtsi @@ -0,0 +1,140 @@ +/* + * Allwinner A64 clocks + * + * Copyright (c) 2016 ARM Ltd + * + * This file is licensed under a dual GPLv2 or BSD license. + * + */ + + osc24M: osc24M_clk { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <24000000>; + clock-output-names = "osc24M"; + }; + + osc32k: osc32k_clk { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <32768>; + clock-output-names = "osc32k"; + }; + + periph0_2x: periph0_2x_clk { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <1200000000>; + clock-output-names = "periph0_2x"; + }; + + periph0: periph0_clk { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clock-div = <2>; + clock-mult = <1>; + clocks = <&periph0_2x>; + clock-output-names = "periph0"; + }; + + periph1: periph1_clk { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <600000000>; + clock-output-names = "periph1"; + }; + + ahb1: ahb1_clk { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <200000000>; + clock-output-names = "ahb1"; + }; + + ahb2: ahb2_clk { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <300000000>; + clock-output-names = "ahb2"; + }; + + apb1: apb1_clk { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <100000000>; + clock-output-names = "apb1"; + }; + + apb2: apb2_clk { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <24000000>; + clock-output-names = "apb2"; + }; + + bus_gates: bus_gates_clk@1c20060 { + #clock-cells = <1>; + compatible = "allwinner,sun50i-a64-bus-gates-clk", + "allwinner,sunxi-multi-bus-gates-clk"; + reg = <0x01c20060 0x14>; + ahb1_parent { + clocks = <&ahb1>; + clock-indices = <1>, <5>, + <6>, <8>, + <9>, <10>, + <13>, <14>, + <18>, <19>, + <20>, <21>, + <23>, <24>, + <25>, <28>, + <32>, <35>, + <36>, <37>, + <40>, <43>, + <44>, <52>, + <53>, <54>, + <135>; + clock-output-names = "bus_mipidsi", "bus_ce", + "bus_dma", "bus_mmc0", + "bus_mmc1", "bus_mmc2", + "bus_nand", "bus_sdram", + "bus_ts", "bus_hstimer", + "bus_spi0", "bus_spi1", + "bus_otg", "bus_otg_ehci0", + "bus_ehci0", "bus_otg_ohci0", + "bus_ve", "bus_lcd0", + "bus_lcd1", "bus_deint", + "bus_csi", "bus_hdmi", + "bus_de", "bus_gpu", + "bus_msgbox", "bus_spinlock", + "bus_dbg"; + }; + ahb2_parent { + clocks = <&ahb2>; + clock-indices = <17>, <29>; + clock-output-names = "bus_gmac", "bus_ohci0"; + }; + apb1_parent { + clocks = <&apb1>; + clock-indices = <64>, <65>, + <69>, <72>, + <76>, <77>, + <78>; + clock-output-names = "bus_codec", "bus_spdif", + "bus_pio", "bus_ths", + "bus_i2s0", "bus_i2s1", + "bus_i2s2"; + }; + abp2_parent { + clocks = <&apb2>; + clock-indices = <96>, <97>, + <98>, <101>, + <112>, <113>, + <114>, <115>, + <116>; + clock-output-names = "bus_i2c0", "bus_i2c1", + "bus_i2c2", "bus_scr", + "bus_uart0", "bus_uart1", + "bus_uart2", "bus_uart3", + "bus_uart4"; + }; + }; diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi new file mode 100644 index 0000000..70d0382 --- /dev/null +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi @@ -0,0 +1,398 @@ +/* + * Copyright (C) 2016 ARM Ltd. + * based on the Allwinner H3 dtsi: + * Copyright (C) 2015 Jens Kuske <jenskuske@gmail.com> + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This file is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#include <dt-bindings/interrupt-controller/arm-gic.h> +#include <dt-bindings/pinctrl/sun4i-a10.h> + +/ { + interrupt-parent = <&gic>; + #address-cells = <1>; + #size-cells = <1>; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu0: cpu@0 { + compatible = "arm,cortex-a53", "arm,armv8"; + device_type = "cpu"; + reg = <0>; + enable-method = "psci"; + }; + + cpu1: cpu@1 { + compatible = "arm,cortex-a53", "arm,armv8"; + device_type = "cpu"; + reg = <1>; + enable-method = "psci"; + }; + + cpu2: cpu@2 { + compatible = "arm,cortex-a53", "arm,armv8"; + device_type = "cpu"; + reg = <2>; + enable-method = "psci"; + }; + + cpu3: cpu@3 { + compatible = "arm,cortex-a53", "arm,armv8"; + device_type = "cpu"; + reg = <3>; + enable-method = "psci"; + }; + }; + + pmu { + compatible = "arm,cortex-a53-pmu", "arm,armv8-pmuv3"; + interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>; + interrupt-affinity = <&cpu0>, + <&cpu1>, + <&cpu2>, + <&cpu3>; + }; + + psci { + compatible = "arm,psci-0.2"; + method = "smc"; + }; + + memory { + device_type = "memory"; + reg = <0x40000000 0>; + }; + + gic: interrupt-controller@1c81000 { + compatible = "arm,gic-400"; + interrupt-controller; + #interrupt-cells = <3>; + #address-cells = <0>; + + reg = <0x01c81000 0x1000>, + <0x01c82000 0x2000>, + <0x01c84000 0x2000>, + <0x01c86000 0x2000>; + interrupts = <GIC_PPI 9 + (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>; + }; + + timer { + compatible = "arm,armv8-timer"; + interrupts = <GIC_PPI 13 + (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>, + <GIC_PPI 14 + (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>, + <GIC_PPI 11 + (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>, + <GIC_PPI 10 + (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>; + }; + + /include/ "sun50i-a64-clocks.dtsi" + + soc { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + pio: pinctrl@1c20800 { + compatible = "allwinner,sun50i-a64-pinctrl"; + reg = <0x01c20800 0x400>; + interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&bus_gates 69>; + gpio-controller; + #gpio-cells = <3>; + interrupt-controller; + #interrupt-cells = <2>; + + uart0_pins_a: uart0@0 { + allwinner,pins = "PB8", "PB9"; + allwinner,function = "uart0"; + allwinner,drive = <SUN4I_PINCTRL_10_MA>; + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; + }; + + uart0_pins_b: uart0@1 { + allwinner,pins = "PF2", "PF3"; + allwinner,function = "uart0"; + allwinner,drive = <SUN4I_PINCTRL_10_MA>; + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; + }; + + uart1_2pins: uart1_2@0 { + allwinner,pins = "PG6", "PG7"; + allwinner,function = "uart1"; + allwinner,drive = <SUN4I_PINCTRL_10_MA>; + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; + }; + + uart1_4pins: uart1_4@0 { + allwinner,pins = "PG6", "PG7", "PG8", "PG9"; + allwinner,function = "uart1"; + allwinner,drive = <SUN4I_PINCTRL_10_MA>; + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; + }; + + uart2_2pins: uart2_2@0 { + allwinner,pins = "PB0", "PB1"; + allwinner,function = "uart2"; + allwinner,drive = <SUN4I_PINCTRL_10_MA>; + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; + }; + + uart2_4pins: uart2_4@0 { + allwinner,pins = "PB0", "PB1", "PB2", "PB3"; + allwinner,function = "uart2"; + allwinner,drive = <SUN4I_PINCTRL_10_MA>; + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; + }; + + uart3_pins_a: uart3@0 { + allwinner,pins = "PD0", "PD1"; + allwinner,function = "uart3"; + allwinner,drive = <SUN4I_PINCTRL_10_MA>; + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; + }; + + uart3_2pins_b: uart3_2@1 { + allwinner,pins = "PH4", "PH5"; + allwinner,function = "uart3"; + allwinner,drive = <SUN4I_PINCTRL_10_MA>; + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; + }; + + uart3_4pins_b: uart3_4@1 { + allwinner,pins = "PH4", "PH5", "PH6", "PH7"; + allwinner,function = "uart3"; + allwinner,drive = <SUN4I_PINCTRL_10_MA>; + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; + }; + + uart4_2pins: uart4_2@0 { + allwinner,pins = "PD2", "PD3"; + allwinner,function = "uart4"; + allwinner,drive = <SUN4I_PINCTRL_10_MA>; + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; + }; + + uart4_4pins: uart4_4@0 { + allwinner,pins = "PD2", "PD3", "PD4", "PD5"; + allwinner,function = "uart4"; + allwinner,drive = <SUN4I_PINCTRL_10_MA>; + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; + }; + + mmc0_pins: mmc0@0 { + allwinner,pins = "PF0", "PF1", "PF2", "PF3", + "PF4", "PF5"; + allwinner,function = "mmc0"; + allwinner,drive = <SUN4I_PINCTRL_30_MA>; + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; + }; + + mmc0_default_cd_pin: mmc0_cd_pin@0 { + allwinner,pins = "PF6"; + allwinner,function = "gpio_in"; + allwinner,drive = <SUN4I_PINCTRL_10_MA>; + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>; + }; + + mmc1_pins: mmc1@0 { + allwinner,pins = "PG0", "PG1", "PG2", "PG3", + "PG4", "PG5"; + allwinner,function = "mmc1"; + allwinner,drive = <SUN4I_PINCTRL_30_MA>; + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; + }; + + mmc2_pins: mmc2@0 { + allwinner,pins = "PC1", "PC5", "PC6", "PC8", + "PC9", "PC10", "PC11", "PC12", + "PC13", "PC14", "PC15", "PC16"; + allwinner,function = "mmc2"; + allwinner,drive = <SUN4I_PINCTRL_30_MA>; + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; + }; + + i2c0_pins: i2c0_pins { + allwinner,pins = "PH0", "PH1"; + allwinner,function = "i2c0"; + allwinner,drive = <SUN4I_PINCTRL_10_MA>; + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; + }; + + i2c1_pins: i2c1_pins { + allwinner,pins = "PH2", "PH3"; + allwinner,function = "i2c1"; + allwinner,drive = <SUN4I_PINCTRL_10_MA>; + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; + }; + + i2c2_pins: i2c2_pins { + allwinner,pins = "PE14", "PE15"; + allwinner,function = "i2c2"; + allwinner,drive = <SUN4I_PINCTRL_10_MA>; + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; + }; + }; + + ahb_rst: reset@1c202c0 { + #reset-cells = <1>; + compatible = "allwinner,sun6i-a31-clock-reset"; + reg = <0x01c202c0 0xc>; + }; + + apb1_rst: reset@1c202d0 { + #reset-cells = <1>; + compatible = "allwinner,sun6i-a31-clock-reset"; + reg = <0x01c202d0 0x4>; + }; + + apb2_rst: reset@1c202d8 { + #reset-cells = <1>; + compatible = "allwinner,sun6i-a31-clock-reset"; + reg = <0x01c202d8 0x4>; + }; + + uart0: serial@1c28000 { + compatible = "snps,dw-apb-uart"; + reg = <0x01c28000 0x400>; + interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>; + reg-shift = <2>; + reg-io-width = <4>; + clocks = <&bus_gates 112>; + resets = <&apb2_rst 16>; + status = "disabled"; + }; + + uart1: serial@1c28400 { + compatible = "snps,dw-apb-uart"; + reg = <0x01c28400 0x400>; + interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>; + reg-shift = <2>; + reg-io-width = <4>; + clocks = <&bus_gates 113>; + resets = <&apb2_rst 17>; + status = "disabled"; + }; + + uart2: serial@1c28800 { + compatible = "snps,dw-apb-uart"; + reg = <0x01c28800 0x400>; + interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>; + reg-shift = <2>; + reg-io-width = <4>; + clocks = <&bus_gates 114>; + resets = <&apb2_rst 18>; + status = "disabled"; + }; + + uart3: serial@1c28c00 { + compatible = "snps,dw-apb-uart"; + reg = <0x01c28c00 0x400>; + interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>; + reg-shift = <2>; + reg-io-width = <4>; + clocks = <&bus_gates 115>; + resets = <&apb2_rst 19>; + status = "disabled"; + }; + + uart4: serial@1c29000 { + compatible = "snps,dw-apb-uart"; + reg = <0x01c29000 0x400>; + interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>; + reg-shift = <2>; + reg-io-width = <4>; + clocks = <&bus_gates 116>; + resets = <&apb2_rst 20>; + status = "disabled"; + }; + + rtc: rtc@1f00000 { + compatible = "allwinner,sun6i-a31-rtc"; + reg = <0x01f00000 0x54>; + interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>; + }; + + i2c0: i2c@1c2ac00 { + compatible = "allwinner,sun6i-a31-i2c"; + reg = <0x01c2ac00 0x400>; + interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&bus_gates 96>; + resets = <&apb2_rst 0>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + + i2c1: i2c@1c2b000 { + compatible = "allwinner,sun6i-a31-i2c"; + reg = <0x01c2b000 0x400>; + interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&bus_gates 97>; + resets = <&apb2_rst 1>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + + i2c2: i2c@1c2b400 { + compatible = "allwinner,sun6i-a31-i2c"; + reg = <0x01c2b400 0x400>; + interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&bus_gates 98>; + resets = <&apb2_rst 2>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + }; +}; -- 2.9.0 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH v4 5/7] arm64: dts: add Allwinner A64 SoC .dtsi 2016-08-08 17:21 ` [PATCH v4 5/7] arm64: dts: add Allwinner A64 SoC .dtsi Andre Przywara @ 2016-08-10 20:00 ` Rob Herring 2016-08-23 20:03 ` Maxime Ripard 1 sibling, 0 replies; 16+ messages in thread From: Rob Herring @ 2016-08-10 20:00 UTC (permalink / raw) To: Andre Przywara Cc: Maxime Ripard, Chen-Yu Tsai, linux-sunxi, linux-arm-kernel, linux-kernel, Mark Rutland, devicetree On Mon, Aug 08, 2016 at 06:21:47PM +0100, Andre Przywara wrote: > The Allwinner A64 SoC is a low-cost chip with 4 ARM Cortex-A53 cores > and the typical tablet / TV box peripherals. > The SoC is based on the (32-bit) Allwinner H3 chip, sharing most of > the peripherals and the memory map. > Although the cores are proper 64-bit ones, the whole SoC is actually > limited to 4GB (including all the supported DRAM), so we use 32-bit > address and size cells. This has the nice feature of us being able to > reuse the DT for 32-bit kernels as well. > This .dtsi lists the hardware that we support so far. > > Signed-off-by: Andre Przywara <andre.przywara@arm.com> > --- > Hi, > > I dropped Rob's previous ACK, as there were quite some changes. > > Cheers, > Andre. > > Documentation/devicetree/bindings/arm/sunxi.txt | 1 + > .../boot/dts/allwinner/sun50i-a64-clocks.dtsi | 140 ++++++++ > arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 398 +++++++++++++++++++++ > 3 files changed, 539 insertions(+) > create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-clocks.dtsi > create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi > > diff --git a/Documentation/devicetree/bindings/arm/sunxi.txt b/Documentation/devicetree/bindings/arm/sunxi.txt > index 7e79fcc..7e59d8b 100644 > --- a/Documentation/devicetree/bindings/arm/sunxi.txt > +++ b/Documentation/devicetree/bindings/arm/sunxi.txt > @@ -14,3 +14,4 @@ using one of the following compatible strings: > allwinner,sun8i-a83t > allwinner,sun8i-h3 > allwinner,sun9i-a80 > + allwinner,sun50i-a64 > diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-clocks.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-clocks.dtsi > new file mode 100644 > index 0000000..9bfcd41 > --- /dev/null > +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-clocks.dtsi > @@ -0,0 +1,140 @@ > +/* > + * Allwinner A64 clocks > + * > + * Copyright (c) 2016 ARM Ltd > + * > + * This file is licensed under a dual GPLv2 or BSD license. > + * > + */ > + > + osc24M: osc24M_clk { Drop the '_' in the node names here and throughout. Rob ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v4 5/7] arm64: dts: add Allwinner A64 SoC .dtsi 2016-08-08 17:21 ` [PATCH v4 5/7] arm64: dts: add Allwinner A64 SoC .dtsi Andre Przywara 2016-08-10 20:00 ` Rob Herring @ 2016-08-23 20:03 ` Maxime Ripard 1 sibling, 0 replies; 16+ messages in thread From: Maxime Ripard @ 2016-08-23 20:03 UTC (permalink / raw) To: Andre Przywara Cc: Chen-Yu Tsai, linux-sunxi, linux-arm-kernel, linux-kernel, Rob Herring, Mark Rutland, devicetree [-- Attachment #1: Type: text/plain, Size: 6510 bytes --] Hi, On Mon, Aug 08, 2016 at 06:21:47PM +0100, Andre Przywara wrote: > + pmu { > + compatible = "arm,cortex-a53-pmu", "arm,armv8-pmuv3"; > + interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>, > + <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>, > + <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>, > + <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>; > + interrupt-affinity = <&cpu0>, > + <&cpu1>, > + <&cpu2>, > + <&cpu3>; > + }; The indentation looks off. > + > + psci { > + compatible = "arm,psci-0.2"; > + method = "smc"; > + }; > + > + memory { > + device_type = "memory"; > + reg = <0x40000000 0>; > + }; > + > + gic: interrupt-controller@1c81000 { > + compatible = "arm,gic-400"; > + interrupt-controller; > + #interrupt-cells = <3>; > + #address-cells = <0>; > + > + reg = <0x01c81000 0x1000>, > + <0x01c82000 0x2000>, > + <0x01c84000 0x2000>, > + <0x01c86000 0x2000>; > + interrupts = <GIC_PPI 9 > + (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>; > + }; > + > + timer { > + compatible = "arm,armv8-timer"; > + interrupts = <GIC_PPI 13 > + (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>, > + <GIC_PPI 14 > + (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>, > + <GIC_PPI 11 > + (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>, > + <GIC_PPI 10 > + (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>; > + }; > + > + /include/ "sun50i-a64-clocks.dtsi" > + > + soc { > + compatible = "simple-bus"; > + #address-cells = <1>; > + #size-cells = <1>; > + ranges; > + > + pio: pinctrl@1c20800 { > + compatible = "allwinner,sun50i-a64-pinctrl"; > + reg = <0x01c20800 0x400>; > + interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>, > + <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>, > + <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>; > + clocks = <&bus_gates 69>; > + gpio-controller; > + #gpio-cells = <3>; > + interrupt-controller; > + #interrupt-cells = <2>; > + > + uart0_pins_a: uart0@0 { > + allwinner,pins = "PB8", "PB9"; > + allwinner,function = "uart0"; > + allwinner,drive = <SUN4I_PINCTRL_10_MA>; > + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; > + }; > + > + uart0_pins_b: uart0@1 { > + allwinner,pins = "PF2", "PF3"; > + allwinner,function = "uart0"; > + allwinner,drive = <SUN4I_PINCTRL_10_MA>; > + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; > + }; > + > + uart1_2pins: uart1_2@0 { > + allwinner,pins = "PG6", "PG7"; > + allwinner,function = "uart1"; > + allwinner,drive = <SUN4I_PINCTRL_10_MA>; > + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; > + }; > + > + uart1_4pins: uart1_4@0 { > + allwinner,pins = "PG6", "PG7", "PG8", "PG9"; > + allwinner,function = "uart1"; > + allwinner,drive = <SUN4I_PINCTRL_10_MA>; > + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; > + }; > + > + uart2_2pins: uart2_2@0 { > + allwinner,pins = "PB0", "PB1"; > + allwinner,function = "uart2"; > + allwinner,drive = <SUN4I_PINCTRL_10_MA>; > + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; > + }; > + > + uart2_4pins: uart2_4@0 { > + allwinner,pins = "PB0", "PB1", "PB2", "PB3"; > + allwinner,function = "uart2"; > + allwinner,drive = <SUN4I_PINCTRL_10_MA>; > + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; > + }; > + > + uart3_pins_a: uart3@0 { > + allwinner,pins = "PD0", "PD1"; > + allwinner,function = "uart3"; > + allwinner,drive = <SUN4I_PINCTRL_10_MA>; > + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; > + }; > + > + uart3_2pins_b: uart3_2@1 { > + allwinner,pins = "PH4", "PH5"; > + allwinner,function = "uart3"; > + allwinner,drive = <SUN4I_PINCTRL_10_MA>; > + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; > + }; > + > + uart3_4pins_b: uart3_4@1 { > + allwinner,pins = "PH4", "PH5", "PH6", "PH7"; > + allwinner,function = "uart3"; > + allwinner,drive = <SUN4I_PINCTRL_10_MA>; > + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; > + }; > + > + uart4_2pins: uart4_2@0 { > + allwinner,pins = "PD2", "PD3"; > + allwinner,function = "uart4"; > + allwinner,drive = <SUN4I_PINCTRL_10_MA>; > + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; > + }; > + > + uart4_4pins: uart4_4@0 { > + allwinner,pins = "PD2", "PD3", "PD4", "PD5"; > + allwinner,function = "uart4"; > + allwinner,drive = <SUN4I_PINCTRL_10_MA>; > + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; > + }; > + > + mmc0_pins: mmc0@0 { > + allwinner,pins = "PF0", "PF1", "PF2", "PF3", > + "PF4", "PF5"; > + allwinner,function = "mmc0"; > + allwinner,drive = <SUN4I_PINCTRL_30_MA>; > + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; > + }; > + > + mmc0_default_cd_pin: mmc0_cd_pin@0 { > + allwinner,pins = "PF6"; > + allwinner,function = "gpio_in"; > + allwinner,drive = <SUN4I_PINCTRL_10_MA>; > + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>; > + }; > + > + mmc1_pins: mmc1@0 { > + allwinner,pins = "PG0", "PG1", "PG2", "PG3", > + "PG4", "PG5"; > + allwinner,function = "mmc1"; > + allwinner,drive = <SUN4I_PINCTRL_30_MA>; > + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; > + }; > + > + mmc2_pins: mmc2@0 { > + allwinner,pins = "PC1", "PC5", "PC6", "PC8", > + "PC9", "PC10", "PC11", "PC12", > + "PC13", "PC14", "PC15", "PC16"; > + allwinner,function = "mmc2"; > + allwinner,drive = <SUN4I_PINCTRL_30_MA>; > + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; > + }; > + > + i2c0_pins: i2c0_pins { > + allwinner,pins = "PH0", "PH1"; > + allwinner,function = "i2c0"; > + allwinner,drive = <SUN4I_PINCTRL_10_MA>; > + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; > + }; > + > + i2c1_pins: i2c1_pins { > + allwinner,pins = "PH2", "PH3"; > + allwinner,function = "i2c1"; > + allwinner,drive = <SUN4I_PINCTRL_10_MA>; > + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; > + }; > + > + i2c2_pins: i2c2_pins { > + allwinner,pins = "PE14", "PE15"; > + allwinner,function = "i2c2"; > + allwinner,drive = <SUN4I_PINCTRL_10_MA>; > + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; > + }; > + }; Our policy is that we only add the pinctrl nodes that we actually use in boards to avoid bloating the DT with unused nodes. Thanks, Maxime -- Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v4 6/7] arm64: dts: add Pine64 support 2016-08-08 17:21 [PATCH v4 0/7] arm64: Allwinner A64 support Andre Przywara ` (4 preceding siblings ...) 2016-08-08 17:21 ` [PATCH v4 5/7] arm64: dts: add Allwinner A64 SoC .dtsi Andre Przywara @ 2016-08-08 17:21 ` Andre Przywara 2016-08-24 18:24 ` Maxime Ripard 2016-08-08 17:21 ` [PATCH v4 7/7] arm64: dts: add BananaPi M64 support Andre Przywara 6 siblings, 1 reply; 16+ messages in thread From: Andre Przywara @ 2016-08-08 17:21 UTC (permalink / raw) To: Maxime Ripard, Chen-Yu Tsai Cc: linux-sunxi, linux-arm-kernel, linux-kernel, Rob Herring, Mark Rutland, devicetree The Pine64 is a cost-efficient development board based on the Allwinner A64 SoC. There are three models: the basic version with Fast Ethernet and 512 MB of DRAM (Pine64) and two Pine64+ versions, which both feature Gigabit Ethernet and additional connectors for touchscreens and a camera. Or as my son put it: "Those are smaller and these are missing." ;-) The two Pine64+ models just differ in the amount of DRAM (1GB vs. 2GB). Since U-Boot will figure out the right size for us and patches the DT accordingly we just need to provide one DT for the Pine64+. [Maxime: Removed the common DTSI and include directly the pine64 DTS] Signed-off-by: Andre Przywara <andre.przywara@arm.com> --- arch/arm64/boot/dts/Makefile | 1 + arch/arm64/boot/dts/allwinner/Makefile | 5 ++ .../boot/dts/allwinner/sun50i-a64-pine64-plus.dts | 48 ++++++++++++++ .../arm64/boot/dts/allwinner/sun50i-a64-pine64.dts | 74 ++++++++++++++++++++++ 4 files changed, 128 insertions(+) create mode 100644 arch/arm64/boot/dts/allwinner/Makefile create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-plus.dts create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts diff --git a/arch/arm64/boot/dts/Makefile b/arch/arm64/boot/dts/Makefile index 6e199c9..ddcbf5a 100644 --- a/arch/arm64/boot/dts/Makefile +++ b/arch/arm64/boot/dts/Makefile @@ -1,4 +1,5 @@ dts-dirs += al +dts-dirs += allwinner dts-dirs += altera dts-dirs += amd dts-dirs += amlogic diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile new file mode 100644 index 0000000..1e29a5a --- /dev/null +++ b/arch/arm64/boot/dts/allwinner/Makefile @@ -0,0 +1,5 @@ +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pine64-plus.dtb sun50i-a64-pine64.dtb + +always := $(dtb-y) +subdir-y := $(dts-dirs) +clean-files := *.dtb diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-plus.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-plus.dts new file mode 100644 index 0000000..e369e83 --- /dev/null +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-plus.dts @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2016 ARM Ltd. + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#include "sun50i-a64-pine64.dts" + +/ { + model = "Pine64+"; + compatible = "pine64,pine64-plus", "allwinner,sun50i-a64"; +}; diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts new file mode 100644 index 0000000..077a56f --- /dev/null +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2016 ARM Ltd. + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/dts-v1/; + +#include "sun50i-a64.dtsi" + +/ { + model = "Pine64"; + compatible = "pine64,pine64", "allwinner,sun50i-a64"; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + memory { + reg = <0x40000000 0x20000000>; + }; + + aliases { + serial0 = &uart0; + }; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins_a>; + status = "okay"; +}; + +&i2c1 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c1_pins>; + status = "okay"; +}; -- 2.9.0 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH v4 6/7] arm64: dts: add Pine64 support 2016-08-08 17:21 ` [PATCH v4 6/7] arm64: dts: add Pine64 support Andre Przywara @ 2016-08-24 18:24 ` Maxime Ripard 0 siblings, 0 replies; 16+ messages in thread From: Maxime Ripard @ 2016-08-24 18:24 UTC (permalink / raw) To: Andre Przywara Cc: Chen-Yu Tsai, linux-sunxi, linux-arm-kernel, linux-kernel, Rob Herring, Mark Rutland, devicetree [-- Attachment #1: Type: text/plain, Size: 7497 bytes --] Hi, On Mon, Aug 08, 2016 at 06:21:48PM +0100, Andre Przywara wrote: > The Pine64 is a cost-efficient development board based on the > Allwinner A64 SoC. > There are three models: the basic version with Fast Ethernet and > 512 MB of DRAM (Pine64) and two Pine64+ versions, which both > feature Gigabit Ethernet and additional connectors for touchscreens > and a camera. Or as my son put it: "Those are smaller and these are > missing." ;-) > The two Pine64+ models just differ in the amount of DRAM > (1GB vs. 2GB). Since U-Boot will figure out the right size for us and > patches the DT accordingly we just need to provide one DT for the > Pine64+. > > [Maxime: Removed the common DTSI and include directly the pine64 DTS] > Signed-off-by: Andre Przywara <andre.przywara@arm.com> > --- > arch/arm64/boot/dts/Makefile | 1 + > arch/arm64/boot/dts/allwinner/Makefile | 5 ++ > .../boot/dts/allwinner/sun50i-a64-pine64-plus.dts | 48 ++++++++++++++ > .../arm64/boot/dts/allwinner/sun50i-a64-pine64.dts | 74 ++++++++++++++++++++++ > 4 files changed, 128 insertions(+) > create mode 100644 arch/arm64/boot/dts/allwinner/Makefile > create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-plus.dts > create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts > > diff --git a/arch/arm64/boot/dts/Makefile b/arch/arm64/boot/dts/Makefile > index 6e199c9..ddcbf5a 100644 > --- a/arch/arm64/boot/dts/Makefile > +++ b/arch/arm64/boot/dts/Makefile > @@ -1,4 +1,5 @@ > dts-dirs += al > +dts-dirs += allwinner > dts-dirs += altera > dts-dirs += amd > dts-dirs += amlogic > diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile > new file mode 100644 > index 0000000..1e29a5a > --- /dev/null > +++ b/arch/arm64/boot/dts/allwinner/Makefile > @@ -0,0 +1,5 @@ > +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pine64-plus.dtb sun50i-a64-pine64.dtb > + > +always := $(dtb-y) > +subdir-y := $(dts-dirs) > +clean-files := *.dtb > diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-plus.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-plus.dts > new file mode 100644 > index 0000000..e369e83 > --- /dev/null > +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-plus.dts > @@ -0,0 +1,48 @@ > +/* > + * Copyright (c) 2016 ARM Ltd. > + * > + * This file is dual-licensed: you can use it either under the terms > + * of the GPL or the X11 license, at your option. Note that this dual > + * licensing only applies to this file, and not this project as a > + * whole. > + * > + * a) This library is free software; you can redistribute it and/or > + * modify it under the terms of the GNU General Public License as > + * published by the Free Software Foundation; either version 2 of the > + * License, or (at your option) any later version. > + * > + * This library is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * Or, alternatively, > + * > + * b) Permission is hereby granted, free of charge, to any person > + * obtaining a copy of this software and associated documentation > + * files (the "Software"), to deal in the Software without > + * restriction, including without limitation the rights to use, > + * copy, modify, merge, publish, distribute, sublicense, and/or > + * sell copies of the Software, and to permit persons to whom the > + * Software is furnished to do so, subject to the following > + * conditions: > + * > + * The above copyright notice and this permission notice shall be > + * included in all copies or substantial portions of the Software. > + * > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, > + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES > + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND > + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT > + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, > + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR > + * OTHER DEALINGS IN THE SOFTWARE. > + */ > + > +#include "sun50i-a64-pine64.dts" > + > +/ { > + model = "Pine64+"; > + compatible = "pine64,pine64-plus", "allwinner,sun50i-a64"; > +}; > diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts > new file mode 100644 > index 0000000..077a56f > --- /dev/null > +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts > @@ -0,0 +1,74 @@ > +/* > + * Copyright (c) 2016 ARM Ltd. > + * > + * This file is dual-licensed: you can use it either under the terms > + * of the GPL or the X11 license, at your option. Note that this dual > + * licensing only applies to this file, and not this project as a > + * whole. > + * > + * a) This library is free software; you can redistribute it and/or > + * modify it under the terms of the GNU General Public License as > + * published by the Free Software Foundation; either version 2 of the > + * License, or (at your option) any later version. > + * > + * This library is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * Or, alternatively, > + * > + * b) Permission is hereby granted, free of charge, to any person > + * obtaining a copy of this software and associated documentation > + * files (the "Software"), to deal in the Software without > + * restriction, including without limitation the rights to use, > + * copy, modify, merge, publish, distribute, sublicense, and/or > + * sell copies of the Software, and to permit persons to whom the > + * Software is furnished to do so, subject to the following > + * conditions: > + * > + * The above copyright notice and this permission notice shall be > + * included in all copies or substantial portions of the Software. > + * > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, > + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES > + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND > + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT > + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, > + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR > + * OTHER DEALINGS IN THE SOFTWARE. > + */ > + > +/dts-v1/; > + > +#include "sun50i-a64.dtsi" > + > +/ { > + model = "Pine64"; > + compatible = "pine64,pine64", "allwinner,sun50i-a64"; > + > + chosen { > + stdout-path = "serial0:115200n8"; > + }; > + > + memory { > + reg = <0x40000000 0x20000000>; > + }; Isn't that wrong on some Pine64, and filled by U-Boot anyway? Maxime -- Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v4 7/7] arm64: dts: add BananaPi M64 support 2016-08-08 17:21 [PATCH v4 0/7] arm64: Allwinner A64 support Andre Przywara ` (5 preceding siblings ...) 2016-08-08 17:21 ` [PATCH v4 6/7] arm64: dts: add Pine64 support Andre Przywara @ 2016-08-08 17:21 ` Andre Przywara 6 siblings, 0 replies; 16+ messages in thread From: Andre Przywara @ 2016-08-08 17:21 UTC (permalink / raw) To: Maxime Ripard, Chen-Yu Tsai Cc: linux-sunxi, linux-arm-kernel, linux-kernel, Rob Herring, Mark Rutland, devicetree The BananaPi M64 is a single board computer with an Allwinner A64 SoC. In addition to the usual suspects it contains Gigabit Ethernet, 2GB RAM, an eMMC and a WiFi chip (which are not yet supported by this patch). Signed-off-by: Andre Przywara <andre.przywara@arm.com> --- arch/arm64/boot/dts/allwinner/Makefile | 1 + .../boot/dts/allwinner/sun50i-a64-bananapi-m64.dts | 74 ++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile index 1e29a5a..51ecb04 100644 --- a/arch/arm64/boot/dts/allwinner/Makefile +++ b/arch/arm64/boot/dts/allwinner/Makefile @@ -1,4 +1,5 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pine64-plus.dtb sun50i-a64-pine64.dtb +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-bananapi-m64.dtb always := $(dtb-y) subdir-y := $(dts-dirs) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts new file mode 100644 index 0000000..bc0ed4c --- /dev/null +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2016 ARM Ltd. + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/dts-v1/; + +#include "sun50i-a64.dtsi" + +/ { + model = "BananaPi-M64"; + compatible = "sinovoip,bananapi-m64", "allwinner,sun50i-a64"; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + memory { + reg = <0x40000000 0x80000000>; + }; + + aliases { + serial0 = &uart0; + }; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins_a>; + status = "okay"; +}; + +&i2c1 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c1_pins>; + status = "okay"; +}; -- 2.9.0 ^ permalink raw reply related [flat|nested] 16+ messages in thread
end of thread, other threads:[~2016-08-24 18:49 UTC | newest] Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2016-08-08 17:21 [PATCH v4 0/7] arm64: Allwinner A64 support Andre Przywara 2016-08-08 17:21 ` [PATCH v4 1/7] arm64: sunxi: Kconfig: add essential pinctrl driver Andre Przywara 2016-08-23 19:37 ` Maxime Ripard 2016-08-08 17:21 ` [PATCH v4 2/7] DT: clk: sunxi: add binding doc for the multi-bus-gates clock Andre Przywara 2016-08-08 17:21 ` [PATCH v4 3/7] clk: sunxi: add generic multi-parent bus clock gates driver Andre Przywara 2016-08-08 18:15 ` Jean-Francois Moine 2016-08-09 10:02 ` [linux-sunxi] " Chen-Yu Tsai 2016-08-09 17:27 ` Jean-Francois Moine 2016-08-23 20:00 ` Maxime Ripard 2016-08-08 17:21 ` [PATCH v4 4/7] of: add vendor prefix for Pine64 Andre Przywara 2016-08-08 17:21 ` [PATCH v4 5/7] arm64: dts: add Allwinner A64 SoC .dtsi Andre Przywara 2016-08-10 20:00 ` Rob Herring 2016-08-23 20:03 ` Maxime Ripard 2016-08-08 17:21 ` [PATCH v4 6/7] arm64: dts: add Pine64 support Andre Przywara 2016-08-24 18:24 ` Maxime Ripard 2016-08-08 17:21 ` [PATCH v4 7/7] arm64: dts: add BananaPi M64 support Andre Przywara
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).