All of lore.kernel.org
 help / color / mirror / Atom feed
* Allwinner A64: Issue on external rtc clock to wifi chip
@ 2018-05-14  7:07 ` Jagan Teki
  0 siblings, 0 replies; 27+ messages in thread
From: Jagan Teki @ 2018-05-14  7:07 UTC (permalink / raw)
  To: Maxime Ripard, Chen-Yu Tsai
  Cc: Michael Trimarchi, linux-sunxi, linux-kernel, linux-arm-kernel,
	devicetree

Hi Maxime and All,

We are trying to bring-up AP6330 Wifi chip for A64 board. We noticed
to have an external rtc clock has driven from wifi chip.

So the devicetree is configured according to this as below.

/ {
        wifi_pwrseq: wifi-pwrseq {
                compatible = "mmc-pwrseq-simple";
                clocks = <&rtc 1>;
                clock-names = "ext_clock";
                reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
                post-power-on-delay-ms = <400>;
        };
};

&rtc {
        clock-output-names = "rtc-osc32k", "rtc-osc32k-out";
        clocks = <&osc32k>;
        #clock-cells = <1>;
};

&mmc1 {
        pinctrl-names = "default";
        pinctrl-0 = <&mmc1_pins>;
        vmmc-supply = <&reg_dcdc1>;
        vqmmc-supply = <&reg_eldo1>;
        mmc-pwrseq = <&wifi_pwrseq>;
        bus-width = <4>;
        non-removable;
        status = "okay";

        brcmf: wifi@1 {
                reg = <1>;
                compatible = "brcm,bcm4329-fmac";
                interrupt-parent = <&r_pio>;
                interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>;  /* WL-WAKE-AP: PL3 */
                interrupt-names = "host-wake";
        };
};

And observed rtc-osc32k-out clock is never enabled[1] and the value of
LOSC_OUT_GATING is 0x0 which eventually not enabling
LOSC_OUT_GATING_EN

Pls. let us know if we miss anything here?

[1] https://paste.ubuntu.com/p/X2By4q8kD2/

Jagan.

-- 
Jagan Teki
Senior Linux Kernel Engineer | Amarula Solutions
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Allwinner A64: Issue on external rtc clock to wifi chip
@ 2018-05-14  7:07 ` Jagan Teki
  0 siblings, 0 replies; 27+ messages in thread
From: Jagan Teki @ 2018-05-14  7:07 UTC (permalink / raw)
  To: Maxime Ripard, Chen-Yu Tsai
  Cc: Michael Trimarchi, linux-sunxi, linux-kernel, linux-arm-kernel,
	devicetree

Hi Maxime and All,

We are trying to bring-up AP6330 Wifi chip for A64 board. We noticed
to have an external rtc clock has driven from wifi chip.

So the devicetree is configured according to this as below.

/ {
        wifi_pwrseq: wifi-pwrseq {
                compatible = "mmc-pwrseq-simple";
                clocks = <&rtc 1>;
                clock-names = "ext_clock";
                reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
                post-power-on-delay-ms = <400>;
        };
};

&rtc {
        clock-output-names = "rtc-osc32k", "rtc-osc32k-out";
        clocks = <&osc32k>;
        #clock-cells = <1>;
};

&mmc1 {
        pinctrl-names = "default";
        pinctrl-0 = <&mmc1_pins>;
        vmmc-supply = <&reg_dcdc1>;
        vqmmc-supply = <&reg_eldo1>;
        mmc-pwrseq = <&wifi_pwrseq>;
        bus-width = <4>;
        non-removable;
        status = "okay";

        brcmf: wifi@1 {
                reg = <1>;
                compatible = "brcm,bcm4329-fmac";
                interrupt-parent = <&r_pio>;
                interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>;  /* WL-WAKE-AP: PL3 */
                interrupt-names = "host-wake";
        };
};

And observed rtc-osc32k-out clock is never enabled[1] and the value of
LOSC_OUT_GATING is 0x0 which eventually not enabling
LOSC_OUT_GATING_EN

Pls. let us know if we miss anything here?

[1] https://paste.ubuntu.com/p/X2By4q8kD2/

Jagan.

-- 
Jagan Teki
Senior Linux Kernel Engineer | Amarula Solutions
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Allwinner A64: Issue on external rtc clock to wifi chip
@ 2018-05-14  7:07 ` Jagan Teki
  0 siblings, 0 replies; 27+ messages in thread
From: Jagan Teki @ 2018-05-14  7:07 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Maxime and All,

We are trying to bring-up AP6330 Wifi chip for A64 board. We noticed
to have an external rtc clock has driven from wifi chip.

So the devicetree is configured according to this as below.

/ {
        wifi_pwrseq: wifi-pwrseq {
                compatible = "mmc-pwrseq-simple";
                clocks = <&rtc 1>;
                clock-names = "ext_clock";
                reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
                post-power-on-delay-ms = <400>;
        };
};

&rtc {
        clock-output-names = "rtc-osc32k", "rtc-osc32k-out";
        clocks = <&osc32k>;
        #clock-cells = <1>;
};

&mmc1 {
        pinctrl-names = "default";
        pinctrl-0 = <&mmc1_pins>;
        vmmc-supply = <&reg_dcdc1>;
        vqmmc-supply = <&reg_eldo1>;
        mmc-pwrseq = <&wifi_pwrseq>;
        bus-width = <4>;
        non-removable;
        status = "okay";

        brcmf: wifi at 1 {
                reg = <1>;
                compatible = "brcm,bcm4329-fmac";
                interrupt-parent = <&r_pio>;
                interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>;  /* WL-WAKE-AP: PL3 */
                interrupt-names = "host-wake";
        };
};

And observed rtc-osc32k-out clock is never enabled[1] and the value of
LOSC_OUT_GATING is 0x0 which eventually not enabling
LOSC_OUT_GATING_EN

Pls. let us know if we miss anything here?

[1] https://paste.ubuntu.com/p/X2By4q8kD2/

Jagan.

-- 
Jagan Teki
Senior Linux Kernel Engineer | Amarula Solutions
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Allwinner A64: Issue on external rtc clock to wifi chip
@ 2018-05-14  7:57   ` Maxime Ripard
  0 siblings, 0 replies; 27+ messages in thread
From: Maxime Ripard @ 2018-05-14  7:57 UTC (permalink / raw)
  To: Jagan Teki
  Cc: Chen-Yu Tsai, Michael Trimarchi, linux-sunxi, linux-kernel,
	linux-arm-kernel, devicetree

