[linux-sunxi] Re: [PATCH v6 05/17] rtc: sun6i: Add Allwinner H616 support

2021-05-22 Thread Andre Przywara
On Sat, 22 May 2021 09:29:26 +0200
Jernej Škrabec  wrote:

Hi,

> Dne sreda, 19. maj 2021 ob 12:41:40 CEST je Andre Przywara napisal(a):
> > The H616 RTC changes its day storage to the newly introduced linear day
> > scheme, so pair the new compatible string with this feature flag.
> > So far the clock parts seem to be the same as the H6, so combine the
> > compatible string with the existing H6 support bits.  
> 
> There is one more difference - H616 alarm value is now broken down to days, 
> hours, minutes and seconds.

That's a good point, that actually requires adjusting the driver in
this respect as well. And contrary to what the manual says ("Counter
Register will down count to zero"), and the previous RTCs do, those alarm
registers now need to be set to the actual wakeup time, not the time
left before wakeup.
Will fix the driver accordingly.

Thanks for the heads up!

Cheers,
Andre

> 
> Best regards,
> Jernej
> 
> > 
> > Signed-off-by: Andre Przywara 
> > ---
> >  drivers/rtc/rtc-sun6i.c | 4 
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/drivers/rtc/rtc-sun6i.c b/drivers/rtc/rtc-sun6i.c
> > index 0228e9dfd969..ec0cd0ee539a 100644
> > --- a/drivers/rtc/rtc-sun6i.c
> > +++ b/drivers/rtc/rtc-sun6i.c
> > @@ -382,6 +382,8 @@ static void __init sun50i_h6_rtc_clk_init(struct   
> device_node *node)
> >  }
> >  CLK_OF_DECLARE_DRIVER(sun50i_h6_rtc_clk, "allwinner,sun50i-h6-rtc",
> >   sun50i_h6_rtc_clk_init);
> > +CLK_OF_DECLARE_DRIVER(sun50i_h616_rtc_clk, "allwinner,sun50i-h616-rtc",
> > + sun50i_h6_rtc_clk_init);
> >  
> >  /*
> >   * The R40 user manual is self-conflicting on whether the prescaler is
> > @@ -773,6 +775,8 @@ static const struct of_device_id sun6i_rtc_dt_ids[] = {
> > { .compatible = "allwinner,sun8i-v3-rtc" },
> > { .compatible = "allwinner,sun50i-h5-rtc" },
> > { .compatible = "allwinner,sun50i-h6-rtc" },
> > +   { .compatible = "allwinner,sun50i-h616-rtc",
> > +   .data = (void *)RTC_LINEAR_DAY },
> > { /* sentinel */ },
> >  };
> >  MODULE_DEVICE_TABLE(of, sun6i_rtc_dt_ids);
> > -- 
> > 2.17.5
> > 
> >   
> 
> 

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20210523010643.7fdfd419%40slackpad.fritz.box.


[linux-sunxi] Re: [PATCH v6 01/17] dt-bindings: mfd: axp20x: Add AXP305 compatible (plus optional IRQ)

2021-05-22 Thread Andre Przywara
On Sat, 22 May 2021 09:46:23 -0500
Samuel Holland  wrote:

> On 5/19/21 5:41 AM, Andre Przywara wrote:
> > The AXP305 PMIC used in AXP805 seems to be fully compatible to the  
>   ^^
> Typo? Do you mean "used with the H616 SoC"?

Ouch, yes. And even more embarrassingly Chen-Yu pointed that out already
in the previous version. Same for the compatible string.

Thanks for having a look!

Cheers,
Andre

