Message ID | d62023e0872e9b393db736f4a0ecf04b3fc1c91b.1637691240.git.hns@goldelico.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | MIPS: JZ4780 and CI20 HDMI | expand |
Hi Nikolaus, Le mar., nov. 23 2021 at 19:13:59 +0100, H. Nikolaus Schaller <hns@goldelico.com> a écrit : > From: Paul Boddie <paul@boddie.org.uk> > > We need to hook up > * HDMI connector > * HDMI power regulator > * JZ4780_CLK_HDMI @ 27 MHz > * DDC pinmux > * HDMI and LCDC endpoint connections > > Signed-off-by: Paul Boddie <paul@boddie.org.uk> > Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com> > --- > arch/mips/boot/dts/ingenic/ci20.dts | 83 > +++++++++++++++++++++++++++-- > 1 file changed, 80 insertions(+), 3 deletions(-) > > diff --git a/arch/mips/boot/dts/ingenic/ci20.dts > b/arch/mips/boot/dts/ingenic/ci20.dts > index b249a4f0f6b62..15cf03670693f 100644 > --- a/arch/mips/boot/dts/ingenic/ci20.dts > +++ b/arch/mips/boot/dts/ingenic/ci20.dts > @@ -78,6 +78,18 @@ eth0_power: fixedregulator@0 { > enable-active-high; > }; > > + hdmi_out: connector { > + compatible = "hdmi-connector"; > + label = "HDMI OUT"; > + type = "a"; > + > + port { > + hdmi_con: endpoint { > + remote-endpoint = <&dw_hdmi_out>; > + }; > + }; > + }; > + > ir: ir { > compatible = "gpio-ir-receiver"; > gpios = <&gpe 3 GPIO_ACTIVE_LOW>; > @@ -102,6 +114,17 @@ otg_power: fixedregulator@2 { > gpio = <&gpf 14 GPIO_ACTIVE_LOW>; > enable-active-high; > }; > + > + hdmi_power: fixedregulator@3 { > + compatible = "regulator-fixed"; > + > + regulator-name = "hdmi_power"; > + regulator-min-microvolt = <5000000>; > + regulator-max-microvolt = <5000000>; > + > + gpio = <&gpa 25 0>; > + enable-active-high; > + }; > }; > > &ext { > @@ -114,11 +137,13 @@ &cgu { > * precision. > */ > assigned-clocks = <&cgu JZ4780_CLK_OTGPHY>, <&cgu JZ4780_CLK_RTC>, > - <&cgu JZ4780_CLK_SSIPLL>, <&cgu JZ4780_CLK_SSI>; > + <&cgu JZ4780_CLK_SSIPLL>, <&cgu JZ4780_CLK_SSI>, > + <&cgu JZ4780_CLK_HDMI>; > assigned-clock-parents = <0>, <&cgu JZ4780_CLK_RTCLK>, > <&cgu JZ4780_CLK_MPLL>, > - <&cgu JZ4780_CLK_SSIPLL>; > - assigned-clock-rates = <48000000>, <0>, <54000000>; > + <&cgu JZ4780_CLK_SSIPLL>, > + <0>; Nit - you can remove the last <0>, it will be the default. > + assigned-clock-rates = <48000000>, <0>, <54000000>, <0>, <27000000>; > }; > > &tcu { > @@ -509,6 +534,19 @@ pins_i2c4: i2c4 { > bias-disable; > }; > > + pins_hdmi_ddc: hdmi_ddc { > + function = "hdmi-ddc"; > + groups = "hdmi-ddc"; > + bias-disable; > + }; > + > + /* switch to PF25 as gpio driving DDC_SDA low */ > + pins_hdmi_ddc_unwedge: hdmi_ddc { > + function = "hdmi-ddc"; > + groups = "hdmi-ddc"; > + bias-disable; > + }; Your pins_hdmi_ddc and pins_hdmi_ddc_unwedge are the exact same? You could just use the former and pass it to both pinctrl-0 and pinctrl-1. Cheers, -Paul > + > pins_nemc: nemc { > function = "nemc"; > groups = "nemc-data", "nemc-cle-ale", "nemc-rd-we", "nemc-frd-fwe"; > @@ -539,3 +577,42 @@ pins_mmc1: mmc1 { > bias-disable; > }; > }; > + > +&hdmi { > + status = "okay"; > + > + pinctrl-names = "default", "unwedge"; > + pinctrl-0 = <&pins_hdmi_ddc>; > + pinctrl-1 = <&pins_hdmi_ddc_unwedge>; > + > + hdmi-5v-supply = <&hdmi_power>; > + > + ports { > + #address-cells = <1>; > + #size-cells = <0>; > + > + port@0 { > + reg = <0>; > + dw_hdmi_in: endpoint { > + remote-endpoint = <&lcd_out>; > + }; > + }; > + > + port@1 { > + reg = <1>; > + dw_hdmi_out: endpoint { > + remote-endpoint = <&hdmi_con>; > + }; > + }; > + }; > +}; > + > +&lcdc0 { > + status = "okay"; > + > + port { > + lcd_out: endpoint { > + remote-endpoint = <&dw_hdmi_in>; > + }; > + }; > +}; > -- > 2.33.0 >
> Am 23.11.2021 um 21:10 schrieb Paul Cercueil <paul@crapouillou.net>: > > Hi Nikolaus, > > Le mar., nov. 23 2021 at 19:13:59 +0100, H. Nikolaus Schaller <hns@goldelico.com> a écrit : >> From: Paul Boddie <paul@boddie.org.uk> >> We need to hook up >> * HDMI connector >> * HDMI power regulator >> * JZ4780_CLK_HDMI @ 27 MHz >> * DDC pinmux >> * HDMI and LCDC endpoint connections >> Signed-off-by: Paul Boddie <paul@boddie.org.uk> >> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com> >> --- >> arch/mips/boot/dts/ingenic/ci20.dts | 83 +++++++++++++++++++++++++++-- >> 1 file changed, 80 insertions(+), 3 deletions(-) >> diff --git a/arch/mips/boot/dts/ingenic/ci20.dts b/arch/mips/boot/dts/ingenic/ci20.dts >> index b249a4f0f6b62..15cf03670693f 100644 >> --- a/arch/mips/boot/dts/ingenic/ci20.dts >> +++ b/arch/mips/boot/dts/ingenic/ci20.dts >> @@ -78,6 +78,18 @@ eth0_power: fixedregulator@0 { >> enable-active-high; >> }; >> + hdmi_out: connector { >> + compatible = "hdmi-connector"; >> + label = "HDMI OUT"; >> + type = "a"; >> + >> + port { >> + hdmi_con: endpoint { >> + remote-endpoint = <&dw_hdmi_out>; >> + }; >> + }; >> + }; >> + >> ir: ir { >> compatible = "gpio-ir-receiver"; >> gpios = <&gpe 3 GPIO_ACTIVE_LOW>; >> @@ -102,6 +114,17 @@ otg_power: fixedregulator@2 { >> gpio = <&gpf 14 GPIO_ACTIVE_LOW>; >> enable-active-high; >> }; >> + >> + hdmi_power: fixedregulator@3 { >> + compatible = "regulator-fixed"; >> + >> + regulator-name = "hdmi_power"; >> + regulator-min-microvolt = <5000000>; >> + regulator-max-microvolt = <5000000>; >> + >> + gpio = <&gpa 25 0>; >> + enable-active-high; >> + }; >> }; >> &ext { >> @@ -114,11 +137,13 @@ &cgu { >> * precision. >> */ >> assigned-clocks = <&cgu JZ4780_CLK_OTGPHY>, <&cgu JZ4780_CLK_RTC>, >> - <&cgu JZ4780_CLK_SSIPLL>, <&cgu JZ4780_CLK_SSI>; >> + <&cgu JZ4780_CLK_SSIPLL>, <&cgu JZ4780_CLK_SSI>, >> + <&cgu JZ4780_CLK_HDMI>; >> assigned-clock-parents = <0>, <&cgu JZ4780_CLK_RTCLK>, >> <&cgu JZ4780_CLK_MPLL>, >> - <&cgu JZ4780_CLK_SSIPLL>; >> - assigned-clock-rates = <48000000>, <0>, <54000000>; >> + <&cgu JZ4780_CLK_SSIPLL>, >> + <0>; > > Nit - you can remove the last <0>, it will be the default. Well, it might make life easier for the next addition but I've removed it. > >> + assigned-clock-rates = <48000000>, <0>, <54000000>, <0>, <27000000>; >> }; >> &tcu { >> @@ -509,6 +534,19 @@ pins_i2c4: i2c4 { >> bias-disable; >> }; >> + pins_hdmi_ddc: hdmi_ddc { >> + function = "hdmi-ddc"; >> + groups = "hdmi-ddc"; >> + bias-disable; >> + }; >> + >> + /* switch to PF25 as gpio driving DDC_SDA low */ >> + pins_hdmi_ddc_unwedge: hdmi_ddc { >> + function = "hdmi-ddc"; >> + groups = "hdmi-ddc"; >> + bias-disable; >> + }; > > Your pins_hdmi_ddc and pins_hdmi_ddc_unwedge are the exact same? You could just use the former and pass it to both pinctrl-0 and pinctrl-1. This was forgotten to remove. We do not make use of the unwedge feature because I could not find out how to use pinctrl to switch this to gpio25 and drive it low. And I always had a revert for this in my test tree and we haven't seen a stuck DDC so far. Therefore I remove it (and leave it as maybe-to-to in my tree). > > Cheers, > -Paul > >> + >> pins_nemc: nemc { >> function = "nemc"; >> groups = "nemc-data", "nemc-cle-ale", "nemc-rd-we", "nemc-frd-fwe"; >> @@ -539,3 +577,42 @@ pins_mmc1: mmc1 { >> bias-disable; >> }; >> }; >> + >> +&hdmi { >> + status = "okay"; >> + >> + pinctrl-names = "default", "unwedge"; >> + pinctrl-0 = <&pins_hdmi_ddc>; >> + pinctrl-1 = <&pins_hdmi_ddc_unwedge>; >> + >> + hdmi-5v-supply = <&hdmi_power>; >> + >> + ports { >> + #address-cells = <1>; >> + #size-cells = <0>; >> + >> + port@0 { >> + reg = <0>; >> + dw_hdmi_in: endpoint { >> + remote-endpoint = <&lcd_out>; >> + }; >> + }; >> + >> + port@1 { >> + reg = <1>; >> + dw_hdmi_out: endpoint { >> + remote-endpoint = <&hdmi_con>; >> + }; >> + }; >> + }; >> +}; >> + >> +&lcdc0 { >> + status = "okay"; >> + >> + port { >> + lcd_out: endpoint { >> + remote-endpoint = <&dw_hdmi_in>; >> + }; >> + }; >> +}; >> -- >> 2.33.0
Hi Nikolaus, On Wed, Nov 24, 2021 at 5:19 PM H. Nikolaus Schaller <hns@goldelico.com> wrote: > > Am 23.11.2021 um 21:10 schrieb Paul Cercueil <paul@crapouillou.net>: > > Le mar., nov. 23 2021 at 19:13:59 +0100, H. Nikolaus Schaller <hns@goldelico.com> a écrit : > >> + assigned-clock-rates = <48000000>, <0>, <54000000>, <0>, <27000000>; > >> }; > >> &tcu { > >> @@ -509,6 +534,19 @@ pins_i2c4: i2c4 { > >> bias-disable; > >> }; > >> + pins_hdmi_ddc: hdmi_ddc { > >> + function = "hdmi-ddc"; > >> + groups = "hdmi-ddc"; > >> + bias-disable; > >> + }; > >> + > >> + /* switch to PF25 as gpio driving DDC_SDA low */ > >> + pins_hdmi_ddc_unwedge: hdmi_ddc { > >> + function = "hdmi-ddc"; > >> + groups = "hdmi-ddc"; > >> + bias-disable; > >> + }; > > > > Your pins_hdmi_ddc and pins_hdmi_ddc_unwedge are the exact same? You could just use the former and pass it to both pinctrl-0 and pinctrl-1. > > This was forgotten to remove. We do not make use of the unwedge feature because I could not find out how to use pinctrl to switch this to gpio25 and drive it low. Using gpio-hog? Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Hi Geert, > Am 24.11.2021 um 17:21 schrieb Geert Uytterhoeven <geert@linux-m68k.org>: > > Hi Nikolaus, > > On Wed, Nov 24, 2021 at 5:19 PM H. Nikolaus Schaller <hns@goldelico.com> wrote: >>> Am 23.11.2021 um 21:10 schrieb Paul Cercueil <paul@crapouillou.net>: >>> Le mar., nov. 23 2021 at 19:13:59 +0100, H. Nikolaus Schaller <hns@goldelico.com> a écrit : >>>> + assigned-clock-rates = <48000000>, <0>, <54000000>, <0>, <27000000>; >>>> }; >>>> &tcu { >>>> @@ -509,6 +534,19 @@ pins_i2c4: i2c4 { >>>> bias-disable; >>>> }; >>>> + pins_hdmi_ddc: hdmi_ddc { >>>> + function = "hdmi-ddc"; >>>> + groups = "hdmi-ddc"; >>>> + bias-disable; >>>> + }; >>>> + >>>> + /* switch to PF25 as gpio driving DDC_SDA low */ >>>> + pins_hdmi_ddc_unwedge: hdmi_ddc { >>>> + function = "hdmi-ddc"; >>>> + groups = "hdmi-ddc"; >>>> + bias-disable; >>>> + }; >>> >>> Your pins_hdmi_ddc and pins_hdmi_ddc_unwedge are the exact same? You could just use the former and pass it to both pinctrl-0 and pinctrl-1. >> >> This was forgotten to remove. We do not make use of the unwedge feature because I could not find out how to use pinctrl to switch this to gpio25 and drive it low. > > Using gpio-hog? well, AFAIR it activates the gpio permanently and is a propery of the gpio controller and not of pinmux. The driver assumes it can use pinmux state switching to drive the DDC_SDA line low on demand. Since it is unlikely that we need it at all (and we have no test case that it works) I think we simply can leave this driver feature unused unless we get a test case. BR and thanks, Nikolaus
Hi Nikolaus, On Wed, Nov 24, 2021 at 5:31 PM H. Nikolaus Schaller <hns@goldelico.com> wrote: > > Am 24.11.2021 um 17:21 schrieb Geert Uytterhoeven <geert@linux-m68k.org>: > > On Wed, Nov 24, 2021 at 5:19 PM H. Nikolaus Schaller <hns@goldelico.com> wrote: > >>> Am 23.11.2021 um 21:10 schrieb Paul Cercueil <paul@crapouillou.net>: > >>> Le mar., nov. 23 2021 at 19:13:59 +0100, H. Nikolaus Schaller <hns@goldelico.com> a écrit : > >>>> + assigned-clock-rates = <48000000>, <0>, <54000000>, <0>, <27000000>; > >>>> }; > >>>> &tcu { > >>>> @@ -509,6 +534,19 @@ pins_i2c4: i2c4 { > >>>> bias-disable; > >>>> }; > >>>> + pins_hdmi_ddc: hdmi_ddc { > >>>> + function = "hdmi-ddc"; > >>>> + groups = "hdmi-ddc"; > >>>> + bias-disable; > >>>> + }; > >>>> + > >>>> + /* switch to PF25 as gpio driving DDC_SDA low */ > >>>> + pins_hdmi_ddc_unwedge: hdmi_ddc { > >>>> + function = "hdmi-ddc"; > >>>> + groups = "hdmi-ddc"; > >>>> + bias-disable; > >>>> + }; > >>> > >>> Your pins_hdmi_ddc and pins_hdmi_ddc_unwedge are the exact same? You could just use the former and pass it to both pinctrl-0 and pinctrl-1. > >> > >> This was forgotten to remove. We do not make use of the unwedge feature because I could not find out how to use pinctrl to switch this to gpio25 and drive it low. > > > > Using gpio-hog? > > well, AFAIR it activates the gpio permanently and is a propery of the gpio controller and not of pinmux. Yes, hogs are permanently (ignoring DT overlay tricks). > The driver assumes it can use pinmux state switching to drive the DDC_SDA line low on demand. Add an optional wedge-gpios property for switching? Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Hi Gert, > Am 25.11.2021 um 08:58 schrieb Geert Uytterhoeven <geert@linux-m68k.org>: > > Hi Nikolaus, > > On Wed, Nov 24, 2021 at 5:31 PM H. Nikolaus Schaller <hns@goldelico.com> wrote: >>> Am 24.11.2021 um 17:21 schrieb Geert Uytterhoeven <geert@linux-m68k.org>: >>> On Wed, Nov 24, 2021 at 5:19 PM H. Nikolaus Schaller <hns@goldelico.com> wrote: >>>>> Am 23.11.2021 um 21:10 schrieb Paul Cercueil <paul@crapouillou.net>: >>>>> Le mar., nov. 23 2021 at 19:13:59 +0100, H. Nikolaus Schaller <hns@goldelico.com> a écrit : >>>>>> + assigned-clock-rates = <48000000>, <0>, <54000000>, <0>, <27000000>; >>>>>> }; >>>>>> &tcu { >>>>>> @@ -509,6 +534,19 @@ pins_i2c4: i2c4 { >>>>>> bias-disable; >>>>>> }; >>>>>> + pins_hdmi_ddc: hdmi_ddc { >>>>>> + function = "hdmi-ddc"; >>>>>> + groups = "hdmi-ddc"; >>>>>> + bias-disable; >>>>>> + }; >>>>>> + >>>>>> + /* switch to PF25 as gpio driving DDC_SDA low */ >>>>>> + pins_hdmi_ddc_unwedge: hdmi_ddc { >>>>>> + function = "hdmi-ddc"; >>>>>> + groups = "hdmi-ddc"; >>>>>> + bias-disable; >>>>>> + }; >>>>> >>>>> Your pins_hdmi_ddc and pins_hdmi_ddc_unwedge are the exact same? You could just use the former and pass it to both pinctrl-0 and pinctrl-1. >>>> >>>> This was forgotten to remove. We do not make use of the unwedge feature because I could not find out how to use pinctrl to switch this to gpio25 and drive it low. >>> >>> Using gpio-hog? >> >> well, AFAIR it activates the gpio permanently and is a propery of the gpio controller and not of pinmux. > > Yes, hogs are permanently (ignoring DT overlay tricks). > >> The driver assumes it can use pinmux state switching to drive the DDC_SDA line low on demand. > > Add an optional wedge-gpios property for switching? That would touch the synopsys driver core and does not appear to be required for jz4780 operation. We just add a separate driver specialisation for some parameters and set up the device tree. So it is beyond the scope of our work (neither needed, nor can we test it). If you want to add that, please go ahead. BR and thanks, Nikolaus
diff --git a/arch/mips/boot/dts/ingenic/ci20.dts b/arch/mips/boot/dts/ingenic/ci20.dts index b249a4f0f6b62..15cf03670693f 100644 --- a/arch/mips/boot/dts/ingenic/ci20.dts +++ b/arch/mips/boot/dts/ingenic/ci20.dts @@ -78,6 +78,18 @@ eth0_power: fixedregulator@0 { enable-active-high; }; + hdmi_out: connector { + compatible = "hdmi-connector"; + label = "HDMI OUT"; + type = "a"; + + port { + hdmi_con: endpoint { + remote-endpoint = <&dw_hdmi_out>; + }; + }; + }; + ir: ir { compatible = "gpio-ir-receiver"; gpios = <&gpe 3 GPIO_ACTIVE_LOW>; @@ -102,6 +114,17 @@ otg_power: fixedregulator@2 { gpio = <&gpf 14 GPIO_ACTIVE_LOW>; enable-active-high; }; + + hdmi_power: fixedregulator@3 { + compatible = "regulator-fixed"; + + regulator-name = "hdmi_power"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + + gpio = <&gpa 25 0>; + enable-active-high; + }; }; &ext { @@ -114,11 +137,13 @@ &cgu { * precision. */ assigned-clocks = <&cgu JZ4780_CLK_OTGPHY>, <&cgu JZ4780_CLK_RTC>, - <&cgu JZ4780_CLK_SSIPLL>, <&cgu JZ4780_CLK_SSI>; + <&cgu JZ4780_CLK_SSIPLL>, <&cgu JZ4780_CLK_SSI>, + <&cgu JZ4780_CLK_HDMI>; assigned-clock-parents = <0>, <&cgu JZ4780_CLK_RTCLK>, <&cgu JZ4780_CLK_MPLL>, - <&cgu JZ4780_CLK_SSIPLL>; - assigned-clock-rates = <48000000>, <0>, <54000000>; + <&cgu JZ4780_CLK_SSIPLL>, + <0>; + assigned-clock-rates = <48000000>, <0>, <54000000>, <0>, <27000000>; }; &tcu { @@ -509,6 +534,19 @@ pins_i2c4: i2c4 { bias-disable; }; + pins_hdmi_ddc: hdmi_ddc { + function = "hdmi-ddc"; + groups = "hdmi-ddc"; + bias-disable; + }; + + /* switch to PF25 as gpio driving DDC_SDA low */ + pins_hdmi_ddc_unwedge: hdmi_ddc { + function = "hdmi-ddc"; + groups = "hdmi-ddc"; + bias-disable; + }; + pins_nemc: nemc { function = "nemc"; groups = "nemc-data", "nemc-cle-ale", "nemc-rd-we", "nemc-frd-fwe"; @@ -539,3 +577,42 @@ pins_mmc1: mmc1 { bias-disable; }; }; + +&hdmi { + status = "okay"; + + pinctrl-names = "default", "unwedge"; + pinctrl-0 = <&pins_hdmi_ddc>; + pinctrl-1 = <&pins_hdmi_ddc_unwedge>; + + hdmi-5v-supply = <&hdmi_power>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + dw_hdmi_in: endpoint { + remote-endpoint = <&lcd_out>; + }; + }; + + port@1 { + reg = <1>; + dw_hdmi_out: endpoint { + remote-endpoint = <&hdmi_con>; + }; + }; + }; +}; + +&lcdc0 { + status = "okay"; + + port { + lcd_out: endpoint { + remote-endpoint = <&dw_hdmi_in>; + }; + }; +};