[linux-sunxi] Booting from NAND with mainline components on A10

2016-10-30 Thread mr . nuke . me
After having a cubieboard for that many years, I decided to pull it out of the 
closet, and try to boot it from NAND. After following [1], I was able to get 
linux to give me some /dev/mtd* with linux-4.9-rc1.

After applying same devicetree hacks to u-boot, I was able to get u-boot to 
see my NAND chips. Deep, in the wiki, I found this [2] link on how to put 
everything to NAND. So great, I follow that, and of course, the SOC doesn't 
boot.

After that, I find [3] that the BROM on A10 assumes 1 KiB blocs, but my NAND 
flash uses 8 KiB blocks. So I hacked up a script [4] to write the SPL in 1 KiB 
data blocks.

As you may already have noticed a pattern here, this failed. At this point, 
I'm out of ideas. I really want to put u-boot in NAND. Any hints?

Alex

[1] https://linux-sunxi.org/Mainline_NAND_Howto
[2] http://lists.denx.de/pipermail/u-boot/2015-May/214959.html
[3] https://linux-sunxi.org/NAND#More_information_on_BROM_NAND
[4]
#! /bin/bash

SPLFILE=sunxi-spl.bin
MTDDEV=/dev/mtd0
NANDBLOCKSIZE=8192
BROMBLOCKSIZE=1024

for block in `seq 0 23`;
do
splstart=$(expr $block \* $BROMBLOCKSIZE)
mtdstart=$(expr $block \* $NANDBLOCKSIZE)
echo $splstart $mtdstart
dd if=$SPLFILE of=tmp bs=$BROMBLOCKSIZE count=1 skip=$block
nandwrite -p --input-size=$BROMBLOCKSIZE --start=$mtdstart $MTDDEV tmp
done

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: [PATCH v5 1/7] drm: sunxi: Add a basic DRM driver for Allwinner DE2

2016-10-30 Thread Rob Herring
On Fri, Oct 21, 2016 at 09:26:18AM +0200, Jean-Francois Moine wrote:
> Allwinner's recent SoCs, as A64, A83T and H3, contain a new display
> engine, DE2.
> This patch adds a DRM video driver for this device.
> 
> Signed-off-by: Jean-Francois Moine 
> ---
>  .../bindings/display/sunxi/sunxi-de2.txt   |  83 +++
>  drivers/gpu/drm/Kconfig|   2 +
>  drivers/gpu/drm/Makefile   |   1 +
>  drivers/gpu/drm/sunxi/Kconfig  |  21 +
>  drivers/gpu/drm/sunxi/Makefile |   7 +
>  drivers/gpu/drm/sunxi/de2_crtc.c   | 475 +
>  drivers/gpu/drm/sunxi/de2_crtc.h   |  63 +++
>  drivers/gpu/drm/sunxi/de2_de.c | 591 
> +
>  drivers/gpu/drm/sunxi/de2_drm.h|  47 ++
>  drivers/gpu/drm/sunxi/de2_drv.c| 378 +
>  drivers/gpu/drm/sunxi/de2_plane.c  | 119 +
>  11 files changed, 1787 insertions(+)
>  create mode 100644 
> Documentation/devicetree/bindings/display/sunxi/sunxi-de2.txt
>  create mode 100644 drivers/gpu/drm/sunxi/Kconfig
>  create mode 100644 drivers/gpu/drm/sunxi/Makefile
>  create mode 100644 drivers/gpu/drm/sunxi/de2_crtc.c
>  create mode 100644 drivers/gpu/drm/sunxi/de2_crtc.h
>  create mode 100644 drivers/gpu/drm/sunxi/de2_de.c
>  create mode 100644 drivers/gpu/drm/sunxi/de2_drm.h
>  create mode 100644 drivers/gpu/drm/sunxi/de2_drv.c
>  create mode 100644 drivers/gpu/drm/sunxi/de2_plane.c
> 
> diff --git a/Documentation/devicetree/bindings/display/sunxi/sunxi-de2.txt 
> b/Documentation/devicetree/bindings/display/sunxi/sunxi-de2.txt
> new file mode 100644
> index 000..f9cd67a
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/sunxi/sunxi-de2.txt