> 
> > AXP805 PMIC, so add the proper chain of compatible strings.
> > 
> > Also at least on one board (Orangepi Zero2) there is no interrupt line
> > connected to the CPU, so make the "interrupts" property optional.
> > 
> > Signed-off-by: Andre Przywara 
> > ---
> >  Documentation/devicetree/bindings/mfd/axp20x.txt | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/mfd/axp20x.txt 
> > b/Documentation/devicetree/bindings/mfd/axp20x.txt
> > index 4991a6415796..4fd748101e3c 100644
> > --- a/Documentation/devicetree/bindings/mfd/axp20x.txt
> > +++ b/Documentation/devicetree/bindings/mfd/axp20x.txt
> > @@ -26,10 +26,10 @@ Required properties:
> >  * "x-powers,axp803"
> >  * "x-powers,axp806"
> >  * "x-powers,axp805", "x-powers,axp806"
> > +* "x-powers,axp803", "x-powers,axp805", "x-powers,axp806"  
>^^
> This should be x-powers,axp305.
> 
> Regards,
> Samuel
> 
> >  * "x-powers,axp809"
> >  * "x-powers,axp813"
> >  - reg: The I2C slave address or RSB hardware address for the AXP chip
> > -- interrupts: SoC NMI / GPIO interrupt connected to the PMIC's IRQ pin
> >  - interrupt-controller: The PMIC has its own internal IRQs
> >  - #interrupt-cells: Should be set to 1
> >  
> > @@ -43,6 +43,7 @@ more information:
> > AXP20x/LDO3: software-based implementation
> >  
> >  Optional properties:
> > +- interrupts: SoC NMI / GPIO interrupt connected to the PMIC's IRQ pin
> >  - x-powers,dcdc-freq: defines the work frequency of DC-DC in KHz
> >   AXP152/20X: range:  750-1875, Default: 1.5 MHz
> >   AXP22X/8XX: range: 1800-4050, Default: 3   MHz
> >   
> 
> 

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20210523010124.2fb56fa5%40slackpad.fritz.box.


Re: [linux-sunxi] alternate irc network -> OFTC

2021-05-22 Thread Luc Verhaegen
On Fri, May 21, 2021 at 10:01:12PM +0200, Luc Verhaegen wrote:
> Hi, annoying email that i wish i never had to send...
> 
> To ensure continuity, #linux-sunxi on OFTC was registered, and the 
> existing (active) linux-sunxi founders and ops are added to chanserv 
> already (2 left to go, hope they read irc/email soon). This should 
> hopefully provide the stability that we have enjoyed for almost 9 
> years... Once the founders have talked through some more things, some 
> usual suspects will be added as ops, as we might need them now that we 
> no longer have the stable home that we used to have.

All existing and active founders/operators (mnemoc, turl, plaes, rellla, 
libv) were moved. And two new ones (wens, apritzel) were added.

Whitelogger has now also joined: 
https://oftc.irclog.whitequark.org/linux-sunxi

Luc Verhaegen.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20210522194337.GE20601%40skynet.be.


[linux-sunxi] Re: [PATCH v6 01/17] dt-bindings: mfd: axp20x: Add AXP305 compatible (plus optional IRQ)

2021-05-22 Thread Samuel Holland
On 5/19/21 5:41 AM, Andre Przywara wrote:
> The AXP305 PMIC used in AXP805 seems to be fully compatible to the
  ^^
Typo? Do you mean "used with the H616 SoC"?

> AXP805 PMIC, so add the proper chain of compatible strings.
> 
> Also at least on one board (Orangepi Zero2) there is no interrupt line
> connected to the CPU, so make the "interrupts" property optional.
> 
> Signed-off-by: Andre Przywara 
> ---
>  Documentation/devicetree/bindings/mfd/axp20x.txt | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/mfd/axp20x.txt 
> b/Documentation/devicetree/bindings/mfd/axp20x.txt
> index 4991a6415796..4fd748101e3c 100644
> --- a/Documentation/devicetree/bindings/mfd/axp20x.txt
> +++ b/Documentation/devicetree/bindings/mfd/axp20x.txt
> @@ -26,10 +26,10 @@ Required properties:
>  * "x-powers,axp803"
>  * "x-powers,axp806"
>  * "x-powers,axp805", "x-powers,axp806"
> +* "x-powers,axp803", "x-powers,axp805", "x-powers,axp806"
   ^^
This should be x-powers,axp305.

Regards,
Samuel

>  * "x-powers,axp809"
>  * "x-powers,axp813"
>  - reg: The I2C slave address or RSB hardware address for the AXP chip
> -- interrupts: SoC NMI / GPIO interrupt connected to the PMIC's IRQ pin
>  - interrupt-controller: The PMIC has its own internal IRQs
>  - #interrupt-cells: Should be set to 1
>  
> @@ -43,6 +43,7 @@ more information:
>   AXP20x/LDO3: software-based implementation
>  
>  Optional properties:
> +- interrupts: SoC NMI / GPIO interrupt connected to the PMIC's IRQ pin
>  - x-powers,dcdc-freq: defines the work frequency of DC-DC in KHz
> AXP152/20X: range:  750-1875, Default: 1.5 MHz
> AXP22X/8XX: range: 1800-4050, Default: 3   MHz
> 

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/7ebfaef7-5cf2-e60c-99ef-4275c873e72d%40sholland.org.


