[linux-sunxi] Re: [PATCH v2 15/20] drm/sun4i: Ignore the generic connectors for components

2017-05-03 Thread Chen-Yu Tsai
On Wed, May 3, 2017 at 7:59 PM, Maxime Ripard wrote: > The generic connectors such as hdmi-connector doesn't have any driver in, > so if they are added to the component list, we will be waiting forever for > a non-existing driver to probe. > > Add a list of the connectors we want to ignore when bu

[linux-sunxi] Re: [PATCH v2 14/20] drm/sun4i: tcon: multiply the vtotal when not in interlace

2017-05-03 Thread Chen-Yu Tsai
On Wed, May 3, 2017 at 7:59 PM, Maxime Ripard wrote: > It appears that the total vertical resolution needs to be doubled when > we're not in interlaced. Make sure that is the case. I think the total vertical resolution needs to be doubled in all cases. It just happens that you should've been usin

[linux-sunxi] Re: [PATCH v2 13/20] drm/sun4i: tcon: Change vertical total size computation inconsistency

2017-05-03 Thread Chen-Yu Tsai
On Wed, May 3, 2017 at 7:59 PM, Maxime Ripard wrote: > Both TCON channels need to have the resolution doubled, since the size the > hardware is going to use is whatever we put in the register divided by two. > > However, we handle it differently for the two channels: in the channel 0, > our regist

[linux-sunxi] Re: [PATCH v2 11/20] drm/sun4i: tcon: Switch mux on only for composite

2017-05-03 Thread Chen-Yu Tsai
On Wed, May 3, 2017 at 7:59 PM, Maxime Ripard wrote: > Even though that mux is undocumented, it seems like it needs to be set to 1 > when using composite, and 0 when using HDMI. > > Signed-off-by: Maxime Ripard Acked-by: Chen-Yu Tsai -- You received this message because you are subscribed to

[linux-sunxi] Re: [PATCH v2 10/20] drm/sun4i: tcon: Move the muxing out of the mode set function

2017-05-03 Thread Chen-Yu Tsai
On Wed, May 3, 2017 at 7:59 PM, Maxime Ripard wrote: > The muxing can actually happen on both channels on some SoCs, so it makes > more sense to just move it out of the sun4i_tcon1_mode_set function and > create a separate function that needs to be called by the encoders. > > Let's do that and con

[linux-sunxi] Re: [PATCH v2 8/20] clk: sunxi-ng: sun5i: Export video PLLs

2017-05-03 Thread Chen-Yu Tsai
On Wed, May 3, 2017 at 7:59 PM, Maxime Ripard wrote: > The video PLLs are used directly by the HDMI controller. Export them so > that we can use them in our DT node. > > Signed-off-by: Maxime Ripard Acked-by: Chen-Yu Tsai -- You received this message because you are subscribed to the Google G

[linux-sunxi] Re: [PATCH v2 7/20] clk: sunxi-ng: mux: Re-adjust parent rate

2017-05-03 Thread Chen-Yu Tsai
On Wed, May 3, 2017 at 7:59 PM, Maxime Ripard wrote: > Currently, the parent rate given back to the clock framework in our > request is the original parent rate we calculated before trying to round > the rate of our clock. > > This works fine unless our clock also changes its parent rate, in which

[linux-sunxi] Re: [PATCH v2 6/20] clk: sunxi-ng: mux: Change pre-divider application function prototype

2017-05-03 Thread Chen-Yu Tsai
On Wed, May 3, 2017 at 7:59 PM, Maxime Ripard wrote: > The current function name is a bit confusing, and doesn't really allow to > create an explicit function to reverse the operation. > > We also for now change the parent rate through a pointer, while we don't > return anything. > > In order to b

[linux-sunxi] Re: [PATCH v2 5/20] clk: sunxi-ng: mux: split out the pre-divider computation code

2017-05-03 Thread Chen-Yu Tsai
On Wed, May 3, 2017 at 7:59 PM, Maxime Ripard wrote: > The pre-divider retrieval code was merged into the function to apply the > current pre-divider onto the parent clock rate so that we can use that > adjusted value to do our factors computation. > > However, since we'll need to do the reverse o

[linux-sunxi] Re: [PATCH v2 4/20] clk: sunxi-ng: mux: Don't just rely on the parent for CLK_SET_RATE_PARENT

2017-05-03 Thread Chen-Yu Tsai
On Wed, May 3, 2017 at 7:59 PM, Maxime Ripard wrote: > The current code only rely on the parent to change its rate in the case > where CLK_SET_RATE_PARENT is set. > > However, some clock rates might be obtained only through a modification of > the parent and the clock divider. Just rely on the rou