> + hdmi: hdmi@01ee {
> + ...
> + #address-cells = <1>;
> + #size-cells = <0>;
> + port {
> + type = "video";

This is proposed, but not an accepted property. Please drop.

> + hdmi_ep: endpoint {
> + remote-endpoint = <_ep>;
> + };
> + };
> + };

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: [PATCH v5 3/7] drm: sunxi: add DE2 HDMI support

2016-10-30 Thread Rob Herring
On Fri, Oct 21, 2016 at 10:08:06AM +0200, Jean-Francois Moine wrote:
> This patch adds a HDMI driver to the DE2 based Allwinner's SoCs
> as A83T and H3.
> Audio and video are supported.
> 
> Signed-off-by: Jean-Francois Moine 
> ---
>  .../devicetree/bindings/display/sunxi/hdmi.txt |  52 ++
>  drivers/gpu/drm/sunxi/Kconfig  |   8 +
>  drivers/gpu/drm/sunxi/Makefile |   2 +
>  drivers/gpu/drm/sunxi/de2_hdmi.c   | 396 +
>  drivers/gpu/drm/sunxi/de2_hdmi.h   |  40 +
>  drivers/gpu/drm/sunxi/de2_hdmi_io.c| 927 
> +
>  drivers/gpu/drm/sunxi/de2_hdmi_io.h|  25 +
>  7 files changed, 1450 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/display/sunxi/hdmi.txt
>  create mode 100644 drivers/gpu/drm/sunxi/de2_hdmi.c
>  create mode 100644 drivers/gpu/drm/sunxi/de2_hdmi.h
>  create mode 100644 drivers/gpu/drm/sunxi/de2_hdmi_io.c
>  create mode 100644 drivers/gpu/drm/sunxi/de2_hdmi_io.h
> 
> diff --git a/Documentation/devicetree/bindings/display/sunxi/hdmi.txt 
> b/Documentation/devicetree/bindings/display/sunxi/hdmi.txt
> new file mode 100644
> index 000..0558c07
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/sunxi/hdmi.txt
> @@ -0,0 +1,52 @@
> +Allwinner HDMI Transmitter
> +==
> +
> +The Allwinner HDMI transmitters are included in the SoCs.
> +They support audio and video.
> +
> +Required properties:
> + - #address-cells : should be <1>
> + - #size-cells : should be <0>
> + - compatible : should be
> + "allwinner,sun8i-a83t-hdmi" or
> + "allwinner,sun8i-h3-hdmi"
> + - clocks : phandles to the HDMI clocks as described in
> + Documentation/devicetree/bindings/clock/clock-bindings.txt
> + - clock-names : must be
> + "gate" : bus gate
> + "clock" : streaming clock
> + "ddc-clock" : DDC clock
> + - resets : One or two phandles to the HDMI resets
> + - reset-names : must be
> + "hdmi0" and "hdmi1"
> +
> +Required nodes:
> + - port: Audio and video input port nodes with endpoint definitions
> + as defined in Documentation/devicetree/bindings/graph.txt.

Please define which port number is audio and which is video.

Rob

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: [PATCH v5 1/7] drm: sunxi: Add a basic DRM driver for Allwinner DE2