[linux-sunxi] Re: [PATCH v6 17/17] arm64: dts: allwinner: h616: Add X96 Mate TV box support

2021-05-22 Thread Jernej Škrabec
Hi Andre!

Dne sreda, 19. maj 2021 ob 12:41:52 CEST je Andre Przywara napisal(a):
> The X96 Mate is an Allwinner H616 based TV box, featuring:
>   - Four ARM Cortex-A53 cores, Mali-G31 MP2 GPU
>   - 2GiB/4GiB RAM (fully usable!)
>   - 16/32/64GiB eMMC
>   - 100Mbps Ethernet (via embedded AC200 EPHY, not yet supported)
>   - Unsupported Allwinner WiFi chip
>   - 2 x USB 2.0 host ports
>   - HDMI port
>   - IR receiver
>   - 5V/2A DC power supply via barrel plug
> 
> For more information see: https://linux-sunxi.org/X96_Mate
> 
> Add a basic devicetree for it, with SD card, eMMC and USB working, as
> well as serial and the essential peripherals, like the AXP PMIC.
> 
> This DT is somewhat minimal, and should work on many other similar TV
> boxes with the Allwinner H616 chip.
> 
> Signed-off-by: Andre Przywara 
> ---
>  arch/arm64/boot/dts/allwinner/Makefile|   1 +
>  .../dts/allwinner/sun50i-h616-x96-mate.dts| 201 ++
>  2 files changed, 202 insertions(+)
>  create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h616-x96-mate.dts
> 
> diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/
allwinner/Makefile
> index 9ba4b5d92657..370d24ebaacf 100644
> --- a/arch/arm64/boot/dts/allwinner/Makefile
> +++ b/arch/arm64/boot/dts/allwinner/Makefile
> @@ -37,3 +37,4 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-pine-h64.dtb
>  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-pine-h64-model-b.dtb
>  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-tanix-tx6.dtb
>  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-orangepi-zero2.dtb
> +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-x96-mate.dtb
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616-x96-mate.dts b/arch/
arm64/boot/dts/allwinner/sun50i-h616-x96-mate.dts
> new file mode 100644
> index ..b960bb310289
> --- /dev/null
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h616-x96-mate.dts
> @@ -0,0 +1,201 @@
> +// SPDX-License-Identifier: (GPL-2.0+ or MIT)
> +/*
> + * Copyright (C) 2021 Arm Ltd.
> + */
> +
> +/dts-v1/;
> +
> +#include "sun50i-h616.dtsi"
> +
> +#include 
> +#include 
> +
> +/ {
> + model = "X96 Mate";
> + compatible = "hechuang,x96-mate", "allwinner,sun50i-h616";

Please document compatible.

Best regards,
Jernej

> +
> + aliases {
> + serial0 = 
> + };
> +
> + chosen {
> + stdout-path = "serial0:115200n8";
> + };
> +
> + reg_vcc5v: vcc5v {
> + /* board wide 5V supply directly from the DC input */
> + compatible = "regulator-fixed";
> + regulator-name = "vcc-5v";
> + regulator-min-microvolt = <500>;
> + regulator-max-microvolt = <500>;
> + regulator-always-on;
> + };
> +};
> +
> + {
> + status = "okay";
> +};
> +
> + {
> + status = "okay";
> +};
> +
> + {
> + status = "okay";
> +};
> +
> + {
> + vmmc-supply = <_dcdce>;
> + cd-gpios = < 5 6 GPIO_ACTIVE_LOW>;  /* PF6 */
> + bus-width = <4>;
> + status = "okay";
> +};
> +
> + {
> + vmmc-supply = <_dcdce>;
> + vqmmc-supply = <_bldo1>;
> + bus-width = <8>;
> + non-removable;
> + cap-mmc-hw-reset;
> + mmc-hs200-1_8v;
> + status = "okay";
> +};
> +
> + {
> + status = "okay";
> +};
> +
> + {
> + status = "okay";
> +};
> +
> +_rsb {
> + status = "okay";
> +
> + axp305: pmic@745 {
> + compatible = "x-powers,axp305", "x-powers,axp805",
> +  "x-powers,axp806";
> + interrupt-controller;
> + #interrupt-cells = <1>;
> + reg = <0x745>;
> +
> + x-powers,self-working-mode;
> + vina-supply = <_vcc5v>;
> + vinb-supply = <_vcc5v>;
> + vinc-supply = <_vcc5v>;
> + vind-supply = <_vcc5v>;
> + vine-supply = <_vcc5v>;
> + aldoin-supply = <_vcc5v>;
> + bldoin-supply = <_vcc5v>;
> + cldoin-supply = <_vcc5v>;
> +
> + regulators {
> + reg_aldo1: aldo1 {
> + regulator-always-on;
> + regulator-min-microvolt = 
<330>;
> + regulator-max-microvolt = 
<330>;
> + regulator-name = "vcc-sys";
> + };
> +
> + /* Enabled by the Android BSP */
> + reg_aldo2: aldo2 {
> + regulator-min-microvolt = 
<330>;
> + regulator-max-microvolt = 
<330>;
> + regulator-name = "vcc3v3-ext";
> + status = "disabled";
> + };
> +
> + /* Enabled by the Android BSP */
> + reg_aldo3: aldo3 {
> + regulator-min-microvolt = 
<330>;
> + regulator-max-microvolt = 
<330>;
> + regulator-name = 

[linux-sunxi] Re: [PATCH v6 05/17] rtc: sun6i: Add Allwinner H616 support

2021-05-22 Thread Jernej Škrabec
Hi Andre!

Dne sreda, 19. maj 2021 ob 12:41:40 CEST je Andre Przywara napisal(a):
> The H616 RTC changes its day storage to the newly introduced linear day
> scheme, so pair the new compatible string with this feature flag.
> So far the clock parts seem to be the same as the H6, so combine the
> compatible string with the existing H6 support bits.

There is one more difference - H616 alarm value is now broken down to days, 
hours, minutes and seconds.

Best regards,
Jernej

> 
> Signed-off-by: Andre Przywara 
> ---
>  drivers/rtc/rtc-sun6i.c | 4 
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/rtc/rtc-sun6i.c b/drivers/rtc/rtc-sun6i.c
> index 0228e9dfd969..ec0cd0ee539a 100644
> --- a/drivers/rtc/rtc-sun6i.c
> +++ b/drivers/rtc/rtc-sun6i.c
> @@ -382,6 +382,8 @@ static void __init sun50i_h6_rtc_clk_init(struct 
device_node *node)
>  }
>  CLK_OF_DECLARE_DRIVER(sun50i_h6_rtc_clk, "allwinner,sun50i-h6-rtc",
> sun50i_h6_rtc_clk_init);
> +CLK_OF_DECLARE_DRIVER(sun50i_h616_rtc_clk, "allwinner,sun50i-h616-rtc",
> +   sun50i_h6_rtc_clk_init);
>  
>  /*
>   * The R40 user manual is self-conflicting on whether the prescaler is
> @@ -773,6 +775,8 @@ static const struct of_device_id sun6i_rtc_dt_ids[] = {
>   { .compatible = "allwinner,sun8i-v3-rtc" },
>   { .compatible = "allwinner,sun50i-h5-rtc" },
>   { .compatible = "allwinner,sun50i-h6-rtc" },
> + { .compatible = "allwinner,sun50i-h616-rtc",
> + .data = (void *)RTC_LINEAR_DAY },
>   { /* sentinel */ },
>  };
>  MODULE_DEVICE_TABLE(of, sun6i_rtc_dt_ids);
> -- 
> 2.17.5
> 
> 


-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/10265315.EKgO2cQaHd%40kista.


[linux-sunxi] Re: [PATCH v6 04/17] rtc: sun6i: Add support for linear day storage

2021-05-22 Thread Jernej Škrabec
Hi Andre!

Dne sreda, 19. maj 2021 ob 12:41:39 CEST je Andre Przywara napisal(a):
> Newer versions of the Allwinner RTC, as for instance found in the H616
> SoC, no longer store a broken-down day/month/year representation in the
> RTC_DAY_REG, but just a linear day number.
> The user manual does not give any indication about the expected epoch
> time of this day count, but the BSP kernel uses the UNIX epoch, which
> allows easy support due to existing conversion functions in the kernel.
> 
> Allow tagging a compatible string with a flag, and use that to mark
> those new RTCs. Then convert between a UNIX day number (converted into
> seconds) and the broken-down day representation using mktime64() and
> time64_to_tm() in the set_time/get_time functions.
> 
> That enables support for the RTC in those new chips.
> 
> Reviewed-by: Andre Przywara 

Change ^ to Signed-of-by. After that, you can add:
Reviewed-by: Jernej Skrabec 

Best regards,
Jernej


-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/5920087.Glgd6ahW17%40kista.