[linux-sunxi] Re: [PATCH v2 3/20] clk: sunxi-ng: div: Switch to divider_round_rate

2017-05-03 Thread Chen-Yu Tsai
On Wed, May 3, 2017 at 7:59 PM, Maxime Ripard wrote: > divider_round_rate already evaluates changing the parent rate if ^^^ Might want to update this, as you are now using the new function you added in patch 1. > CLK_SET_RATE_PARENT is set. Now that we can do that on muxes too, let's > j

[linux-sunxi] Re: [PATCH v2 2/20] clk: sunxi-ng: Pass the parent and a pointer to the clocks round rate

2017-05-03 Thread Chen-Yu Tsai
On Wed, May 3, 2017 at 7:59 PM, Maxime Ripard wrote: > The clocks might need to modify their parent clocks. In order to make that > possible, give them access to the parent clock being evaluated, and to a > pointer to the parent rate so that they can modify it if needed. > > Signed-off-by: Maxime

[linux-sunxi] Re: [PATCH v2 3/8] clk: sunxi-ng: Add class of phase clocks supporting MMC new timing modes

2017-05-03 Thread Chen-Yu Tsai
Hi, On Thu, May 4, 2017 at 4:34 AM, Maxime Ripard wrote: > Hi, > > On Wed, May 03, 2017 at 11:16:53AM +0800, Chen-Yu Tsai wrote: >> The MMC clocks on newer SoCs, such as the A83T and H3, support the >> "new timing mode". Under this mode, the output of the clock is divided >> by 2, and the clock d

[linux-sunxi] [PATCH] pinctrl: use non-devm kmalloc versions for free functions

2017-05-03 Thread Andre Przywara
When a pinctrl driver gets interrupted during its probe process (returning -EPROBE_DEFER), the devres system cleans up all allocated resources. During this process it calls pinmux_generic_free_functions() and pinctrl_generic_free_groups(), which in turn use managed kmalloc calls for temporarily all

[linux-sunxi] Re: [PATCH v2 3/8] clk: sunxi-ng: Add class of phase clocks supporting MMC new timing modes

2017-05-03 Thread Maxime Ripard
Hi, On Wed, May 03, 2017 at 11:16:53AM +0800, Chen-Yu Tsai wrote: > The MMC clocks on newer SoCs, such as the A83T and H3, support the > "new timing mode". Under this mode, the output of the clock is divided > by 2, and the clock delays no longer apply. > > Due to how the clock tree is modeled an

[linux-sunxi] Re: [PATCH] clk: sunxi-ng: a31: Correct lcd1-ch1 clock register offset

2017-05-03 Thread Maxime Ripard
On Wed, May 03, 2017 at 11:13:46AM +0800, Chen-Yu Tsai wrote: > The register offset for the lcd1-ch1 clock was incorrectly pointing to > the lcd0-ch1 clock. This resulted in the lcd0-ch1 clock being disabled > when the clk core disables unused clocks. This then stops the simplefb > HDMI output path

Re: [linux-sunxi] Re: [PATCH] sun7i: Add support for Olimex A20-OLinuXino-LIME2-eMMC

2017-05-03 Thread Icenowy Zheng
于 2017年5月4日 GMT+08:00 上午12:50:52, Jagan Teki 写到: >On Wednesday 03 May 2017 05:48 PM, Olliver Schinagl wrote: >> This patch adds support for the Olimex OLinuXino Lime2 with eMMC >flash >> storage. >> >https://www.olimex.com/Products/OLinuXino/A20/A20-OLinuXino-LIME2-eMMC/ >> >> It is a assembly v

[linux-sunxi] Re: [PATCH] sun7i: Add support for Olimex A20-OLinuXino-LIME2-eMMC

2017-05-03 Thread Jagan Teki
On Wednesday 03 May 2017 05:48 PM, Olliver Schinagl wrote: This patch adds support for the Olimex OLinuXino Lime2 with eMMC flash storage. https://www.olimex.com/Products/OLinuXino/A20/A20-OLinuXino-LIME2-eMMC/ It is a assembly variant of the regular Lime2 but featuring eMMC for storage. Signed

[linux-sunxi] Re: [U-Boot] [PATCH] sunxi: add support for Banana Pi M2 Plus board

2017-05-03 Thread Jagan Teki
On Wed, May 3, 2017 at 9:15 PM, Icenowy Zheng wrote: > Banana Pi M2 Plus is an Allwinner H3-based SBC by Sinovoip, which has > already mainline device tree file that have landed into U-Boot source > tree. > > Add a defconfig file for it and add the MAINTAINERS items. > > Signed-off-by: Icenowy Zhe