2016-10-30 Thread Rob Herring
On Tue, Oct 25, 2016 at 04:14:41PM +0200, Jean-Francois Moine wrote:
> On Mon, 24 Oct 2016 16:04:19 +0200
> Maxime Ripard  wrote:
> 
> > Hi,
> 
> Hi Maxime,
> 
> > On Fri, Oct 21, 2016 at 09:26:18AM +0200, Jean-Francois Moine wrote:
> > > Allwinner's recent SoCs, as A64, A83T and H3, contain a new display
> > > engine, DE2.
> > > This patch adds a DRM video driver for this device.
> > > 
> > > Signed-off-by: Jean-Francois Moine 
> > 
> > Output from checkpatch:
> > total: 0 errors, 20 warnings, 83 checks, 1799 lines checked
> > 
> > > ---
> > >  .../bindings/display/sunxi/sunxi-de2.txt   |  83 +++
> > >  drivers/gpu/drm/Kconfig|   2 +
> > >  drivers/gpu/drm/Makefile   |   1 +
> > >  drivers/gpu/drm/sunxi/Kconfig  |  21 +
> > >  drivers/gpu/drm/sunxi/Makefile |   7 +
> > >  drivers/gpu/drm/sunxi/de2_crtc.c   | 475 
> > > +
> > >  drivers/gpu/drm/sunxi/de2_crtc.h   |  63 +++
> > >  drivers/gpu/drm/sunxi/de2_de.c | 591 
> > > +
> > >  drivers/gpu/drm/sunxi/de2_drm.h|  47 ++
> > >  drivers/gpu/drm/sunxi/de2_drv.c| 378 +
> > >  drivers/gpu/drm/sunxi/de2_plane.c  | 119 +
> > >  11 files changed, 1787 insertions(+)
> > >  create mode 100644 
> > > Documentation/devicetree/bindings/display/sunxi/sunxi-de2.txt
> > >  create mode 100644 drivers/gpu/drm/sunxi/Kconfig
> > >  create mode 100644 drivers/gpu/drm/sunxi/Makefile
> > >  create mode 100644 drivers/gpu/drm/sunxi/de2_crtc.c
> > >  create mode 100644 drivers/gpu/drm/sunxi/de2_crtc.h
> > >  create mode 100644 drivers/gpu/drm/sunxi/de2_de.c
> > >  create mode 100644 drivers/gpu/drm/sunxi/de2_drm.h
> > >  create mode 100644 drivers/gpu/drm/sunxi/de2_drv.c
> > >  create mode 100644 drivers/gpu/drm/sunxi/de2_plane.c
> > > 
> > > diff --git 
> > > a/Documentation/devicetree/bindings/display/sunxi/sunxi-de2.txt 
> > > b/Documentation/devicetree/bindings/display/sunxi/sunxi-de2.txt
> > > new file mode 100644
> > > index 000..f9cd67a
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/display/sunxi/sunxi-de2.txt

[...]

> > > +
> > > +- resets: phandle to the reset of the device
> > > +
> > > +- ports: phandle's to the LCD ports
> > 
> > Please use the OF graph.
> 
> These ports are references to the graph of nodes. See
>   http://www.kernelhub.org/?msg=911825=2

I think what Maxime means is describe the DE to LCD connection with OF 
graph, not just a phandle.

Rob

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: [U-Boot, 1/2] drivers: USB: OHCI: allow compilation for 64-bit targets

2016-10-30 Thread Marek Vasut
On 10/30/2016 10:51 AM, André Przywara wrote:
> On 29/10/16 18:42, Marek Vasut wrote:
>> On 10/29/2016 02:50 PM, Hans de Goede wrote:
>>> Hi,
>>>
>>> On 21-10-16 03:24, Andre Przywara wrote:
 OHCI has a known limitation of allowing only 32-bit DMA buffer
 addresses, so we have a lot of u32 variables around, which are assigned
 to pointers and vice versa. This obviously creates issues with 64-bit
 systems, so the compiler complains here and there.
 To allow compilation for 64-bit boards which use only memory below 4GB
 anyway (and to avoid more invasive fixes), adjust some casts and types
 and assume that the EDs and TDs are all located in the lower 4GB.
 This fixes compilation of the OHCI driver for the Pine64.

 Signed-off-by: Andre Przywara 
>>>
>>> Patch looks good to me:
>>>
>>> Reviewed-by: Hans de Goede 
>>
>> Applied, thanks.
>>
>> Andre, it would be nice if you CC'd me on the original submission.
> 
> Yeah, sorry about that. I think I had you in To: on my --dry-run test,
> but somehow managed to drop you after fixing "just one more thing".
> 
> Thanks for applying this!

np, PR is out too.

-- 
Best regards,
Marek Vasut

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: [U-Boot, 1/2] drivers: USB: OHCI: allow compilation for 64-bit targets