[-- Attachment #1: Type: text/plain, Size: 1825 bytes --]

Hi,

On Mon, May 14, 2018 at 12:37:49PM +0530, Jagan Teki wrote:
> Hi Maxime and All,
> 
> We are trying to bring-up AP6330 Wifi chip for A64 board. We noticed
> to have an external rtc clock has driven from wifi chip.
> 
> So the devicetree is configured according to this as below.
> 
> / {
>         wifi_pwrseq: wifi-pwrseq {
>                 compatible = "mmc-pwrseq-simple";
>                 clocks = <&rtc 1>;
>                 clock-names = "ext_clock";
>                 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
>                 post-power-on-delay-ms = <400>;
>         };
> };
> 
> &rtc {
>         clock-output-names = "rtc-osc32k", "rtc-osc32k-out";
>         clocks = <&osc32k>;
>         #clock-cells = <1>;
> };
> 
> &mmc1 {
>         pinctrl-names = "default";
>         pinctrl-0 = <&mmc1_pins>;
>         vmmc-supply = <&reg_dcdc1>;
>         vqmmc-supply = <&reg_eldo1>;
>         mmc-pwrseq = <&wifi_pwrseq>;
>         bus-width = <4>;
>         non-removable;
>         status = "okay";
> 
>         brcmf: wifi@1 {
>                 reg = <1>;
>                 compatible = "brcm,bcm4329-fmac";
>                 interrupt-parent = <&r_pio>;
>                 interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>;  /* WL-WAKE-AP: PL3 */
>                 interrupt-names = "host-wake";
>         };
> };
> 
> And observed rtc-osc32k-out clock is never enabled[1] and the value of
> LOSC_OUT_GATING is 0x0 which eventually not enabling
> LOSC_OUT_GATING_EN
> 
> Pls. let us know if we miss anything here?
> 
> [1] https://paste.ubuntu.com/p/X2By4q8kD2/

Could you paste your config and the logs from a boot to?

Thanks!
Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Allwinner A64: Issue on external rtc clock to wifi chip
@ 2018-05-14  7:57   ` Maxime Ripard
  0 siblings, 0 replies; 27+ messages in thread
From: Maxime Ripard @ 2018-05-14  7:57 UTC (permalink / raw)
  To: Jagan Teki
  Cc: Chen-Yu Tsai, Michael Trimarchi, linux-sunxi, linux-kernel,
	linux-arm-kernel, devicetree

[-- Attachment #1: Type: text/plain, Size: 1762 bytes --]

Hi,

On Mon, May 14, 2018 at 12:37:49PM +0530, Jagan Teki wrote:
> Hi Maxime and All,
> 
> We are trying to bring-up AP6330 Wifi chip for A64 board. We noticed
> to have an external rtc clock has driven from wifi chip.
> 
> So the devicetree is configured according to this as below.
> 
> / {
>         wifi_pwrseq: wifi-pwrseq {
>                 compatible = "mmc-pwrseq-simple";
>                 clocks = <&rtc 1>;
>                 clock-names = "ext_clock";
>                 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
>                 post-power-on-delay-ms = <400>;
>         };
> };
> 
> &rtc {
>         clock-output-names = "rtc-osc32k", "rtc-osc32k-out";
>         clocks = <&osc32k>;
>         #clock-cells = <1>;
> };
> 
> &mmc1 {
>         pinctrl-names = "default";
>         pinctrl-0 = <&mmc1_pins>;
>         vmmc-supply = <&reg_dcdc1>;
>         vqmmc-supply = <&reg_eldo1>;
>         mmc-pwrseq = <&wifi_pwrseq>;
>         bus-width = <4>;
>         non-removable;
>         status = "okay";
> 
>         brcmf: wifi@1 {
>                 reg = <1>;
>                 compatible = "brcm,bcm4329-fmac";
>                 interrupt-parent = <&r_pio>;
>                 interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>;  /* WL-WAKE-AP: PL3 */
>                 interrupt-names = "host-wake";
>         };
> };
> 
> And observed rtc-osc32k-out clock is never enabled[1] and the value of
> LOSC_OUT_GATING is 0x0 which eventually not enabling
> LOSC_OUT_GATING_EN
> 
> Pls. let us know if we miss anything here?
> 
> [1] https://paste.ubuntu.com/p/X2By4q8kD2/

Could you paste your config and the logs from a boot to?

Thanks!
Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Allwinner A64: Issue on external rtc clock to wifi chip
@ 2018-05-14  7:57   ` Maxime Ripard
  0 siblings, 0 replies; 27+ messages in thread
From: Maxime Ripard @ 2018-05-14  7:57 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Mon, May 14, 2018 at 12:37:49PM +0530, Jagan Teki wrote:
> Hi Maxime and All,
> 
> We are trying to bring-up AP6330 Wifi chip for A64 board. We noticed
> to have an external rtc clock has driven from wifi chip.
> 
> So the devicetree is configured according to this as below.
> 
> / {
>         wifi_pwrseq: wifi-pwrseq {
>                 compatible = "mmc-pwrseq-simple";
>                 clocks = <&rtc 1>;
>                 clock-names = "ext_clock";
>                 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
>                 post-power-on-delay-ms = <400>;
>         };
> };
> 
> &rtc {
>         clock-output-names = "rtc-osc32k", "rtc-osc32k-out";
>         clocks = <&osc32k>;
>         #clock-cells = <1>;
> };
> 
> &mmc1 {
>         pinctrl-names = "default";
>         pinctrl-0 = <&mmc1_pins>;
>         vmmc-supply = <&reg_dcdc1>;
>         vqmmc-supply = <&reg_eldo1>;
>         mmc-pwrseq = <&wifi_pwrseq>;
>         bus-width = <4>;
>         non-removable;
>         status = "okay";
> 
>         brcmf: wifi at 1 {
>                 reg = <1>;
>                 compatible = "brcm,bcm4329-fmac";
>                 interrupt-parent = <&r_pio>;
>                 interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>;  /* WL-WAKE-AP: PL3 */
>                 interrupt-names = "host-wake";
>         };
> };
> 
> And observed rtc-osc32k-out clock is never enabled[1] and the value of
> LOSC_OUT_GATING is 0x0 which eventually not enabling
> LOSC_OUT_GATING_EN
> 
> Pls. let us know if we miss anything here?
> 
> [1] https://paste.ubuntu.com/p/X2By4q8kD2/

Could you paste your config and the logs from a boot to?

Thanks!
Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180514/b265a2f1/attachment.sig>

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Allwinner A64: Issue on external rtc clock to wifi chip
  2018-05-14  7:57   ` Maxime Ripard
  (?)
@ 2018-05-14  8:04     ` Jagan Teki
  -1 siblings, 0 replies; 27+ messages in thread
From: Jagan Teki @ 2018-05-14  8:04 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Chen-Yu Tsai, Michael Trimarchi, linux-sunxi, linux-kernel,
	linux-arm-kernel, devicetree

On Mon, May 14, 2018 at 1:27 PM, Maxime Ripard
<maxime.ripard@bootlin.com> wrote:
> Hi,
>
> On Mon, May 14, 2018 at 12:37:49PM +0530, Jagan Teki wrote:
>> Hi Maxime and All,
>>
>> We are trying to bring-up AP6330 Wifi chip for A64 board. We noticed
>> to have an external rtc clock has driven from wifi chip.
>>
>> So the devicetree is configured according to this as below.
>>
>> / {
>>         wifi_pwrseq: wifi-pwrseq {
>>                 compatible = "mmc-pwrseq-simple";
>>                 clocks = <&rtc 1>;
>>                 clock-names = "ext_clock";
>>                 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
>>                 post-power-on-delay-ms = <400>;
>>         };
>> };
>>
>> &rtc {
>>         clock-output-names = "rtc-osc32k", "rtc-osc32k-out";
>>         clocks = <&osc32k>;
>>         #clock-cells = <1>;
>> };
>>
>> &mmc1 {
>>         pinctrl-names = "default";
>>         pinctrl-0 = <&mmc1_pins>;
>>         vmmc-supply = <&reg_dcdc1>;
>>         vqmmc-supply = <&reg_eldo1>;
>>         mmc-pwrseq = <&wifi_pwrseq>;
>>         bus-width = <4>;
>>         non-removable;
>>         status = "okay";
>>
>>         brcmf: wifi@1 {
>>                 reg = <1>;
>>                 compatible = "brcm,bcm4329-fmac";
>>                 interrupt-parent = <&r_pio>;
>>                 interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>;  /* WL-WAKE-AP: PL3 */
>>                 interrupt-names = "host-wake";
>>         };
>> };
>>
>> And observed rtc-osc32k-out clock is never enabled[1] and the value of
>> LOSC_OUT_GATING is 0x0 which eventually not enabling
>> LOSC_OUT_GATING_EN
>>
>> Pls. let us know if we miss anything here?
>>
>> [1] https://paste.ubuntu.com/p/X2By4q8kD2/
>
> Could you paste your config and the logs from a boot to?

.config
https://paste.ubuntu.com/p/w9w2KB7RFc/

dmesg
https://paste.ubuntu.com/p/mrZGk5bWRR/

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Allwinner A64: Issue on external rtc clock to wifi chip
@ 2018-05-14  8:04     ` Jagan Teki
  0 siblings, 0 replies; 27+ messages in thread
From: Jagan Teki @ 2018-05-14  8:04 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Chen-Yu Tsai, Michael Trimarchi, linux-sunxi, linux-kernel,
	linux-arm-kernel, devicetree

On Mon, May 14, 2018 at 1:27 PM, Maxime Ripard
<maxime.ripard-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org> wrote:
> Hi,
>
> On Mon, May 14, 2018 at 12:37:49PM +0530, Jagan Teki wrote:
>> Hi Maxime and All,
>>
>> We are trying to bring-up AP6330 Wifi chip for A64 board. We noticed
>> to have an external rtc clock has driven from wifi chip.
>>
>> So the devicetree is configured according to this as below.
>>
>> / {
>>         wifi_pwrseq: wifi-pwrseq {
>>                 compatible = "mmc-pwrseq-simple";
>>                 clocks = <&rtc 1>;
>>                 clock-names = "ext_clock";
>>                 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
>>                 post-power-on-delay-ms = <400>;
>>         };
>> };
>>
>> &rtc {
>>         clock-output-names = "rtc-osc32k", "rtc-osc32k-out";
>>         clocks = <&osc32k>;
>>         #clock-cells = <1>;
>> };
>>
>> &mmc1 {
>>         pinctrl-names = "default";
>>         pinctrl-0 = <&mmc1_pins>;
>>         vmmc-supply = <&reg_dcdc1>;
>>         vqmmc-supply = <&reg_eldo1>;
>>         mmc-pwrseq = <&wifi_pwrseq>;
>>         bus-width = <4>;
>>         non-removable;
>>         status = "okay";
>>
>>         brcmf: wifi@1 {
>>                 reg = <1>;
>>                 compatible = "brcm,bcm4329-fmac";
>>                 interrupt-parent = <&r_pio>;
>>                 interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>;  /* WL-WAKE-AP: PL3 */
>>                 interrupt-names = "host-wake";
>>         };
>> };
>>
>> And observed rtc-osc32k-out clock is never enabled[1] and the value of
>> LOSC_OUT_GATING is 0x0 which eventually not enabling
>> LOSC_OUT_GATING_EN
>>
>> Pls. let us know if we miss anything here?
>>
>> [1] https://paste.ubuntu.com/p/X2By4q8kD2/
>
> Could you paste your config and the logs from a boot to?

.config
https://paste.ubuntu.com/p/w9w2KB7RFc/

dmesg
https://paste.ubuntu.com/p/mrZGk5bWRR/

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Allwinner A64: Issue on external rtc clock to wifi chip
@ 2018-05-14  8:04     ` Jagan Teki
  0 siblings, 0 replies; 27+ messages in thread
From: Jagan Teki @ 2018-05-14  8:04 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, May 14, 2018 at 1:27 PM, Maxime Ripard
<maxime.ripard@bootlin.com> wrote:
> Hi,
>
> On Mon, May 14, 2018 at 12:37:49PM +0530, Jagan Teki wrote:
>> Hi Maxime and All,
>>
>> We are trying to bring-up AP6330 Wifi chip for A64 board. We noticed
>> to have an external rtc clock has driven from wifi chip.
>>
>> So the devicetree is configured according to this as below.
>>
>> / {
>>         wifi_pwrseq: wifi-pwrseq {
>>                 compatible = "mmc-pwrseq-simple";
>>                 clocks = <&rtc 1>;
>>                 clock-names = "ext_clock";
>>                 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
>>                 post-power-on-delay-ms = <400>;
>>         };
>> };
>>
>> &rtc {
>>         clock-output-names = "rtc-osc32k", "rtc-osc32k-out";
>>         clocks = <&osc32k>;
>>         #clock-cells = <1>;
>> };
>>
>> &mmc1 {
>>         pinctrl-names = "default";
>>         pinctrl-0 = <&mmc1_pins>;
>>         vmmc-supply = <&reg_dcdc1>;
>>         vqmmc-supply = <&reg_eldo1>;
>>         mmc-pwrseq = <&wifi_pwrseq>;
>>         bus-width = <4>;
>>         non-removable;
>>         status = "okay";
>>
>>         brcmf: wifi at 1 {
>>                 reg = <1>;
>>                 compatible = "brcm,bcm4329-fmac";
>>                 interrupt-parent = <&r_pio>;
>>                 interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>;  /* WL-WAKE-AP: PL3 */
>>                 interrupt-names = "host-wake";
>>         };
>> };
>>
>> And observed rtc-osc32k-out clock is never enabled[1] and the value of
>> LOSC_OUT_GATING is 0x0 which eventually not enabling
>> LOSC_OUT_GATING_EN
>>
>> Pls. let us know if we miss anything here?
>>
>> [1] https://paste.ubuntu.com/p/X2By4q8kD2/
>
> Could you paste your config and the logs from a boot to?

.config
https://paste.ubuntu.com/p/w9w2KB7RFc/

dmesg
https://paste.ubuntu.com/p/mrZGk5bWRR/

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Allwinner A64: Issue on external rtc clock to wifi chip
@ 2018-05-14  8:27       ` Maxime Ripard
  0 siblings, 0 replies; 27+ messages in thread
From: Maxime Ripard @ 2018-05-14  8:27 UTC (permalink / raw)
  To: Jagan Teki
  Cc: Chen-Yu Tsai, Michael Trimarchi, linux-sunxi, linux-kernel,
	linux-arm-kernel, devicetree

[-- Attachment #1: Type: text/plain, Size: 2432 bytes --]

On Mon, May 14, 2018 at 01:34:56PM +0530, Jagan Teki wrote:
> On Mon, May 14, 2018 at 1:27 PM, Maxime Ripard
> <maxime.ripard@bootlin.com> wrote:
> > Hi,
> >
> > On Mon, May 14, 2018 at 12:37:49PM +0530, Jagan Teki wrote:
> >> Hi Maxime and All,
> >>
> >> We are trying to bring-up AP6330 Wifi chip for A64 board. We noticed
> >> to have an external rtc clock has driven from wifi chip.
> >>
> >> So the devicetree is configured according to this as below.
> >>
> >> / {
> >>         wifi_pwrseq: wifi-pwrseq {
> >>                 compatible = "mmc-pwrseq-simple";
> >>                 clocks = <&rtc 1>;
> >>                 clock-names = "ext_clock";
> >>                 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
> >>                 post-power-on-delay-ms = <400>;
> >>         };
> >> };
> >>
> >> &rtc {
> >>         clock-output-names = "rtc-osc32k", "rtc-osc32k-out";
> >>         clocks = <&osc32k>;
> >>         #clock-cells = <1>;
> >> };
> >>
> >> &mmc1 {
> >>         pinctrl-names = "default";
> >>         pinctrl-0 = <&mmc1_pins>;
> >>         vmmc-supply = <&reg_dcdc1>;
> >>         vqmmc-supply = <&reg_eldo1>;
> >>         mmc-pwrseq = <&wifi_pwrseq>;
> >>         bus-width = <4>;
> >>         non-removable;
> >>         status = "okay";
> >>
> >>         brcmf: wifi@1 {
> >>                 reg = <1>;
> >>                 compatible = "brcm,bcm4329-fmac";
> >>                 interrupt-parent = <&r_pio>;
> >>                 interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>;  /* WL-WAKE-AP: PL3 */
> >>                 interrupt-names = "host-wake";
> >>         };
> >> };
> >>
> >> And observed rtc-osc32k-out clock is never enabled[1] and the value of
> >> LOSC_OUT_GATING is 0x0 which eventually not enabling
> >> LOSC_OUT_GATING_EN
> >>
> >> Pls. let us know if we miss anything here?
> >>
> >> [1] https://paste.ubuntu.com/p/X2By4q8kD2/
> >
> > Could you paste your config and the logs from a boot to?
> 
> .config
> https://paste.ubuntu.com/p/w9w2KB7RFc/
> 
> dmesg
> https://paste.ubuntu.com/p/mrZGk5bWRR/

This is kind of weird. Have you tested with a 4.17 kernel? We have
runtime_pm changes lined up in next, so that might be a regression
there, even though we tested it with Quentin at some point.

Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Allwinner A64: Issue on external rtc clock to wifi chip
@ 2018-05-14  8:27       ` Maxime Ripard
  0 siblings, 0 replies; 27+ messages in thread
From: Maxime Ripard @ 2018-05-14  8:27 UTC (permalink / raw)
  To: Jagan Teki
  Cc: Chen-Yu Tsai, Michael Trimarchi, linux-sunxi, linux-kernel,
	linux-arm-kernel, devicetree

[-- Attachment #1: Type: text/plain, Size: 2385 bytes --]

On Mon, May 14, 2018 at 01:34:56PM +0530, Jagan Teki wrote:
> On Mon, May 14, 2018 at 1:27 PM, Maxime Ripard
> <maxime.ripard-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org> wrote:
> > Hi,
> >
> > On Mon, May 14, 2018 at 12:37:49PM +0530, Jagan Teki wrote:
> >> Hi Maxime and All,
> >>
> >> We are trying to bring-up AP6330 Wifi chip for A64 board. We noticed
> >> to have an external rtc clock has driven from wifi chip.
> >>
> >> So the devicetree is configured according to this as below.
> >>
> >> / {
> >>         wifi_pwrseq: wifi-pwrseq {
> >>                 compatible = "mmc-pwrseq-simple";
> >>                 clocks = <&rtc 1>;
> >>                 clock-names = "ext_clock";
> >>                 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
> >>                 post-power-on-delay-ms = <400>;
> >>         };
> >> };
> >>
> >> &rtc {
> >>         clock-output-names = "rtc-osc32k", "rtc-osc32k-out";
> >>         clocks = <&osc32k>;
> >>         #clock-cells = <1>;
> >> };
> >>
> >> &mmc1 {
> >>         pinctrl-names = "default";
> >>         pinctrl-0 = <&mmc1_pins>;
> >>         vmmc-supply = <&reg_dcdc1>;
> >>         vqmmc-supply = <&reg_eldo1>;
> >>         mmc-pwrseq = <&wifi_pwrseq>;
> >>         bus-width = <4>;
> >>         non-removable;
> >>         status = "okay";
> >>
> >>         brcmf: wifi@1 {
> >>                 reg = <1>;
> >>                 compatible = "brcm,bcm4329-fmac";
> >>                 interrupt-parent = <&r_pio>;
> >>                 interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>;  /* WL-WAKE-AP: PL3 */
> >>                 interrupt-names = "host-wake";
> >>         };
> >> };
> >>
> >> And observed rtc-osc32k-out clock is never enabled[1] and the value of
> >> LOSC_OUT_GATING is 0x0 which eventually not enabling
> >> LOSC_OUT_GATING_EN
> >>
> >> Pls. let us know if we miss anything here?
> >>
> >> [1] https://paste.ubuntu.com/p/X2By4q8kD2/
> >
> > Could you paste your config and the logs from a boot to?
> 
> .config
> https://paste.ubuntu.com/p/w9w2KB7RFc/
> 
> dmesg
> https://paste.ubuntu.com/p/mrZGk5bWRR/

This is kind of weird. Have you tested with a 4.17 kernel? We have
runtime_pm changes lined up in next, so that might be a regression
there, even though we tested it with Quentin at some point.

Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Allwinner A64: Issue on external rtc clock to wifi chip
@ 2018-05-14  8:27       ` Maxime Ripard
  0 siblings, 0 replies; 27+ messages in thread
From: Maxime Ripard @ 2018-05-14  8:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, May 14, 2018 at 01:34:56PM +0530, Jagan Teki wrote:
> On Mon, May 14, 2018 at 1:27 PM, Maxime Ripard
> <maxime.ripard@bootlin.com> wrote:
> > Hi,
> >
> > On Mon, May 14, 2018 at 12:37:49PM +0530, Jagan Teki wrote:
> >> Hi Maxime and All,
> >>
> >> We are trying to bring-up AP6330 Wifi chip for A64 board. We noticed
> >> to have an external rtc clock has driven from wifi chip.
> >>
> >> So the devicetree is configured according to this as below.
> >>
> >> / {
> >>         wifi_pwrseq: wifi-pwrseq {
> >>                 compatible = "mmc-pwrseq-simple";
> >>                 clocks = <&rtc 1>;
> >>                 clock-names = "ext_clock";
> >>                 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
> >>                 post-power-on-delay-ms = <400>;
> >>         };
> >> };
> >>
> >> &rtc {
> >>         clock-output-names = "rtc-osc32k", "rtc-osc32k-out";
> >>         clocks = <&osc32k>;
> >>         #clock-cells = <1>;
> >> };
> >>
> >> &mmc1 {
> >>         pinctrl-names = "default";
> >>         pinctrl-0 = <&mmc1_pins>;
> >>         vmmc-supply = <&reg_dcdc1>;
> >>         vqmmc-supply = <&reg_eldo1>;
> >>         mmc-pwrseq = <&wifi_pwrseq>;
> >>         bus-width = <4>;
> >>         non-removable;
> >>         status = "okay";
> >>
> >>         brcmf: wifi at 1 {
> >>                 reg = <1>;
> >>                 compatible = "brcm,bcm4329-fmac";
> >>                 interrupt-parent = <&r_pio>;
> >>                 interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>;  /* WL-WAKE-AP: PL3 */
> >>                 interrupt-names = "host-wake";
> >>         };
> >> };
> >>
> >> And observed rtc-osc32k-out clock is never enabled[1] and the value of
> >> LOSC_OUT_GATING is 0x0 which eventually not enabling
> >> LOSC_OUT_GATING_EN
> >>
> >> Pls. let us know if we miss anything here?
> >>
> >> [1] https://paste.ubuntu.com/p/X2By4q8kD2/
> >
> > Could you paste your config and the logs from a boot to?
> 
> .config
> https://paste.ubuntu.com/p/w9w2KB7RFc/
> 
> dmesg
> https://paste.ubuntu.com/p/mrZGk5bWRR/

This is kind of weird. Have you tested with a 4.17 kernel? We have
runtime_pm changes lined up in next, so that might be a regression
there, even though we tested it with Quentin at some point.

Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180514/0edd0495/attachment.sig>

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Allwinner A64: Issue on external rtc clock to wifi chip
  2018-05-14  8:27       ` Maxime Ripard
  (?)
@ 2018-05-14  9:04         ` Jagan Teki
  -1 siblings, 0 replies; 27+ messages in thread
From: Jagan Teki @ 2018-05-14  9:04 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Chen-Yu Tsai, Michael Trimarchi, linux-sunxi, linux-kernel,
	linux-arm-kernel, devicetree

On Mon, May 14, 2018 at 1:57 PM, Maxime Ripard
<maxime.ripard@bootlin.com> wrote:
> On Mon, May 14, 2018 at 01:34:56PM +0530, Jagan Teki wrote:
>> On Mon, May 14, 2018 at 1:27 PM, Maxime Ripard
>> <maxime.ripard@bootlin.com> wrote:
>> > Hi,
>> >
>> > On Mon, May 14, 2018 at 12:37:49PM +0530, Jagan Teki wrote:
>> >> Hi Maxime and All,
>> >>
>> >> We are trying to bring-up AP6330 Wifi chip for A64 board. We noticed
>> >> to have an external rtc clock has driven from wifi chip.
>> >>
>> >> So the devicetree is configured according to this as below.
>> >>
>> >> / {
>> >>         wifi_pwrseq: wifi-pwrseq {
>> >>                 compatible = "mmc-pwrseq-simple";
>> >>                 clocks = <&rtc 1>;
>> >>                 clock-names = "ext_clock";
>> >>                 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
>> >>                 post-power-on-delay-ms = <400>;
>> >>         };
>> >> };
>> >>
>> >> &rtc {
>> >>         clock-output-names = "rtc-osc32k", "rtc-osc32k-out";
>> >>         clocks = <&osc32k>;
>> >>         #clock-cells = <1>;
>> >> };
>> >>
>> >> &mmc1 {
>> >>         pinctrl-names = "default";
>> >>         pinctrl-0 = <&mmc1_pins>;
>> >>         vmmc-supply = <&reg_dcdc1>;
>> >>         vqmmc-supply = <&reg_eldo1>;
>> >>         mmc-pwrseq = <&wifi_pwrseq>;
>> >>         bus-width = <4>;
>> >>         non-removable;
>> >>         status = "okay";
>> >>
>> >>         brcmf: wifi@1 {
>> >>                 reg = <1>;
>> >>                 compatible = "brcm,bcm4329-fmac";
>> >>                 interrupt-parent = <&r_pio>;
>> >>                 interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>;  /* WL-WAKE-AP: PL3 */
>> >>                 interrupt-names = "host-wake";
>> >>         };
>> >> };
>> >>
>> >> And observed rtc-osc32k-out clock is never enabled[1] and the value of
>> >> LOSC_OUT_GATING is 0x0 which eventually not enabling
>> >> LOSC_OUT_GATING_EN
>> >>
>> >> Pls. let us know if we miss anything here?
>> >>
>> >> [1] https://paste.ubuntu.com/p/X2By4q8kD2/
>> >
>> > Could you paste your config and the logs from a boot to?
>>
>> .config
>> https://paste.ubuntu.com/p/w9w2KB7RFc/
>>
>> dmesg
>> https://paste.ubuntu.com/p/mrZGk5bWRR/
>
> This is kind of weird. Have you tested with a 4.17 kernel? We have
> runtime_pm changes lined up in next, so that might be a regression
> there, even though we tested it with Quentin at some point.

This is 4.17-rc4 do you want to try it on 4.16 ?

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Allwinner A64: Issue on external rtc clock to wifi chip
@ 2018-05-14  9:04         ` Jagan Teki
  0 siblings, 0 replies; 27+ messages in thread
From: Jagan Teki @ 2018-05-14  9:04 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Chen-Yu Tsai, Michael Trimarchi, linux-sunxi, linux-kernel,
	linux-arm-kernel, devicetree

On Mon, May 14, 2018 at 1:57 PM, Maxime Ripard
<maxime.ripard-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org> wrote:
> On Mon, May 14, 2018 at 01:34:56PM +0530, Jagan Teki wrote:
>> On Mon, May 14, 2018 at 1:27 PM, Maxime Ripard
>> <maxime.ripard-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org> wrote:
>> > Hi,
>> >
>> > On Mon, May 14, 2018 at 12:37:49PM +0530, Jagan Teki wrote:
>> >> Hi Maxime and All,
>> >>
>> >> We are trying to bring-up AP6330 Wifi chip for A64 board. We noticed
>> >> to have an external rtc clock has driven from wifi chip.
>> >>
>> >> So the devicetree is configured according to this as below.
>> >>
>> >> / {
>> >>         wifi_pwrseq: wifi-pwrseq {
>> >>                 compatible = "mmc-pwrseq-simple";
>> >>                 clocks = <&rtc 1>;
>> >>                 clock-names = "ext_clock";
>> >>                 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
>> >>                 post-power-on-delay-ms = <400>;
>> >>         };
>> >> };
>> >>
>> >> &rtc {
>> >>         clock-output-names = "rtc-osc32k", "rtc-osc32k-out";
>> >>         clocks = <&osc32k>;
>> >>         #clock-cells = <1>;
>> >> };
>> >>
>> >> &mmc1 {
>> >>         pinctrl-names = "default";
>> >>         pinctrl-0 = <&mmc1_pins>;
>> >>         vmmc-supply = <&reg_dcdc1>;
>> >>         vqmmc-supply = <&reg_eldo1>;
>> >>         mmc-pwrseq = <&wifi_pwrseq>;
>> >>         bus-width = <4>;
>> >>         non-removable;
>> >>         status = "okay";
>> >>
>> >>         brcmf: wifi@1 {
>> >>                 reg = <1>;
>> >>                 compatible = "brcm,bcm4329-fmac";
>> >>                 interrupt-parent = <&r_pio>;
>> >>                 interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>;  /* WL-WAKE-AP: PL3 */
>> >>                 interrupt-names = "host-wake";
>> >>         };
>> >> };
>> >>
>> >> And observed rtc-osc32k-out clock is never enabled[1] and the value of
>> >> LOSC_OUT_GATING is 0x0 which eventually not enabling
>> >> LOSC_OUT_GATING_EN
>> >>
>> >> Pls. let us know if we miss anything here?
>> >>
>> >> [1] https://paste.ubuntu.com/p/X2By4q8kD2/
>> >
>> > Could you paste your config and the logs from a boot to?
>>
>> .config
>> https://paste.ubuntu.com/p/w9w2KB7RFc/
>>
>> dmesg
>> https://paste.ubuntu.com/p/mrZGk5bWRR/
>
> This is kind of weird. Have you tested with a 4.17 kernel? We have
> runtime_pm changes lined up in next, so that might be a regression
> there, even though we tested it with Quentin at some point.

This is 4.17-rc4 do you want to try it on 4.16 ?

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Allwinner A64: Issue on external rtc clock to wifi chip
@ 2018-05-14  9:04         ` Jagan Teki
  0 siblings, 0 replies; 27+ messages in thread
From: Jagan Teki @ 2018-05-14  9:04 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, May 14, 2018 at 1:57 PM, Maxime Ripard
<maxime.ripard@bootlin.com> wrote:
> On Mon, May 14, 2018 at 01:34:56PM +0530, Jagan Teki wrote:
>> On Mon, May 14, 2018 at 1:27 PM, Maxime Ripard
>> <maxime.ripard@bootlin.com> wrote:
>> > Hi,
>> >
>> > On Mon, May 14, 2018 at 12:37:49PM +0530, Jagan Teki wrote:
>> >> Hi Maxime and All,
>> >>
>> >> We are trying to bring-up AP6330 Wifi chip for A64 board. We noticed
>> >> to have an external rtc clock has driven from wifi chip.
>> >>
>> >> So the devicetree is configured according to this as below.
>> >>
>> >> / {
>> >>         wifi_pwrseq: wifi-pwrseq {
>> >>                 compatible = "mmc-pwrseq-simple";
>> >>                 clocks = <&rtc 1>;
>> >>                 clock-names = "ext_clock";
>> >>                 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
>> >>                 post-power-on-delay-ms = <400>;
>> >>         };
>> >> };
>> >>
>> >> &rtc {
>> >>         clock-output-names = "rtc-osc32k", "rtc-osc32k-out";
>> >>         clocks = <&osc32k>;
>> >>         #clock-cells = <1>;
>> >> };
>> >>
>> >> &mmc1 {
>> >>         pinctrl-names = "default";
>> >>         pinctrl-0 = <&mmc1_pins>;
>> >>         vmmc-supply = <&reg_dcdc1>;
>> >>         vqmmc-supply = <&reg_eldo1>;
>> >>         mmc-pwrseq = <&wifi_pwrseq>;
>> >>         bus-width = <4>;
>> >>         non-removable;
>> >>         status = "okay";
>> >>
>> >>         brcmf: wifi at 1 {
>> >>                 reg = <1>;
>> >>                 compatible = "brcm,bcm4329-fmac";
>> >>                 interrupt-parent = <&r_pio>;
>> >>                 interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>;  /* WL-WAKE-AP: PL3 */
>> >>                 interrupt-names = "host-wake";
>> >>         };
>> >> };
>> >>
>> >> And observed rtc-osc32k-out clock is never enabled[1] and the value of
>> >> LOSC_OUT_GATING is 0x0 which eventually not enabling
>> >> LOSC_OUT_GATING_EN
>> >>
>> >> Pls. let us know if we miss anything here?
>> >>
>> >> [1] https://paste.ubuntu.com/p/X2By4q8kD2/
>> >
>> > Could you paste your config and the logs from a boot to?
>>
>> .config
>> https://paste.ubuntu.com/p/w9w2KB7RFc/
>>
>> dmesg
>> https://paste.ubuntu.com/p/mrZGk5bWRR/
>
> This is kind of weird. Have you tested with a 4.17 kernel? We have
> runtime_pm changes lined up in next, so that might be a regression
> there, even though we tested it with Quentin at some point.

This is 4.17-rc4 do you want to try it on 4.16 ?

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Allwinner A64: Issue on external rtc clock to wifi chip
@ 2018-05-14  9:06           ` Maxime Ripard
  0 siblings, 0 replies; 27+ messages in thread
From: Maxime Ripard @ 2018-05-14  9:06 UTC (permalink / raw)
  To: Jagan Teki
  Cc: Chen-Yu Tsai, Michael Trimarchi, linux-sunxi, linux-kernel,
	linux-arm-kernel, devicetree

[-- Attachment #1: Type: text/plain, Size: 2895 bytes --]

On Mon, May 14, 2018 at 02:34:22PM +0530, Jagan Teki wrote:
> On Mon, May 14, 2018 at 1:57 PM, Maxime Ripard
> <maxime.ripard@bootlin.com> wrote:
> > On Mon, May 14, 2018 at 01:34:56PM +0530, Jagan Teki wrote:
> >> On Mon, May 14, 2018 at 1:27 PM, Maxime Ripard
> >> <maxime.ripard@bootlin.com> wrote:
> >> > Hi,
> >> >
> >> > On Mon, May 14, 2018 at 12:37:49PM +0530, Jagan Teki wrote:
> >> >> Hi Maxime and All,
> >> >>
> >> >> We are trying to bring-up AP6330 Wifi chip for A64 board. We noticed
> >> >> to have an external rtc clock has driven from wifi chip.
> >> >>
> >> >> So the devicetree is configured according to this as below.
> >> >>
> >> >> / {
> >> >>         wifi_pwrseq: wifi-pwrseq {
> >> >>                 compatible = "mmc-pwrseq-simple";
> >> >>                 clocks = <&rtc 1>;
> >> >>                 clock-names = "ext_clock";
> >> >>                 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
> >> >>                 post-power-on-delay-ms = <400>;
> >> >>         };
> >> >> };
> >> >>
> >> >> &rtc {
> >> >>         clock-output-names = "rtc-osc32k", "rtc-osc32k-out";
> >> >>         clocks = <&osc32k>;
> >> >>         #clock-cells = <1>;
> >> >> };
> >> >>
> >> >> &mmc1 {
> >> >>         pinctrl-names = "default";
> >> >>         pinctrl-0 = <&mmc1_pins>;
> >> >>         vmmc-supply = <&reg_dcdc1>;
> >> >>         vqmmc-supply = <&reg_eldo1>;
> >> >>         mmc-pwrseq = <&wifi_pwrseq>;
> >> >>         bus-width = <4>;
> >> >>         non-removable;
> >> >>         status = "okay";
> >> >>
> >> >>         brcmf: wifi@1 {
> >> >>                 reg = <1>;
> >> >>                 compatible = "brcm,bcm4329-fmac";
> >> >>                 interrupt-parent = <&r_pio>;
> >> >>                 interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>;  /* WL-WAKE-AP: PL3 */
> >> >>                 interrupt-names = "host-wake";
> >> >>         };
> >> >> };
> >> >>
> >> >> And observed rtc-osc32k-out clock is never enabled[1] and the value of
> >> >> LOSC_OUT_GATING is 0x0 which eventually not enabling
> >> >> LOSC_OUT_GATING_EN
> >> >>
> >> >> Pls. let us know if we miss anything here?
> >> >>
> >> >> [1] https://paste.ubuntu.com/p/X2By4q8kD2/
> >> >
> >> > Could you paste your config and the logs from a boot to?
> >>
> >> .config
> >> https://paste.ubuntu.com/p/w9w2KB7RFc/
> >>
> >> dmesg
> >> https://paste.ubuntu.com/p/mrZGk5bWRR/
> >
> > This is kind of weird. Have you tested with a 4.17 kernel? We have
> > runtime_pm changes lined up in next, so that might be a regression
> > there, even though we tested it with Quentin at some point.
> 
> This is 4.17-rc4 do you want to try it on 4.16 ?

No, this is next-20180503. Please try with 4.17-rc4

Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Allwinner A64: Issue on external rtc clock to wifi chip
@ 2018-05-14  9:06           ` Maxime Ripard
  0 siblings, 0 replies; 27+ messages in thread
From: Maxime Ripard @ 2018-05-14  9:06 UTC (permalink / raw)
  To: Jagan Teki
  Cc: Chen-Yu Tsai, Michael Trimarchi, linux-sunxi, linux-kernel,
	linux-arm-kernel, devicetree

[-- Attachment #1: Type: text/plain, Size: 2869 bytes --]

On Mon, May 14, 2018 at 02:34:22PM +0530, Jagan Teki wrote:
> On Mon, May 14, 2018 at 1:57 PM, Maxime Ripard
> <maxime.ripard-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org> wrote:
> > On Mon, May 14, 2018 at 01:34:56PM +0530, Jagan Teki wrote:
> >> On Mon, May 14, 2018 at 1:27 PM, Maxime Ripard
> >> <maxime.ripard-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org> wrote:
> >> > Hi,
> >> >
> >> > On Mon, May 14, 2018 at 12:37:49PM +0530, Jagan Teki wrote:
> >> >> Hi Maxime and All,
> >> >>
> >> >> We are trying to bring-up AP6330 Wifi chip for A64 board. We noticed
> >> >> to have an external rtc clock has driven from wifi chip.
> >> >>
> >> >> So the devicetree is configured according to this as below.
> >> >>
> >> >> / {
> >> >>         wifi_pwrseq: wifi-pwrseq {
> >> >>                 compatible = "mmc-pwrseq-simple";
> >> >>                 clocks = <&rtc 1>;
> >> >>                 clock-names = "ext_clock";
> >> >>                 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
> >> >>                 post-power-on-delay-ms = <400>;
> >> >>         };
> >> >> };
> >> >>
> >> >> &rtc {
> >> >>         clock-output-names = "rtc-osc32k", "rtc-osc32k-out";
> >> >>         clocks = <&osc32k>;
> >> >>         #clock-cells = <1>;
> >> >> };
> >> >>
> >> >> &mmc1 {
> >> >>         pinctrl-names = "default";
> >> >>         pinctrl-0 = <&mmc1_pins>;
> >> >>         vmmc-supply = <&reg_dcdc1>;
> >> >>         vqmmc-supply = <&reg_eldo1>;
> >> >>         mmc-pwrseq = <&wifi_pwrseq>;
> >> >>         bus-width = <4>;
> >> >>         non-removable;
> >> >>         status = "okay";
> >> >>
> >> >>         brcmf: wifi@1 {
> >> >>                 reg = <1>;
> >> >>                 compatible = "brcm,bcm4329-fmac";
> >> >>                 interrupt-parent = <&r_pio>;
> >> >>                 interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>;  /* WL-WAKE-AP: PL3 */
> >> >>                 interrupt-names = "host-wake";
> >> >>         };
> >> >> };
> >> >>
> >> >> And observed rtc-osc32k-out clock is never enabled[1] and the value of
> >> >> LOSC_OUT_GATING is 0x0 which eventually not enabling
> >> >> LOSC_OUT_GATING_EN
> >> >>
> >> >> Pls. let us know if we miss anything here?
> >> >>
> >> >> [1] https://paste.ubuntu.com/p/X2By4q8kD2/
> >> >
> >> > Could you paste your config and the logs from a boot to?
> >>
> >> .config
> >> https://paste.ubuntu.com/p/w9w2KB7RFc/
> >>
> >> dmesg
> >> https://paste.ubuntu.com/p/mrZGk5bWRR/
> >
> > This is kind of weird. Have you tested with a 4.17 kernel? We have
> > runtime_pm changes lined up in next, so that might be a regression
> > there, even though we tested it with Quentin at some point.
> 
> This is 4.17-rc4 do you want to try it on 4.16 ?

No, this is next-20180503. Please try with 4.17-rc4

Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Allwinner A64: Issue on external rtc clock to wifi chip
@ 2018-05-14  9:06           ` Maxime Ripard
  0 siblings, 0 replies; 27+ messages in thread
From: Maxime Ripard @ 2018-05-14  9:06 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, May 14, 2018 at 02:34:22PM +0530, Jagan Teki wrote:
> On Mon, May 14, 2018 at 1:57 PM, Maxime Ripard
> <maxime.ripard@bootlin.com> wrote:
> > On Mon, May 14, 2018 at 01:34:56PM +0530, Jagan Teki wrote:
> >> On Mon, May 14, 2018 at 1:27 PM, Maxime Ripard
> >> <maxime.ripard@bootlin.com> wrote:
> >> > Hi,
> >> >
> >> > On Mon, May 14, 2018 at 12:37:49PM +0530, Jagan Teki wrote:
> >> >> Hi Maxime and All,
> >> >>
> >> >> We are trying to bring-up AP6330 Wifi chip for A64 board. We noticed
> >> >> to have an external rtc clock has driven from wifi chip.
> >> >>
> >> >> So the devicetree is configured according to this as below.
> >> >>
> >> >> / {
> >> >>         wifi_pwrseq: wifi-pwrseq {
> >> >>                 compatible = "mmc-pwrseq-simple";
> >> >>                 clocks = <&rtc 1>;
> >> >>                 clock-names = "ext_clock";
> >> >>                 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
> >> >>                 post-power-on-delay-ms = <400>;
> >> >>         };
> >> >> };
> >> >>
> >> >> &rtc {
> >> >>         clock-output-names = "rtc-osc32k", "rtc-osc32k-out";
> >> >>         clocks = <&osc32k>;
> >> >>         #clock-cells = <1>;
> >> >> };
> >> >>
> >> >> &mmc1 {
> >> >>         pinctrl-names = "default";
> >> >>         pinctrl-0 = <&mmc1_pins>;
> >> >>         vmmc-supply = <&reg_dcdc1>;
> >> >>         vqmmc-supply = <&reg_eldo1>;
> >> >>         mmc-pwrseq = <&wifi_pwrseq>;
> >> >>         bus-width = <4>;
> >> >>         non-removable;
> >> >>         status = "okay";
> >> >>
> >> >>         brcmf: wifi at 1 {
> >> >>                 reg = <1>;
> >> >>                 compatible = "brcm,bcm4329-fmac";
> >> >>                 interrupt-parent = <&r_pio>;
> >> >>                 interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>;  /* WL-WAKE-AP: PL3 */
> >> >>                 interrupt-names = "host-wake";
> >> >>         };
> >> >> };
> >> >>
> >> >> And observed rtc-osc32k-out clock is never enabled[1] and the value of
> >> >> LOSC_OUT_GATING is 0x0 which eventually not enabling
> >> >> LOSC_OUT_GATING_EN
> >> >>
> >> >> Pls. let us know if we miss anything here?
> >> >>
> >> >> [1] https://paste.ubuntu.com/p/X2By4q8kD2/
> >> >
> >> > Could you paste your config and the logs from a boot to?
> >>
> >> .config
> >> https://paste.ubuntu.com/p/w9w2KB7RFc/
> >>
> >> dmesg
> >> https://paste.ubuntu.com/p/mrZGk5bWRR/
> >
> > This is kind of weird. Have you tested with a 4.17 kernel? We have
> > runtime_pm changes lined up in next, so that might be a regression
> > there, even though we tested it with Quentin at some point.
> 
> This is 4.17-rc4 do you want to try it on 4.16 ?

No, this is next-20180503. Please try with 4.17-rc4

Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180514/4a2bdde5/attachment-0001.sig>

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Allwinner A64: Issue on external rtc clock to wifi chip
  2018-05-14  9:06           ` Maxime Ripard
  (?)
@ 2018-05-14  9:42             ` Jagan Teki
  -1 siblings, 0 replies; 27+ messages in thread
From: Jagan Teki @ 2018-05-14  9:42 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Chen-Yu Tsai, Michael Trimarchi, linux-sunxi, linux-kernel,
	linux-arm-kernel, devicetree

On Mon, May 14, 2018 at 2:36 PM, Maxime Ripard
<maxime.ripard@bootlin.com> wrote:
> On Mon, May 14, 2018 at 02:34:22PM +0530, Jagan Teki wrote:
>> On Mon, May 14, 2018 at 1:57 PM, Maxime Ripard
>> <maxime.ripard@bootlin.com> wrote:
>> > On Mon, May 14, 2018 at 01:34:56PM +0530, Jagan Teki wrote:
>> >> On Mon, May 14, 2018 at 1:27 PM, Maxime Ripard
>> >> <maxime.ripard@bootlin.com> wrote:
>> >> > Hi,
>> >> >
>> >> > On Mon, May 14, 2018 at 12:37:49PM +0530, Jagan Teki wrote:
>> >> >> Hi Maxime and All,
>> >> >>
>> >> >> We are trying to bring-up AP6330 Wifi chip for A64 board. We noticed
>> >> >> to have an external rtc clock has driven from wifi chip.
>> >> >>
>> >> >> So the devicetree is configured according to this as below.
>> >> >>
>> >> >> / {
>> >> >>         wifi_pwrseq: wifi-pwrseq {
>> >> >>                 compatible = "mmc-pwrseq-simple";
>> >> >>                 clocks = <&rtc 1>;
>> >> >>                 clock-names = "ext_clock";
>> >> >>                 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
>> >> >>                 post-power-on-delay-ms = <400>;
>> >> >>         };
>> >> >> };
>> >> >>
>> >> >> &rtc {
>> >> >>         clock-output-names = "rtc-osc32k", "rtc-osc32k-out";
>> >> >>         clocks = <&osc32k>;
>> >> >>         #clock-cells = <1>;
>> >> >> };
>> >> >>
>> >> >> &mmc1 {
>> >> >>         pinctrl-names = "default";
>> >> >>         pinctrl-0 = <&mmc1_pins>;
>> >> >>         vmmc-supply = <&reg_dcdc1>;
>> >> >>         vqmmc-supply = <&reg_eldo1>;
>> >> >>         mmc-pwrseq = <&wifi_pwrseq>;
>> >> >>         bus-width = <4>;
>> >> >>         non-removable;
>> >> >>         status = "okay";
>> >> >>
>> >> >>         brcmf: wifi@1 {
>> >> >>                 reg = <1>;
>> >> >>                 compatible = "brcm,bcm4329-fmac";
>> >> >>                 interrupt-parent = <&r_pio>;
>> >> >>                 interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>;  /* WL-WAKE-AP: PL3 */
>> >> >>                 interrupt-names = "host-wake";
>> >> >>         };
>> >> >> };
>> >> >>
>> >> >> And observed rtc-osc32k-out clock is never enabled[1] and the value of
>> >> >> LOSC_OUT_GATING is 0x0 which eventually not enabling
>> >> >> LOSC_OUT_GATING_EN
>> >> >>
>> >> >> Pls. let us know if we miss anything here?
>> >> >>
>> >> >> [1] https://paste.ubuntu.com/p/X2By4q8kD2/
>> >> >
>> >> > Could you paste your config and the logs from a boot to?
>> >>
>> >> .config
>> >> https://paste.ubuntu.com/p/w9w2KB7RFc/
>> >>
>> >> dmesg
>> >> https://paste.ubuntu.com/p/mrZGk5bWRR/
>> >
>> > This is kind of weird. Have you tested with a 4.17 kernel? We have
>> > runtime_pm changes lined up in next, so that might be a regression
>> > there, even though we tested it with Quentin at some point.
>>
>> This is 4.17-rc4 do you want to try it on 4.16 ?
>
> No, this is next-20180503. Please try with 4.17-rc4

Couldn't find any different in behaviour [2]

[2] https://paste.ubuntu.com/p/m3PGBwrv6W/

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Allwinner A64: Issue on external rtc clock to wifi chip
@ 2018-05-14  9:42             ` Jagan Teki
  0 siblings, 0 replies; 27+ messages in thread
From: Jagan Teki @ 2018-05-14  9:42 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Chen-Yu Tsai, Michael Trimarchi, linux-sunxi, linux-kernel,
	linux-arm-kernel, devicetree

On Mon, May 14, 2018 at 2:36 PM, Maxime Ripard
<maxime.ripard-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org> wrote:
> On Mon, May 14, 2018 at 02:34:22PM +0530, Jagan Teki wrote:
>> On Mon, May 14, 2018 at 1:57 PM, Maxime Ripard
>> <maxime.ripard-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org> wrote:
>> > On Mon, May 14, 2018 at 01:34:56PM +0530, Jagan Teki wrote:
>> >> On Mon, May 14, 2018 at 1:27 PM, Maxime Ripard
>> >> <maxime.ripard-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org> wrote:
>> >> > Hi,
>> >> >
>> >> > On Mon, May 14, 2018 at 12:37:49PM +0530, Jagan Teki wrote:
>> >> >> Hi Maxime and All,
>> >> >>
>> >> >> We are trying to bring-up AP6330 Wifi chip for A64 board. We noticed
>> >> >> to have an external rtc clock has driven from wifi chip.
>> >> >>
>> >> >> So the devicetree is configured according to this as below.
>> >> >>
>> >> >> / {
>> >> >>         wifi_pwrseq: wifi-pwrseq {
>> >> >>                 compatible = "mmc-pwrseq-simple";
>> >> >>                 clocks = <&rtc 1>;
>> >> >>                 clock-names = "ext_clock";
>> >> >>                 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
>> >> >>                 post-power-on-delay-ms = <400>;
>> >> >>         };
>> >> >> };
>> >> >>
>> >> >> &rtc {
>> >> >>         clock-output-names = "rtc-osc32k", "rtc-osc32k-out";
>> >> >>         clocks = <&osc32k>;
>> >> >>         #clock-cells = <1>;
>> >> >> };
>> >> >>
>> >> >> &mmc1 {
>> >> >>         pinctrl-names = "default";
>> >> >>         pinctrl-0 = <&mmc1_pins>;
>> >> >>         vmmc-supply = <&reg_dcdc1>;
>> >> >>         vqmmc-supply = <&reg_eldo1>;
>> >> >>         mmc-pwrseq = <&wifi_pwrseq>;
>> >> >>         bus-width = <4>;
>> >> >>         non-removable;
>> >> >>         status = "okay";
>> >> >>
>> >> >>         brcmf: wifi@1 {
>> >> >>                 reg = <1>;
>> >> >>                 compatible = "brcm,bcm4329-fmac";
>> >> >>                 interrupt-parent = <&r_pio>;
>> >> >>                 interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>;  /* WL-WAKE-AP: PL3 */
>> >> >>                 interrupt-names = "host-wake";
>> >> >>         };
>> >> >> };
>> >> >>
>> >> >> And observed rtc-osc32k-out clock is never enabled[1] and the value of
>> >> >> LOSC_OUT_GATING is 0x0 which eventually not enabling
>> >> >> LOSC_OUT_GATING_EN
>> >> >>
>> >> >> Pls. let us know if we miss anything here?
>> >> >>
>> >> >> [1] https://paste.ubuntu.com/p/X2By4q8kD2/
>> >> >
>> >> > Could you paste your config and the logs from a boot to?
>> >>
>> >> .config
>> >> https://paste.ubuntu.com/p/w9w2KB7RFc/
>> >>
>> >> dmesg
>> >> https://paste.ubuntu.com/p/mrZGk5bWRR/
>> >
>> > This is kind of weird. Have you tested with a 4.17 kernel? We have
>> > runtime_pm changes lined up in next, so that might be a regression
>> > there, even though we tested it with Quentin at some point.
>>
>> This is 4.17-rc4 do you want to try it on 4.16 ?
>
> No, this is next-20180503. Please try with 4.17-rc4

Couldn't find any different in behaviour [2]

[2] https://paste.ubuntu.com/p/m3PGBwrv6W/

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Allwinner A64: Issue on external rtc clock to wifi chip
@ 2018-05-14  9:42             ` Jagan Teki
  0 siblings, 0 replies; 27+ messages in thread
From: Jagan Teki @ 2018-05-14  9:42 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, May 14, 2018 at 2:36 PM, Maxime Ripard
<maxime.ripard@bootlin.com> wrote:
> On Mon, May 14, 2018 at 02:34:22PM +0530, Jagan Teki wrote:
>> On Mon, May 14, 2018 at 1:57 PM, Maxime Ripard
>> <maxime.ripard@bootlin.com> wrote:
>> > On Mon, May 14, 2018 at 01:34:56PM +0530, Jagan Teki wrote:
>> >> On Mon, May 14, 2018 at 1:27 PM, Maxime Ripard
>> >> <maxime.ripard@bootlin.com> wrote:
>> >> > Hi,
>> >> >
>> >> > On Mon, May 14, 2018 at 12:37:49PM +0530, Jagan Teki wrote:
>> >> >> Hi Maxime and All,
>> >> >>
>> >> >> We are trying to bring-up AP6330 Wifi chip for A64 board. We noticed
>> >> >> to have an external rtc clock has driven from wifi chip.
>> >> >>
>> >> >> So the devicetree is configured according to this as below.
>> >> >>
>> >> >> / {
>> >> >>         wifi_pwrseq: wifi-pwrseq {
>> >> >>                 compatible = "mmc-pwrseq-simple";
>> >> >>                 clocks = <&rtc 1>;
>> >> >>                 clock-names = "ext_clock";
>> >> >>                 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
>> >> >>                 post-power-on-delay-ms = <400>;
>> >> >>         };
>> >> >> };
>> >> >>
>> >> >> &rtc {
>> >> >>         clock-output-names = "rtc-osc32k", "rtc-osc32k-out";
>> >> >>         clocks = <&osc32k>;
>> >> >>         #clock-cells = <1>;
>> >> >> };
>> >> >>
>> >> >> &mmc1 {
>> >> >>         pinctrl-names = "default";
>> >> >>         pinctrl-0 = <&mmc1_pins>;
>> >> >>         vmmc-supply = <&reg_dcdc1>;
>> >> >>         vqmmc-supply = <&reg_eldo1>;
>> >> >>         mmc-pwrseq = <&wifi_pwrseq>;
>> >> >>         bus-width = <4>;
>> >> >>         non-removable;
>> >> >>         status = "okay";
>> >> >>
>> >> >>         brcmf: wifi at 1 {
>> >> >>                 reg = <1>;
>> >> >>                 compatible = "brcm,bcm4329-fmac";
>> >> >>                 interrupt-parent = <&r_pio>;
>> >> >>                 interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>;  /* WL-WAKE-AP: PL3 */
>> >> >>                 interrupt-names = "host-wake";
>> >> >>         };
>> >> >> };
>> >> >>
>> >> >> And observed rtc-osc32k-out clock is never enabled[1] and the value of
>> >> >> LOSC_OUT_GATING is 0x0 which eventually not enabling
>> >> >> LOSC_OUT_GATING_EN
>> >> >>
>> >> >> Pls. let us know if we miss anything here?
>> >> >>
>> >> >> [1] https://paste.ubuntu.com/p/X2By4q8kD2/
>> >> >
>> >> > Could you paste your config and the logs from a boot to?
>> >>
>> >> .config
>> >> https://paste.ubuntu.com/p/w9w2KB7RFc/
>> >>
>> >> dmesg
>> >> https://paste.ubuntu.com/p/mrZGk5bWRR/
>> >
>> > This is kind of weird. Have you tested with a 4.17 kernel? We have
>> > runtime_pm changes lined up in next, so that might be a regression
>> > there, even though we tested it with Quentin at some point.
>>
>> This is 4.17-rc4 do you want to try it on 4.16 ?
>
> No, this is next-20180503. Please try with 4.17-rc4

Couldn't find any different in behaviour [2]

[2] https://paste.ubuntu.com/p/m3PGBwrv6W/

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Allwinner A64: Issue on external rtc clock to wifi chip
@ 2018-05-14 11:17               ` Maxime Ripard
  0 siblings, 0 replies; 27+ messages in thread
From: Maxime Ripard @ 2018-05-14 11:17 UTC (permalink / raw)
  To: Jagan Teki
  Cc: Chen-Yu Tsai, Michael Trimarchi, linux-sunxi, linux-kernel,
	linux-arm-kernel, devicetree

[-- Attachment #1: Type: text/plain, Size: 3537 bytes --]

On Mon, May 14, 2018 at 03:12:49PM +0530, Jagan Teki wrote:
> On Mon, May 14, 2018 at 2:36 PM, Maxime Ripard
> <maxime.ripard@bootlin.com> wrote:
> > On Mon, May 14, 2018 at 02:34:22PM +0530, Jagan Teki wrote:
> >> On Mon, May 14, 2018 at 1:57 PM, Maxime Ripard
> >> <maxime.ripard@bootlin.com> wrote:
> >> > On Mon, May 14, 2018 at 01:34:56PM +0530, Jagan Teki wrote:
> >> >> On Mon, May 14, 2018 at 1:27 PM, Maxime Ripard
> >> >> <maxime.ripard@bootlin.com> wrote:
> >> >> > Hi,
> >> >> >
> >> >> > On Mon, May 14, 2018 at 12:37:49PM +0530, Jagan Teki wrote:
> >> >> >> Hi Maxime and All,
> >> >> >>
> >> >> >> We are trying to bring-up AP6330 Wifi chip for A64 board. We noticed
> >> >> >> to have an external rtc clock has driven from wifi chip.
> >> >> >>
> >> >> >> So the devicetree is configured according to this as below.
> >> >> >>
> >> >> >> / {
> >> >> >>         wifi_pwrseq: wifi-pwrseq {
> >> >> >>                 compatible = "mmc-pwrseq-simple";
> >> >> >>                 clocks = <&rtc 1>;
> >> >> >>                 clock-names = "ext_clock";
> >> >> >>                 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
> >> >> >>                 post-power-on-delay-ms = <400>;
> >> >> >>         };
> >> >> >> };
> >> >> >>
> >> >> >> &rtc {
> >> >> >>         clock-output-names = "rtc-osc32k", "rtc-osc32k-out";
> >> >> >>         clocks = <&osc32k>;
> >> >> >>         #clock-cells = <1>;
> >> >> >> };
> >> >> >>
> >> >> >> &mmc1 {
> >> >> >>         pinctrl-names = "default";
> >> >> >>         pinctrl-0 = <&mmc1_pins>;
> >> >> >>         vmmc-supply = <&reg_dcdc1>;
> >> >> >>         vqmmc-supply = <&reg_eldo1>;
> >> >> >>         mmc-pwrseq = <&wifi_pwrseq>;
> >> >> >>         bus-width = <4>;
> >> >> >>         non-removable;
> >> >> >>         status = "okay";
> >> >> >>
> >> >> >>         brcmf: wifi@1 {
> >> >> >>                 reg = <1>;
> >> >> >>                 compatible = "brcm,bcm4329-fmac";
> >> >> >>                 interrupt-parent = <&r_pio>;
> >> >> >>                 interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>;  /* WL-WAKE-AP: PL3 */
> >> >> >>                 interrupt-names = "host-wake";
> >> >> >>         };
> >> >> >> };
> >> >> >>
> >> >> >> And observed rtc-osc32k-out clock is never enabled[1] and the value of
> >> >> >> LOSC_OUT_GATING is 0x0 which eventually not enabling
> >> >> >> LOSC_OUT_GATING_EN
> >> >> >>
> >> >> >> Pls. let us know if we miss anything here?
> >> >> >>
> >> >> >> [1] https://paste.ubuntu.com/p/X2By4q8kD2/
> >> >> >
> >> >> > Could you paste your config and the logs from a boot to?
> >> >>
> >> >> .config
> >> >> https://paste.ubuntu.com/p/w9w2KB7RFc/
> >> >>
> >> >> dmesg
> >> >> https://paste.ubuntu.com/p/mrZGk5bWRR/
> >> >
> >> > This is kind of weird. Have you tested with a 4.17 kernel? We have
> >> > runtime_pm changes lined up in next, so that might be a regression
> >> > there, even though we tested it with Quentin at some point.
> >>
> >> This is 4.17-rc4 do you want to try it on 4.16 ?
> >
> > No, this is next-20180503. Please try with 4.17-rc4
> 
> Couldn't find any different in behaviour [2]
> 
> [2] https://paste.ubuntu.com/p/m3PGBwrv6W/

It's hard to tell without the board, but have you looked at the return
value of devm_clk_get in the pwrseq code?

Enabling the clk ftrace events would also help.

Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Allwinner A64: Issue on external rtc clock to wifi chip
@ 2018-05-14 11:17               ` Maxime Ripard
  0 siblings, 0 replies; 27+ messages in thread
From: Maxime Ripard @ 2018-05-14 11:17 UTC (permalink / raw)
  To: Jagan Teki
  Cc: Chen-Yu Tsai, Michael Trimarchi, linux-sunxi, linux-kernel,
	linux-arm-kernel, devicetree

[-- Attachment #1: Type: text/plain, Size: 3527 bytes --]

On Mon, May 14, 2018 at 03:12:49PM +0530, Jagan Teki wrote:
> On Mon, May 14, 2018 at 2:36 PM, Maxime Ripard
> <maxime.ripard-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org> wrote:
> > On Mon, May 14, 2018 at 02:34:22PM +0530, Jagan Teki wrote:
> >> On Mon, May 14, 2018 at 1:57 PM, Maxime Ripard
> >> <maxime.ripard-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org> wrote:
> >> > On Mon, May 14, 2018 at 01:34:56PM +0530, Jagan Teki wrote:
> >> >> On Mon, May 14, 2018 at 1:27 PM, Maxime Ripard
> >> >> <maxime.ripard-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org> wrote:
> >> >> > Hi,
> >> >> >
> >> >> > On Mon, May 14, 2018 at 12:37:49PM +0530, Jagan Teki wrote:
> >> >> >> Hi Maxime and All,
> >> >> >>
> >> >> >> We are trying to bring-up AP6330 Wifi chip for A64 board. We noticed
> >> >> >> to have an external rtc clock has driven from wifi chip.
> >> >> >>
> >> >> >> So the devicetree is configured according to this as below.
> >> >> >>
> >> >> >> / {
> >> >> >>         wifi_pwrseq: wifi-pwrseq {
> >> >> >>                 compatible = "mmc-pwrseq-simple";
> >> >> >>                 clocks = <&rtc 1>;
> >> >> >>                 clock-names = "ext_clock";
> >> >> >>                 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
> >> >> >>                 post-power-on-delay-ms = <400>;
> >> >> >>         };
> >> >> >> };
> >> >> >>
> >> >> >> &rtc {
> >> >> >>         clock-output-names = "rtc-osc32k", "rtc-osc32k-out";
> >> >> >>         clocks = <&osc32k>;
> >> >> >>         #clock-cells = <1>;
> >> >> >> };
> >> >> >>
> >> >> >> &mmc1 {
> >> >> >>         pinctrl-names = "default";
> >> >> >>         pinctrl-0 = <&mmc1_pins>;
> >> >> >>         vmmc-supply = <&reg_dcdc1>;
> >> >> >>         vqmmc-supply = <&reg_eldo1>;
> >> >> >>         mmc-pwrseq = <&wifi_pwrseq>;
> >> >> >>         bus-width = <4>;
> >> >> >>         non-removable;
> >> >> >>         status = "okay";
> >> >> >>
> >> >> >>         brcmf: wifi@1 {
> >> >> >>                 reg = <1>;
> >> >> >>                 compatible = "brcm,bcm4329-fmac";
> >> >> >>                 interrupt-parent = <&r_pio>;
> >> >> >>                 interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>;  /* WL-WAKE-AP: PL3 */
> >> >> >>                 interrupt-names = "host-wake";
> >> >> >>         };
> >> >> >> };
> >> >> >>
> >> >> >> And observed rtc-osc32k-out clock is never enabled[1] and the value of
> >> >> >> LOSC_OUT_GATING is 0x0 which eventually not enabling
> >> >> >> LOSC_OUT_GATING_EN
> >> >> >>
> >> >> >> Pls. let us know if we miss anything here?
> >> >> >>
> >> >> >> [1] https://paste.ubuntu.com/p/X2By4q8kD2/
> >> >> >
> >> >> > Could you paste your config and the logs from a boot to?
> >> >>
> >> >> .config
> >> >> https://paste.ubuntu.com/p/w9w2KB7RFc/
> >> >>
> >> >> dmesg
> >> >> https://paste.ubuntu.com/p/mrZGk5bWRR/
> >> >
> >> > This is kind of weird. Have you tested with a 4.17 kernel? We have
> >> > runtime_pm changes lined up in next, so that might be a regression
> >> > there, even though we tested it with Quentin at some point.
> >>
> >> This is 4.17-rc4 do you want to try it on 4.16 ?
> >
> > No, this is next-20180503. Please try with 4.17-rc4
> 
> Couldn't find any different in behaviour [2]
> 
> [2] https://paste.ubuntu.com/p/m3PGBwrv6W/

It's hard to tell without the board, but have you looked at the return
value of devm_clk_get in the pwrseq code?

Enabling the clk ftrace events would also help.

Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Allwinner A64: Issue on external rtc clock to wifi chip
@ 2018-05-14 11:17               ` Maxime Ripard
  0 siblings, 0 replies; 27+ messages in thread
From: Maxime Ripard @ 2018-05-14 11:17 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, May 14, 2018 at 03:12:49PM +0530, Jagan Teki wrote:
> On Mon, May 14, 2018 at 2:36 PM, Maxime Ripard
> <maxime.ripard@bootlin.com> wrote:
> > On Mon, May 14, 2018 at 02:34:22PM +0530, Jagan Teki wrote:
> >> On Mon, May 14, 2018 at 1:57 PM, Maxime Ripard
> >> <maxime.ripard@bootlin.com> wrote:
> >> > On Mon, May 14, 2018 at 01:34:56PM +0530, Jagan Teki wrote:
> >> >> On Mon, May 14, 2018 at 1:27 PM, Maxime Ripard
> >> >> <maxime.ripard@bootlin.com> wrote:
> >> >> > Hi,
> >> >> >
> >> >> > On Mon, May 14, 2018 at 12:37:49PM +0530, Jagan Teki wrote:
> >> >> >> Hi Maxime and All,
> >> >> >>
> >> >> >> We are trying to bring-up AP6330 Wifi chip for A64 board. We noticed
> >> >> >> to have an external rtc clock has driven from wifi chip.
> >> >> >>
> >> >> >> So the devicetree is configured according to this as below.
> >> >> >>
> >> >> >> / {
> >> >> >>         wifi_pwrseq: wifi-pwrseq {
> >> >> >>                 compatible = "mmc-pwrseq-simple";
> >> >> >>                 clocks = <&rtc 1>;
> >> >> >>                 clock-names = "ext_clock";
> >> >> >>                 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
> >> >> >>                 post-power-on-delay-ms = <400>;
> >> >> >>         };
> >> >> >> };
> >> >> >>
> >> >> >> &rtc {
> >> >> >>         clock-output-names = "rtc-osc32k", "rtc-osc32k-out";
> >> >> >>         clocks = <&osc32k>;
> >> >> >>         #clock-cells = <1>;
> >> >> >> };
> >> >> >>
> >> >> >> &mmc1 {
> >> >> >>         pinctrl-names = "default";
> >> >> >>         pinctrl-0 = <&mmc1_pins>;
> >> >> >>         vmmc-supply = <&reg_dcdc1>;
> >> >> >>         vqmmc-supply = <&reg_eldo1>;
> >> >> >>         mmc-pwrseq = <&wifi_pwrseq>;
> >> >> >>         bus-width = <4>;
> >> >> >>         non-removable;
> >> >> >>         status = "okay";
> >> >> >>
> >> >> >>         brcmf: wifi at 1 {
> >> >> >>                 reg = <1>;
> >> >> >>                 compatible = "brcm,bcm4329-fmac";
> >> >> >>                 interrupt-parent = <&r_pio>;
> >> >> >>                 interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>;  /* WL-WAKE-AP: PL3 */
> >> >> >>                 interrupt-names = "host-wake";
> >> >> >>         };
> >> >> >> };
> >> >> >>
> >> >> >> And observed rtc-osc32k-out clock is never enabled[1] and the value of
> >> >> >> LOSC_OUT_GATING is 0x0 which eventually not enabling
> >> >> >> LOSC_OUT_GATING_EN
> >> >> >>
> >> >> >> Pls. let us know if we miss anything here?
> >> >> >>
> >> >> >> [1] https://paste.ubuntu.com/p/X2By4q8kD2/
> >> >> >
> >> >> > Could you paste your config and the logs from a boot to?
> >> >>
> >> >> .config
> >> >> https://paste.ubuntu.com/p/w9w2KB7RFc/
> >> >>
> >> >> dmesg
> >> >> https://paste.ubuntu.com/p/mrZGk5bWRR/
> >> >
> >> > This is kind of weird. Have you tested with a 4.17 kernel? We have
> >> > runtime_pm changes lined up in next, so that might be a regression
> >> > there, even though we tested it with Quentin at some point.
> >>
> >> This is 4.17-rc4 do you want to try it on 4.16 ?
> >
> > No, this is next-20180503. Please try with 4.17-rc4
> 
> Couldn't find any different in behaviour [2]
> 
> [2] https://paste.ubuntu.com/p/m3PGBwrv6W/

It's hard to tell without the board, but have you looked at the return
value of devm_clk_get in the pwrseq code?

Enabling the clk ftrace events would also help.

Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180514/4e65385a/attachment.sig>

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Allwinner A64: Issue on external rtc clock to wifi chip
  2018-05-14 11:17               ` Maxime Ripard
  (?)
@ 2018-05-28  7:08                 ` Michael Nazzareno Trimarchi
  -1 siblings, 0 replies; 27+ messages in thread
From: Michael Nazzareno Trimarchi @ 2018-05-28  7:08 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Jagan Teki, Chen-Yu Tsai, linux-sunxi, linux-kernel,
	linux-arm-kernel, devicetree

Hi Maxime

On Mon, May 14, 2018 at 1:17 PM, Maxime Ripard
<maxime.ripard@bootlin.com> wrote:
> On Mon, May 14, 2018 at 03:12:49PM +0530, Jagan Teki wrote:
>> On Mon, May 14, 2018 at 2:36 PM, Maxime Ripard
>> <maxime.ripard@bootlin.com> wrote:
>> > On Mon, May 14, 2018 at 02:34:22PM +0530, Jagan Teki wrote:
>> >> On Mon, May 14, 2018 at 1:57 PM, Maxime Ripard
>> >> <maxime.ripard@bootlin.com> wrote:
>> >> > On Mon, May 14, 2018 at 01:34:56PM +0530, Jagan Teki wrote:
>> >> >> On Mon, May 14, 2018 at 1:27 PM, Maxime Ripard
>> >> >> <maxime.ripard@bootlin.com> wrote:
>> >> >> > Hi,
>> >> >> >
>> >> >> > On Mon, May 14, 2018 at 12:37:49PM +0530, Jagan Teki wrote:
>> >> >> >> Hi Maxime and All,
>> >> >> >>
>> >> >> >> We are trying to bring-up AP6330 Wifi chip for A64 board. We noticed
>> >> >> >> to have an external rtc clock has driven from wifi chip.
>> >> >> >>
>> >> >> >> So the devicetree is configured according to this as below.
>> >> >> >>
>> >> >> >> / {
>> >> >> >>         wifi_pwrseq: wifi-pwrseq {
>> >> >> >>                 compatible = "mmc-pwrseq-simple";
>> >> >> >>                 clocks = <&rtc 1>;
>> >> >> >>                 clock-names = "ext_clock";
>> >> >> >>                 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
>> >> >> >>                 post-power-on-delay-ms = <400>;
>> >> >> >>         };
>> >> >> >> };
>> >> >> >>
>> >> >> >> &rtc {
>> >> >> >>         clock-output-names = "rtc-osc32k", "rtc-osc32k-out";
>> >> >> >>         clocks = <&osc32k>;
>> >> >> >>         #clock-cells = <1>;
>> >> >> >> };
>> >> >> >>
>> >> >> >> &mmc1 {
>> >> >> >>         pinctrl-names = "default";
>> >> >> >>         pinctrl-0 = <&mmc1_pins>;
>> >> >> >>         vmmc-supply = <&reg_dcdc1>;
>> >> >> >>         vqmmc-supply = <&reg_eldo1>;
>> >> >> >>         mmc-pwrseq = <&wifi_pwrseq>;
>> >> >> >>         bus-width = <4>;
>> >> >> >>         non-removable;
>> >> >> >>         status = "okay";
>> >> >> >>
>> >> >> >>         brcmf: wifi@1 {
>> >> >> >>                 reg = <1>;
>> >> >> >>                 compatible = "brcm,bcm4329-fmac";
>> >> >> >>                 interrupt-parent = <&r_pio>;
>> >> >> >>                 interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>;  /* WL-WAKE-AP: PL3 */
>> >> >> >>                 interrupt-names = "host-wake";
>> >> >> >>         };
>> >> >> >> };
>> >> >> >>
>> >> >> >> And observed rtc-osc32k-out clock is never enabled[1] and the value of
>> >> >> >> LOSC_OUT_GATING is 0x0 which eventually not enabling
>> >> >> >> LOSC_OUT_GATING_EN
>> >> >> >>
>> >> >> >> Pls. let us know if we miss anything here?
>> >> >> >>
>> >> >> >> [1] https://paste.ubuntu.com/p/X2By4q8kD2/
>> >> >> >
>> >> >> > Could you paste your config and the logs from a boot to?
>> >> >>
>> >> >> .config
>> >> >> https://paste.ubuntu.com/p/w9w2KB7RFc/
>> >> >>
>> >> >> dmesg
>> >> >> https://paste.ubuntu.com/p/mrZGk5bWRR/
>> >> >
>> >> > This is kind of weird. Have you tested with a 4.17 kernel? We have
>> >> > runtime_pm changes lined up in next, so that might be a regression
>> >> > there, even though we tested it with Quentin at some point.
>> >>
>> >> This is 4.17-rc4 do you want to try it on 4.16 ?
>> >
>> > No, this is next-20180503. Please try with 4.17-rc4
>>
>> Couldn't find any different in behaviour [2]
>>
>> [2] https://paste.ubuntu.com/p/m3PGBwrv6W/
>
> It's hard to tell without the board, but have you looked at the return
> value of devm_clk_get in the pwrseq code?
>
> Enabling the clk ftrace events would also help.
>

The driver has one bug.

diff --git a/drivers/rtc/rtc-sun6i.c b/drivers/rtc/rtc-sun6i.c
index 2e6fb27..a66f40c 100644
--- a/drivers/rtc/rtc-sun6i.c
+++ b/drivers/rtc/rtc-sun6i.c
@@ -74,7 +74,7 @@
 #define SUN6I_ALARM_CONFIG_WAKEUP              BIT(0)

 #define SUN6I_LOSC_OUT_GATING                  0x0060
-#define SUN6I_LOSC_OUT_GATING_EN               BIT(0)
+#define SUN6I_LOSC_OUT_GATING_EN               0

You need to pass bit_idx that is 0 and not BIT(0)

Michael


> Maxime
>
> --
> Maxime Ripard, Bootlin (formerly Free Electrons)
> Embedded Linux and Kernel engineering
> https://bootlin.com



-- 
| Michael Nazzareno Trimarchi                     Amarula Solutions BV |
| COO  -  Founder                                      Cruquiuskade 47 |
| +31(0)851119172                                 Amsterdam 1018 AM NL |
|                  [`as] http://www.amarulasolutions.com               |

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* Re: Allwinner A64: Issue on external rtc clock to wifi chip
@ 2018-05-28  7:08                 ` Michael Nazzareno Trimarchi
  0 siblings, 0 replies; 27+ messages in thread
From: Michael Nazzareno Trimarchi @ 2018-05-28  7:08 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Jagan Teki, Chen-Yu Tsai, linux-sunxi, linux-kernel,
	linux-arm-kernel, devicetree

Hi Maxime

On Mon, May 14, 2018 at 1:17 PM, Maxime Ripard
<maxime.ripard-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org> wrote:
> On Mon, May 14, 2018 at 03:12:49PM +0530, Jagan Teki wrote:
>> On Mon, May 14, 2018 at 2:36 PM, Maxime Ripard
>> <maxime.ripard-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org> wrote:
>> > On Mon, May 14, 2018 at 02:34:22PM +0530, Jagan Teki wrote:
>> >> On Mon, May 14, 2018 at 1:57 PM, Maxime Ripard
>> >> <maxime.ripard-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org> wrote:
>> >> > On Mon, May 14, 2018 at 01:34:56PM +0530, Jagan Teki wrote:
>> >> >> On Mon, May 14, 2018 at 1:27 PM, Maxime Ripard
>> >> >> <maxime.ripard-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org> wrote:
>> >> >> > Hi,
>> >> >> >
>> >> >> > On Mon, May 14, 2018 at 12:37:49PM +0530, Jagan Teki wrote:
>> >> >> >> Hi Maxime and All,
>> >> >> >>
>> >> >> >> We are trying to bring-up AP6330 Wifi chip for A64 board. We noticed
>> >> >> >> to have an external rtc clock has driven from wifi chip.
>> >> >> >>
>> >> >> >> So the devicetree is configured according to this as below.
>> >> >> >>
>> >> >> >> / {
>> >> >> >>         wifi_pwrseq: wifi-pwrseq {
>> >> >> >>                 compatible = "mmc-pwrseq-simple";
>> >> >> >>                 clocks = <&rtc 1>;
>> >> >> >>                 clock-names = "ext_clock";
>> >> >> >>                 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
>> >> >> >>                 post-power-on-delay-ms = <400>;
>> >> >> >>         };
>> >> >> >> };
>> >> >> >>
>> >> >> >> &rtc {
>> >> >> >>         clock-output-names = "rtc-osc32k", "rtc-osc32k-out";
>> >> >> >>         clocks = <&osc32k>;
>> >> >> >>         #clock-cells = <1>;
>> >> >> >> };
>> >> >> >>
>> >> >> >> &mmc1 {
>> >> >> >>         pinctrl-names = "default";
>> >> >> >>         pinctrl-0 = <&mmc1_pins>;
>> >> >> >>         vmmc-supply = <&reg_dcdc1>;
>> >> >> >>         vqmmc-supply = <&reg_eldo1>;
>> >> >> >>         mmc-pwrseq = <&wifi_pwrseq>;
>> >> >> >>         bus-width = <4>;
>> >> >> >>         non-removable;
>> >> >> >>         status = "okay";
>> >> >> >>
>> >> >> >>         brcmf: wifi@1 {
>> >> >> >>                 reg = <1>;
>> >> >> >>                 compatible = "brcm,bcm4329-fmac";
>> >> >> >>                 interrupt-parent = <&r_pio>;
>> >> >> >>                 interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>;  /* WL-WAKE-AP: PL3 */
>> >> >> >>                 interrupt-names = "host-wake";
>> >> >> >>         };
>> >> >> >> };
>> >> >> >>
>> >> >> >> And observed rtc-osc32k-out clock is never enabled[1] and the value of
>> >> >> >> LOSC_OUT_GATING is 0x0 which eventually not enabling
>> >> >> >> LOSC_OUT_GATING_EN
>> >> >> >>
>> >> >> >> Pls. let us know if we miss anything here?
>> >> >> >>
>> >> >> >> [1] https://paste.ubuntu.com/p/X2By4q8kD2/
>> >> >> >
>> >> >> > Could you paste your config and the logs from a boot to?
>> >> >>
>> >> >> .config
>> >> >> https://paste.ubuntu.com/p/w9w2KB7RFc/
>> >> >>
>> >> >> dmesg
>> >> >> https://paste.ubuntu.com/p/mrZGk5bWRR/
>> >> >
>> >> > This is kind of weird. Have you tested with a 4.17 kernel? We have
>> >> > runtime_pm changes lined up in next, so that might be a regression
>> >> > there, even though we tested it with Quentin at some point.
>> >>
>> >> This is 4.17-rc4 do you want to try it on 4.16 ?
>> >
>> > No, this is next-20180503. Please try with 4.17-rc4
>>
>> Couldn't find any different in behaviour [2]
>>
>> [2] https://paste.ubuntu.com/p/m3PGBwrv6W/
>
> It's hard to tell without the board, but have you looked at the return
> value of devm_clk_get in the pwrseq code?
>
> Enabling the clk ftrace events would also help.
>

The driver has one bug.

diff --git a/drivers/rtc/rtc-sun6i.c b/drivers/rtc/rtc-sun6i.c
index 2e6fb27..a66f40c 100644
--- a/drivers/rtc/rtc-sun6i.c
+++ b/drivers/rtc/rtc-sun6i.c
@@ -74,7 +74,7 @@
 #define SUN6I_ALARM_CONFIG_WAKEUP              BIT(0)

 #define SUN6I_LOSC_OUT_GATING                  0x0060
-#define SUN6I_LOSC_OUT_GATING_EN               BIT(0)
+#define SUN6I_LOSC_OUT_GATING_EN               0

You need to pass bit_idx that is 0 and not BIT(0)

Michael


> Maxime
>
> --
> Maxime Ripard, Bootlin (formerly Free Electrons)
> Embedded Linux and Kernel engineering
> https://bootlin.com



-- 
| Michael Nazzareno Trimarchi                     Amarula Solutions BV |
| COO  -  Founder                                      Cruquiuskade 47 |
| +31(0)851119172                                 Amsterdam 1018 AM NL |
|                  [`as] http://www.amarulasolutions.com               |

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* Allwinner A64: Issue on external rtc clock to wifi chip
@ 2018-05-28  7:08                 ` Michael Nazzareno Trimarchi
  0 siblings, 0 replies; 27+ messages in thread
From: Michael Nazzareno Trimarchi @ 2018-05-28  7:08 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Maxime

On Mon, May 14, 2018 at 1:17 PM, Maxime Ripard
<maxime.ripard@bootlin.com> wrote:
> On Mon, May 14, 2018 at 03:12:49PM +0530, Jagan Teki wrote:
>> On Mon, May 14, 2018 at 2:36 PM, Maxime Ripard
>> <maxime.ripard@bootlin.com> wrote:
>> > On Mon, May 14, 2018 at 02:34:22PM +0530, Jagan Teki wrote:
>> >> On Mon, May 14, 2018 at 1:57 PM, Maxime Ripard
>> >> <maxime.ripard@bootlin.com> wrote:
>> >> > On Mon, May 14, 2018 at 01:34:56PM +0530, Jagan Teki wrote:
>> >> >> On Mon, May 14, 2018 at 1:27 PM, Maxime Ripard
>> >> >> <maxime.ripard@bootlin.com> wrote:
>> >> >> > Hi,
>> >> >> >
>> >> >> > On Mon, May 14, 2018 at 12:37:49PM +0530, Jagan Teki wrote:
>> >> >> >> Hi Maxime and All,
>> >> >> >>
>> >> >> >> We are trying to bring-up AP6330 Wifi chip for A64 board. We noticed
>> >> >> >> to have an external rtc clock has driven from wifi chip.
>> >> >> >>
>> >> >> >> So the devicetree is configured according to this as below.
>> >> >> >>
>> >> >> >> / {
>> >> >> >>         wifi_pwrseq: wifi-pwrseq {
>> >> >> >>                 compatible = "mmc-pwrseq-simple";
>> >> >> >>                 clocks = <&rtc 1>;
>> >> >> >>                 clock-names = "ext_clock";
>> >> >> >>                 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
>> >> >> >>                 post-power-on-delay-ms = <400>;
>> >> >> >>         };
>> >> >> >> };
>> >> >> >>
>> >> >> >> &rtc {
>> >> >> >>         clock-output-names = "rtc-osc32k", "rtc-osc32k-out";
>> >> >> >>         clocks = <&osc32k>;
>> >> >> >>         #clock-cells = <1>;
>> >> >> >> };
>> >> >> >>
>> >> >> >> &mmc1 {
>> >> >> >>         pinctrl-names = "default";
>> >> >> >>         pinctrl-0 = <&mmc1_pins>;
>> >> >> >>         vmmc-supply = <&reg_dcdc1>;
>> >> >> >>         vqmmc-supply = <&reg_eldo1>;
>> >> >> >>         mmc-pwrseq = <&wifi_pwrseq>;
>> >> >> >>         bus-width = <4>;
>> >> >> >>         non-removable;
>> >> >> >>         status = "okay";
>> >> >> >>
>> >> >> >>         brcmf: wifi at 1 {
>> >> >> >>                 reg = <1>;
>> >> >> >>                 compatible = "brcm,bcm4329-fmac";
>> >> >> >>                 interrupt-parent = <&r_pio>;
>> >> >> >>                 interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>;  /* WL-WAKE-AP: PL3 */
>> >> >> >>                 interrupt-names = "host-wake";
>> >> >> >>         };
>> >> >> >> };
>> >> >> >>
>> >> >> >> And observed rtc-osc32k-out clock is never enabled[1] and the value of
>> >> >> >> LOSC_OUT_GATING is 0x0 which eventually not enabling
>> >> >> >> LOSC_OUT_GATING_EN
>> >> >> >>
>> >> >> >> Pls. let us know if we miss anything here?
>> >> >> >>
>> >> >> >> [1] https://paste.ubuntu.com/p/X2By4q8kD2/
>> >> >> >
>> >> >> > Could you paste your config and the logs from a boot to?
>> >> >>
>> >> >> .config
>> >> >> https://paste.ubuntu.com/p/w9w2KB7RFc/
>> >> >>
>> >> >> dmesg
>> >> >> https://paste.ubuntu.com/p/mrZGk5bWRR/
>> >> >
>> >> > This is kind of weird. Have you tested with a 4.17 kernel? We have
>> >> > runtime_pm changes lined up in next, so that might be a regression
>> >> > there, even though we tested it with Quentin at some point.
>> >>
>> >> This is 4.17-rc4 do you want to try it on 4.16 ?
>> >
>> > No, this is next-20180503. Please try with 4.17-rc4
>>
>> Couldn't find any different in behaviour [2]
>>
>> [2] https://paste.ubuntu.com/p/m3PGBwrv6W/
>
> It's hard to tell without the board, but have you looked at the return
> value of devm_clk_get in the pwrseq code?
>
> Enabling the clk ftrace events would also help.
>

The driver has one bug.

diff --git a/drivers/rtc/rtc-sun6i.c b/drivers/rtc/rtc-sun6i.c
index 2e6fb27..a66f40c 100644
--- a/drivers/rtc/rtc-sun6i.c
+++ b/drivers/rtc/rtc-sun6i.c
@@ -74,7 +74,7 @@
 #define SUN6I_ALARM_CONFIG_WAKEUP              BIT(0)

 #define SUN6I_LOSC_OUT_GATING                  0x0060
-#define SUN6I_LOSC_OUT_GATING_EN               BIT(0)
+#define SUN6I_LOSC_OUT_GATING_EN               0

You need to pass bit_idx that is 0 and not BIT(0)

Michael


> Maxime
>
> --
> Maxime Ripard, Bootlin (formerly Free Electrons)
> Embedded Linux and Kernel engineering
> https://bootlin.com



-- 
| Michael Nazzareno Trimarchi                     Amarula Solutions BV |
| COO  -  Founder                                      Cruquiuskade 47 |
| +31(0)851119172                                 Amsterdam 1018 AM NL |
|                  [`as] http://www.amarulasolutions.com               |

^ permalink raw reply related	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2018-05-28  7:08 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-14  7:07 Allwinner A64: Issue on external rtc clock to wifi chip Jagan Teki
2018-05-14  7:07 ` Jagan Teki
2018-05-14  7:07 ` Jagan Teki
2018-05-14  7:57 ` Maxime Ripard
2018-05-14  7:57   ` Maxime Ripard
2018-05-14  7:57   ` Maxime Ripard
2018-05-14  8:04   ` Jagan Teki
2018-05-14  8:04     ` Jagan Teki
2018-05-14  8:04     ` Jagan Teki
2018-05-14  8:27     ` Maxime Ripard
2018-05-14  8:27       ` Maxime Ripard
2018-05-14  8:27       ` Maxime Ripard
2018-05-14  9:04       ` Jagan Teki
2018-05-14  9:04         ` Jagan Teki
2018-05-14  9:04         ` Jagan Teki
2018-05-14  9:06         ` Maxime Ripard
2018-05-14  9:06           ` Maxime Ripard
2018-05-14  9:06           ` Maxime Ripard
2018-05-14  9:42           ` Jagan Teki
2018-05-14  9:42             ` Jagan Teki
2018-05-14  9:42             ` Jagan Teki
2018-05-14 11:17             ` Maxime Ripard
2018-05-14 11:17               ` Maxime Ripard
2018-05-14 11:17               ` Maxime Ripard
2018-05-28  7:08               ` Michael Nazzareno Trimarchi
2018-05-28  7:08                 ` Michael Nazzareno Trimarchi
2018-05-28  7:08                 ` Michael Nazzareno Trimarchi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.