[linux-sunxi] [PATCH] sunxi: add support for Banana Pi M2 Plus board

2017-05-03 Thread Icenowy Zheng
Banana Pi M2 Plus is an Allwinner H3-based SBC by Sinovoip, which has already mainline device tree file that have landed into U-Boot source tree. Add a defconfig file for it and add the MAINTAINERS items. Signed-off-by: Icenowy Zheng --- board/sunxi/MAINTAINERS| 5 + config

Re: [linux-sunxi] Designware UART bug

2017-05-03 Thread Olliver Schinagl
Hey Tim, On 03-05-17 16:22, Tim Kryger wrote: On Wed, May 3, 2017 at 4:26 AM, Olliver Schinagl wrote: Hey Chen-Yu On 03-05-17 12:40, Chen-Yu Tsai wrote: On Wed, May 3, 2017 at 6:17 PM, Olliver Schinagl wrote: Hey Jamie, Several years ago you wrote the glue-code [0] for the DW 8250 IP. O

[linux-sunxi] [PATCHv2] sun7i: Add support for Olimex A20-OLinuXino-LIME2-eMMC

2017-05-03 Thread Olliver Schinagl
This patch adds support for the Olimex OLinuXino Lime2 with eMMC flash storage. https://www.olimex.com/Products/OLinuXino/A20/A20-OLinuXino-LIME2-eMMC/ It is a assembly variant of the regular Lime2 but featuring eMMC for storage. Signed-off-by: Olliver Schinagl --- Jagan, I was fairly certain t

[linux-sunxi] Re: [U-Boot] [PATCH] sun7i: Add support for Olimex A20-OLinuXino-LIME2-eMMC

2017-05-03 Thread Jagan Teki
On Wed, May 3, 2017 at 5:48 PM, Olliver Schinagl wrote: > This patch adds support for the Olimex OLinuXino Lime2 with eMMC flash > storage. > https://www.olimex.com/Products/OLinuXino/A20/A20-OLinuXino-LIME2-eMMC/ > > It is a assembly variant of the regular Lime2 but featuring eMMC for > storage.

[linux-sunxi] Re: [PATCH v2 1/20] clk: divider: Make divider_round_rate take the parent clock

2017-05-03 Thread Chen-Yu Tsai
On Wed, May 3, 2017 at 7:59 PM, Maxime Ripard wrote: > So far, divider_round_rate only considers the parent clock returned by > clk_hw_get_parent. > > This works fine on clocks that have a single parents, this doesn't work on > muxes, since we will only consider the first parent, while other paren

[linux-sunxi] [PATCH] sun7i: Add support for Olimex A20-OLinuXino-LIME2-eMMC

2017-05-03 Thread Olliver Schinagl
This patch adds support for the Olimex OLinuXino Lime2 with eMMC flash storage. https://www.olimex.com/Products/OLinuXino/A20/A20-OLinuXino-LIME2-eMMC/ It is a assembly variant of the regular Lime2 but featuring eMMC for storage. Signed-off-by: Olliver Schinagl --- Note: for the board to work p

[linux-sunxi] [PATCH v2 16/20] dt-bindings: display: sun4i: Add HDMI display bindings

2017-05-03 Thread Maxime Ripard
One of the possible output of the display pipeline, on the SoCs that have it, is the HDMI controller. Add a binding for it. Acked-by: Chen-Yu Tsai Signed-off-by: Maxime Ripard --- Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt | 79 +++- 1 file changed, 79 insertions(+), 0 d

[linux-sunxi] [PATCH v2 15/20] drm/sun4i: Ignore the generic connectors for components

2017-05-03 Thread Maxime Ripard
The generic connectors such as hdmi-connector doesn't have any driver in, so if they are added to the component list, we will be waiting forever for a non-existing driver to probe. Add a list of the connectors we want to ignore when building our component list. Signed-off-by: Maxime Ripard ---

[linux-sunxi] [PATCH v2 14/20] drm/sun4i: tcon: multiply the vtotal when not in interlace

2017-05-03 Thread Maxime Ripard
It appears that the total vertical resolution needs to be doubled when we're not in interlaced. Make sure that is the case. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/sun4i/sun4i_tcon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon

[linux-sunxi] [PATCH v2 13/20] drm/sun4i: tcon: Change vertical total size computation inconsistency