2016-10-30 Thread André Przywara
On 29/10/16 18:42, Marek Vasut wrote:
> On 10/29/2016 02:50 PM, Hans de Goede wrote:
>> Hi,
>>
>> On 21-10-16 03:24, Andre Przywara wrote:
>>> OHCI has a known limitation of allowing only 32-bit DMA buffer
>>> addresses, so we have a lot of u32 variables around, which are assigned
>>> to pointers and vice versa. This obviously creates issues with 64-bit
>>> systems, so the compiler complains here and there.
>>> To allow compilation for 64-bit boards which use only memory below 4GB
>>> anyway (and to avoid more invasive fixes), adjust some casts and types
>>> and assume that the EDs and TDs are all located in the lower 4GB.
>>> This fixes compilation of the OHCI driver for the Pine64.
>>>
>>> Signed-off-by: Andre Przywara 
>>
>> Patch looks good to me:
>>
>> Reviewed-by: Hans de Goede 
> 
> Applied, thanks.
> 
> Andre, it would be nice if you CC'd me on the original submission.

Yeah, sorry about that. I think I had you in To: on my --dry-run test,
but somehow managed to drop you after fixing "just one more thing".

Thanks for applying this!

Cheers,
Andre.

> 
>> Regards,
>>
>> Hans
>>
>> p.s.
>>
>> About the ohci_writel macro changes also giving the macro parameters
>> more sensible names, I believe it is fine to do this while at it and
>> that this does not need to be split out.
> 
> Indeed, I am fine with it as well.
> 

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] Re: [U-Boot,2/2] sunxi: A64: enable USB support

2016-10-30 Thread Hans de Goede

Hi,

On 29-10-16 14:52, Hans de Goede wrote:

Hi,

On 21-10-16 03:24, Andre Przywara wrote:

From: Amit Singh Tomar 

Mostly by adding MACH_SUN50I to some existing #ifdefs enable support
for the the HCI0 USB host controller on the A64.
Fix up some minor 64-bit hiccups on the way.
Add the bare minimum DT bits to the A64 .dtsi and enable the controllers
and the PHY on the Pine64.
This is limited to the first USB controller at the moment, which is
connected to the lower USB socket on the Pine64 board.
[Andre: remove unneeded defines, enable OHCI, add commit message]

Signed-off-by: Amit Singh Tomar 
Signed-off-by: Andre Przywara 


Other then CONFIG_USB_MAX_CONTROLLER_COUNT no longer being necessary
(it should be dropped from include/configs/sun50i.h) this patch looks
good to me and is:

Reviewed-by: Hans de Goede 

Note I cannot merged it till Marek merges the first patch in
the series, which really needs to go through the u-boot-usb tree.


Marek just send out a pull-req with this patch in there so I've
added this patch to my tree and will include it in the pull-req I
will send out later today.

Regards,

Hans


---
 arch/arm/dts/sun50i-a64-pine64-common.dtsi  | 12 
 arch/arm/dts/sun50i-a64.dtsi| 29 +
 arch/arm/include/asm/arch-sunxi/cpu_sun4i.h |  2 +-
 arch/arm/mach-sunxi/usb_phy.c   |  5 +++--
 configs/pine64_plus_defconfig   |  1 +
 drivers/usb/host/ehci-sunxi.c   |  7 ---
 drivers/usb/host/ohci-sunxi.c   |  1 +
 include/configs/sun50i.h|  5 +
 8 files changed, 56 insertions(+), 6 deletions(-)

diff --git a/arch/arm/dts/sun50i-a64-pine64-common.dtsi 
b/arch/arm/dts/sun50i-a64-pine64-common.dtsi
index c0fde44..9ec81c6 100644
--- a/arch/arm/dts/sun50i-a64-pine64-common.dtsi
+++ b/arch/arm/dts/sun50i-a64-pine64-common.dtsi
@@ -79,3 +79,15 @@
 pinctrl-0 = <_pins>;
 status = "okay";
 };
+
+ {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+};
diff --git a/arch/arm/dts/sun50i-a64.dtsi b/arch/arm/dts/sun50i-a64.dtsi
index 7d0dc76..bef0d00 100644
--- a/arch/arm/dts/sun50i-a64.dtsi
+++ b/arch/arm/dts/sun50i-a64.dtsi
@@ -653,5 +653,34 @@
 #address-cells = <1>;
 #size-cells = <0>;
 };
+
+usbphy: phy@1c1b810 {
+compatible = "allwinner,sun50i-a64-usb-phy",
+ "allwinner,sun8i-a33-usb-phy";
+reg = <0x01c1b810 0x14>, <0x01c1b800 0x4>;
+reg-names = "phy_ctrl", "pmu1";
+status = "disabled";
+#phy-cells = <1>;
+};
+
+ehci1: usb@01c1b000 {
+compatible = "allwinner,sun50i-a64-ehci",
+ "generic-ehci";
+reg = <0x01c1b000 0x100>;
+interrupts = ;
+phys = < 1>;
+phy-names = "usb";
+status = "disabled";
+};
+
+ohci1: usb@01c1b400 {
+compatible = "allwinner,sun50i-a64-ohci",
+ "generic-ohci";
+reg = <0x01c1b400 0x100>;
+interrupts = ;
+phys = < 1>;
+phy-names = "usb";
+status = "enabled";
+};
 };
 };
diff --git a/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h 
b/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h
index 5f93830..7232f6d 100644
--- a/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h
+++ b/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h
@@ -56,7 +56,7 @@
 #define SUNXI_USB2_BASE0x01c1c000
 #endif
 #ifdef CONFIG_SUNXI_GEN_SUN6I
-#ifdef CONFIG_MACH_SUN8I_H3
+#if defined(CONFIG_MACH_SUN8I_H3) || defined(CONFIG_MACH_SUN50I)
 #define SUNXI_USBPHY_BASE0x01c19000
 #define SUNXI_USB0_BASE0x01c1a000
 #define SUNXI_USB1_BASE0x01c1b000
diff --git a/arch/arm/mach-sunxi/usb_phy.c b/arch/arm/mach-sunxi/usb_phy.c
index bd1bbee..278587b 100644
--- a/arch/arm/mach-sunxi/usb_phy.c
+++ b/arch/arm/mach-sunxi/usb_phy.c
@@ -146,12 +146,13 @@ __maybe_unused static void usb_phy_write(struct 
sunxi_usb_phy *phy, int addr,
 }
 }

-#if defined CONFIG_MACH_SUN8I_H3
+#if defined(CONFIG_MACH_SUN8I_H3) || defined(CONFIG_MACH_SUN50I)
 static void sunxi_usb_phy_config(struct sunxi_usb_phy *phy)
 {
+#if defined CONFIG_MACH_SUN8I_H3
 if (phy->id == 0)
 clrbits_le32(SUNXI_USBPHY_BASE + REG_PHY_UNK_H3, 0x01);
-
+#endif
 clrbits_le32(phy->base + REG_PMU_UNK_H3, 0x02);
 }
 #elif defined CONFIG_MACH_SUN8I_A83T
diff --git a/configs/pine64_plus_defconfig b/configs/pine64_plus_defconfig
index 6f82190..bd3e2e6 100644
--- a/configs/pine64_plus_defconfig
+++ b/configs/pine64_plus_defconfig
@@ -10,3 +10,4 @@ CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-pine64-plus"
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_SUN8I_EMAC=y
+CONFIG_USB_EHCI_HCD=y
diff --git a/drivers/usb/host/ehci-sunxi.c 

[linux-sunxi] Re: [U-Boot] [PATCH] arm: dts: Pine64: add Ethernet alias

2016-10-30 Thread André Przywara
On 30/10/16 08:48, Jagan Teki wrote:
> On Fri, Oct 28, 2016 at 11:21 PM, Jagan Teki  wrote:
>> On Thu, Oct 27, 2016 at 2:20 AM, André Przywara  
>> wrote:
>>> On 26/10/16 19:51, Jagan Teki wrote:
>>> Hi,
>>>
 On Fri, Oct 21, 2016 at 5:41 AM, Andre Przywara  
 wrote:
> The sun8i-emac driver works fine with the A64 Ethernet IP, but we are
> missing an alias entry to trigger the driver instantiation by U-Boot.
> Add the line to point U-Boot to the Ethernet DT node.
> This enables TFTP boot on the Pine64.
>
> Signed-off-by: Andre Przywara 
> ---
>  arch/arm/dts/sun50i-a64-pine64-common.dtsi | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm/dts/sun50i-a64-pine64-common.dtsi 
> b/arch/arm/dts/sun50i-a64-pine64-common.dtsi
> index d5a7249..c0fde44 100644
> --- a/arch/arm/dts/sun50i-a64-pine64-common.dtsi
> +++ b/arch/arm/dts/sun50i-a64-pine64-common.dtsi
> @@ -46,6 +46,7 @@
>
> aliases {
> serial0 = 
> +   ethernet0 = 

 Better to have this alias on sun50i-a64.dtsi since the node is defined 
 there?
>>>
>>> Mmh, I find examples for both ways (.dtsi vs. .dts) in the kernel. I
>>> need to learn what's the best practice here.
>>>
>>> But the U-Boot DTs need to get replaced anyway soon-ish, since the Linux
>>> DTs (which are WIP) have already diverged.
>>> So what about we keep this alias here next to the existing one for the
>>> 2016.11 release and possibly fix this later once we replace the DTs
>>> anyway with what gets merged into the kernel eventually?
>>
>> OK, but please stick with the current discussion and still I see a
>> good point to see alias on dtsi because the dts files which are using
>> this dtsi shouldn't separately define the alias.
>>
>> And also status on dtsi is showing "disabled" are you enabled it some
>> other patches? or missed?

We have the status = "okay" in sun50i-a64-pine64-plus.dts, which is the
only dts that is used these days.
The non-plus board version has a different PHY (100 MBit only) and a
quick test a while ago showed that this didn't work out of the box, so
we just don't enable it there. It seems like that not many people have
this version of the board and they would need to hack U-Boot to use it
anyway (because defconfig select -plus.dts).
This will be revisited when the SPL FIT support introduces board
detection and we actually choose the proper DT for each board.

Cheers,
Andre.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] Re: [PATCH 00/11] sunxi: Add full SPL support for sun9i (A80)

2016-10-30 Thread Hans de Goede

Hi,

On 30-10-16 06:30, Chen-Yu Tsai wrote:

On Sat, Oct 29, 2016 at 8:06 PM, Hans de Goede  wrote:

Hi,


On 28-10-16 19:30, Hans de Goede wrote:


Hi Chen-Yu,

On 28-10-16 12:21, Chen-Yu Tsai wrote:


Hi everyone,

This series adds full SPL with DRAM initialization for sun9i (A80).
The bulk of the work was done by the people at Theobroma Systems.
Their work can be found here:

https://git.theobroma-systems.com/armadillo-u-boot.git/

I picked the essential patches and cleaned them up a bit more,
and added commit messages if they were missing.

As the DRAM bits are essentially a code dump with some cleanups and
some bits disabled, expect many warnings. Checkpatch is still not
happy with it.

I've tested the series on both my A80 boards, which I've added
defconfigs for in the last 2 patches. My A80 Optimus does not
boot from micro SD, so I'm still FEL booting that one. But my
Cubieboard 4 is now standalone.

As usual, please have a look, test if possible.



Awesome, thanks for doing this and it was good to have
some face2face time at ELCE.

I've merged this into my personal sunxi-wip u-boot branch,
I've made 2 changes:

1) in : ¨sunxi: DRAM initialisation for sun9i" there are a
lot of #if 0 #endif blocks, most of these document some features
which we may want to enable in the future, but a few were just
dead weight IMHO, so I've pruned a few

2) in : "sunxi: Add support for A80 Optimus board", we already
have a configs/Merrii_A80_Optimus_defconfig, so I've made the patch
update that instead of adding a new defconfig

I have not tested this yet, I will do tomorrow, assuming it
works for me too I will include it in my next pull-req (*)



Ok, just finished testing, u-boot seems to work well. I do
seem to have one kernel issue (with the last 4.8 based
sunxi-next kernel, I still need to upgrade that) :