2017-05-03 Thread Maxime Ripard
Both TCON channels need to have the resolution doubled, since the size the hardware is going to use is whatever we put in the register divided by two. However, we handle it differently for the two channels: in the channel 0, our register access macro does the multiplication of the value passed as

[linux-sunxi] [PATCH v2 2/20] clk: sunxi-ng: Pass the parent and a pointer to the clocks round rate

2017-05-03 Thread Maxime Ripard
The clocks might need to modify their parent clocks. In order to make that possible, give them access to the parent clock being evaluated, and to a pointer to the parent rate so that they can modify it if needed. Signed-off-by: Maxime Ripard --- drivers/clk/sunxi-ng/ccu_div.c | 7 --- driv

[linux-sunxi] [PATCH v2 4/20] clk: sunxi-ng: mux: Don't just rely on the parent for CLK_SET_RATE_PARENT

2017-05-03 Thread Maxime Ripard
The current code only rely on the parent to change its rate in the case where CLK_SET_RATE_PARENT is set. However, some clock rates might be obtained only through a modification of the parent and the clock divider. Just rely on the round rate of the clocks to give us the best computation that migh

[linux-sunxi] [PATCH v2 9/20] drm/sun4i: tcon: Add channel debug

2017-05-03 Thread Maxime Ripard
While all functions have debug logs, the channel enable and disable are not logged. Make sure this is the case. Acked-by: Chen-Yu Tsai Signed-off-by: Maxime Ripard --- drivers/gpu/drm/sun4i/sun4i_tcon.c | 4 1 file changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/sun4

[linux-sunxi] [PATCH v2 20/20] ARM: sun5i: a10s-olinuxino: Enable HDMI

2017-05-03 Thread Maxime Ripard
The A10s Olinuxino has an HDMI connector. Make sure we can use it. Acked-by: Chen-Yu Tsai Signed-off-by: Maxime Ripard --- arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts | 29 +- 1 file changed, 29 insertions(+), 0 deletions(-) diff --git a/arch/arm/boot/dts/sun5i-a10s-olinux

[linux-sunxi] [PATCH v2 11/20] drm/sun4i: tcon: Switch mux on only for composite

2017-05-03 Thread Maxime Ripard
Even though that mux is undocumented, it seems like it needs to be set to 1 when using composite, and 0 when using HDMI. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/sun4i/sun4i_tcon.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_tc

[linux-sunxi] [PATCH v2 10/20] drm/sun4i: tcon: Move the muxing out of the mode set function

2017-05-03 Thread Maxime Ripard
The muxing can actually happen on both channels on some SoCs, so it makes more sense to just move it out of the sun4i_tcon1_mode_set function and create a separate function that needs to be called by the encoders. Let's do that and convert the existing drivers. Signed-off-by: Maxime Ripard ---

[linux-sunxi] [PATCH v2 12/20] drm/sun4i: tcon: Fix tcon channel 1 backporch calculation

2017-05-03 Thread Maxime Ripard
It seems like what's called a backporch in the datasheet is actually the backporch plus the sync period. Fix that in our driver. Acked-by: Chen-Yu Tsai Signed-off-by: Maxime Ripard --- drivers/gpu/drm/sun4i/sun4i_tcon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dri

[linux-sunxi] [PATCH v2 17/20] dt-bindings: display: sun4i: Add allwinner,tcon-channel property

2017-05-03 Thread Maxime Ripard
The Allwinner Timings Controller has two, mutually exclusive, channels. When the binding has been introduced, it was assumed that there would be only a single user per channel in the system. While this is likely for the channel 0 which only connects to LCD displays, it turns out that the channel 1

[linux-sunxi] [PATCH v2 8/20] clk: sunxi-ng: sun5i: Export video PLLs

2017-05-03 Thread Maxime Ripard
The video PLLs are used directly by the HDMI controller. Export them so that we can use them in our DT node. Signed-off-by: Maxime Ripard --- drivers/clk/sunxi-ng/ccu-sun5i.h | 6 -- include/dt-bindings/clock/sun5i-ccu.h | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --

[linux-sunxi] [PATCH v2 19/20] ARM: sun5i: a10s: Add the HDMI controller node

2017-05-03 Thread Maxime Ripard
The A10s has an HDMI controller connected to the second TCON channel. Add it to our DT. Since the TV Encoder was the only channel 1 user so far, also add the property now that we have several users. Signed-off-by: Maxime Ripard --- arch/arm/boot/dts/sun5i-a10s.dtsi | 50

[linux-sunxi] [PATCH v2 3/20] clk: sunxi-ng: div: Switch to divider_round_rate