[1.137105] Division by zero in kernel.
[1.140988] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.8.0+ #475
[1.147089] Hardware name: Allwinner sun9i Family
[1.151830] [] (unwind_backtrace) from []
(show_stack+0x18/0x1c)
[1.159596] [] (show_stack) from []
(dump_stack+0x80/0x9c)
[1.166839] [] (dump_stack) from [] (Ldiv0+0x8/0x10)
[1.173558] [] (Ldiv0) from []
(sun4i_a10_get_mod0_factors+0x2c/0x8c)
[1.181758] [] (sun4i_a10_get_mod0_factors) from []
(clk_factors_determine_rate+0xb8/0xf8)
[1.191781] [] (clk_factors_determine_rate) from []
(clk_composite_determine_rate+0x58/0x1cc)
[1.202062] [] (clk_composite_determine_rate) from []
(clk_calc_new_rates+0xa0/0x240)
[1.211647] [] (clk_calc_new_rates) from []
(clk_core_set_rate_nolock+0x4c/0xbc)
[1.220798] [] (clk_core_set_rate_nolock) from []
(clk_set_rate+0x28/0x38)
[1.229432] [] (clk_set_rate) from []
(sunxi_ir_probe+0xfc/0x480)
[1.420454] [] (sunxi_ir_probe) from []
(platform_drv_pro
be+0x58/0xa4)

...

And it fails to find any mmc controllers, but that might be related to
the above oops (maybe it stops probing after that due to a stuck lock).


This is related to the regulators, specifically cold boot default
values for ldo_ios causing the regulators to fail to register. You
actually fixed this for the axp22x's before.

There's also the addressing issue for the axp806.

See the top of https://github.com/wens/linux/commits/sun9i-gmac-wifi
for the bunch of fixes I need to send.


Anyways the u-boot side looks good. One issue I see is that your
optimus has an emmc, where as mine has a nand. We may want to
gave 2 optimus defconfigs for this once we've nand support.


Hmm... This implies the need for 2 versions of dts files as well.
Any ideas on probing for nand/emmc during boot?


If we want to use a single devicetree and use something like quirks
or some such, I'm sure we can up with some way to find out whether
there is an emmc or nand connected during boot (in u-boot), but
this requires a mechanism like dt-quirks to first get merged
upstream. Anyways NAND support is still not here, lets just go
with eMMC support in u-boot + the dts and we can worry about NAND
support later (this will likely cause some kernel errors on optimus
boards with NAND, but I live with that).

Regards,

Hans

--
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.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: [PATCH 01/14] dma: sun6i-dma: Add burst case of 4

2016-10-30 Thread Jean-Francois Moine
On Sun, 30 Oct 2016 10:06:20 +0800
Chen-Yu Tsai  wrote:

> >> Yes, I know that the burst size is always a power of 2.
> >> The best way to check it would be to change the {src,dts}_maxburst to a
> >> bitmap of the possible bursts as 0x0d for 1,4 and 8 bytes. But this
> >> asks for a lot of changes...
> >
> > To be honest, I'm not really a big fan of those tree wide changes
> > without any way to maintain compatibility. It ends up in a single,
> > huge patch if we want to maintain bisectability that just isn't
> > reviewable.
> 
> Looking at the dmaengine API, I believe we got it wrong.
> 
> max_burst in dma_slave_config denotes the largest amount of data
> a single transfer should be, as described in dmaengine.h:
> 
>  * @src_maxburst: the maximum number of words (note: words, as in
>  * units of the src_addr_width member, not bytes) that can be sent
>  * in one burst to the device. Typically something like half the
>  * FIFO depth on I/O peripherals so you don't overflow it. This
>  * may or may not be applicable on memory sources.
>  * @dst_maxburst: same as src_maxburst but for destination target
>  * mutatis mutandis.
> 
> The DMA engine driver should be free to select whatever burst size
> that doesn't exceed this. So for max_burst = 4, the driver can select
> burst = 4 for controllers that do support it, or burst = 1 for those
> that don't, and do more bursts.
> 
> This also means we can increase max_burst for the audio codec, as
> the FIFO is 64 samples deep for stereo, or 128 samples for mono.
> 
> 
> If we agree on the above I can send some patches for this.

That's fine to me, but this does not solve the main problem which is
how/where are defined the possible bursts of a SoC.

-- 
Ken ar c'hentañ | ** Breizh ha Linux atav! **
Jef |   http://moinejf.free.fr/

-- 
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.
For more options, visit https://groups.google.com/d/optout.