2017-05-03 Thread Maxime Ripard
divider_round_rate already evaluates changing the parent rate if CLK_SET_RATE_PARENT is set. Now that we can do that on muxes too, let's just use it. Signed-off-by: Maxime Ripard --- drivers/clk/sunxi-ng/ccu_div.c | 27 --- 1 file changed, 4 insertions(+), 23 deletions(-)

[linux-sunxi] [PATCH v2 1/20] clk: divider: Make divider_round_rate take the parent clock

2017-05-03 Thread Maxime Ripard
So far, divider_round_rate only considers the parent clock returned by clk_hw_get_parent. This works fine on clocks that have a single parents, this doesn't work on muxes, since we will only consider the first parent, while other parents may totally be able to provide a better combination. Clocks

[linux-sunxi] [PATCH v2 5/20] clk: sunxi-ng: mux: split out the pre-divider computation code

2017-05-03 Thread Maxime Ripard
The pre-divider retrieval code was merged into the function to apply the current pre-divider onto the parent clock rate so that we can use that adjusted value to do our factors computation. However, since we'll need to do the reverse operation, we need to split out that code into a function that w

[linux-sunxi] [PATCH v2 0/20] drm: sun4i: Add support for the HDMI controller

2017-05-03 Thread Maxime Ripard
Hi, Here is an attempt at getting the HDMI controller running. This HDMI controller is found on a number of old Allwinner SoCs (A10, A10s, A20, A31). This driver only supports for now the A10s because it was an easy target, being very close to the A13 that is already supported by our DRM driver.

[linux-sunxi] [PATCH v2 18/20] drm/sun4i: Add HDMI support

2017-05-03 Thread Maxime Ripard
The earlier Allwinner SoCs (A10, A10s, A20, A31) have an embedded HDMI controller. That HDMI controller is able to do audio and CEC, but those have been left out for now. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/sun4i/Kconfig | 9 +- drivers/gpu/drm/sun4i/Makefile

[linux-sunxi] [PATCH v2 6/20] clk: sunxi-ng: mux: Change pre-divider application function prototype

2017-05-03 Thread Maxime Ripard
The current function name is a bit confusing, and doesn't really allow to create an explicit function to reverse the operation. We also for now change the parent rate through a pointer, while we don't return anything. In order to be less confusing, and easier to use for downstream users, change t

[linux-sunxi] [PATCH v2 7/20] clk: sunxi-ng: mux: Re-adjust parent rate

2017-05-03 Thread Maxime Ripard
Currently, the parent rate given back to the clock framework in our request is the original parent rate we calculated before trying to round the rate of our clock. This works fine unless our clock also changes its parent rate, in which case we will simply ignore that change and still use the previ

Re: [linux-sunxi] Designware UART bug

2017-05-03 Thread Olliver Schinagl
Hey Chen-Yu On 03-05-17 12:40, Chen-Yu Tsai wrote: On Wed, May 3, 2017 at 6:17 PM, Olliver Schinagl wrote: Hey Jamie, Several years ago you wrote the glue-code [0] for the DW 8250 IP. Over the years various 'fixes' have been applied to resolve certain 'weird' problems that Tim tried to fix wi

Re: [linux-sunxi] Designware UART bug

2017-05-03 Thread Chen-Yu Tsai
On Wed, May 3, 2017 at 6:17 PM, Olliver Schinagl wrote: > Hey Jamie, > > Several years ago you wrote the glue-code [0] for the DW 8250 IP. Over the > years various 'fixes' have been applied to resolve certain 'weird' problems > that Tim tried to fix with [1]. > > After going over the datasheets an

[linux-sunxi] Designware UART bug

2017-05-03 Thread Olliver Schinagl
Hey Jamie, Several years ago you wrote the glue-code [0] for the DW 8250 IP. Over the years various 'fixes' have been applied to resolve certain 'weird' problems that Tim tried to fix with [1]. After going over the datasheets and code with a comb several times now, I think I may have found o

Re: [linux-sunxi] [PATCH 13/15] drm/sun4i: Add HDMI support

2017-05-03 Thread Maxime Ripard
On Wed, Apr 26, 2017 at 03:59:28PM +0800, Chen-Yu Tsai wrote: > >> > + writel(SUN4I_HDMI_VID_TIMING_X(mode->hdisplay) | > >> > + SUN4I_HDMI_VID_TIMING_Y(mode->vdisplay), > >> > + hdmi->base + SUN4I_HDMI_VID_TIMING_ACT_REG); > >> > + > >> > + x = mode->htotal -