Re: [linux-sunxi] Re: Mainlining Linux Sunxi SoC AW USB

2022-05-27 Thread Jeroen van Jaarsveld
If you enable e.g. loglevel=9 does the nand driver output a NAND ID in the 
kernel log?

E.g. 
[  115.365950] channel 0 chip 0: 98 da 90 15 76 16 08 00
or
[SCAN_DBG]Nand Chip ID: 0x1590da98 0xff76

Note the last one is in reverse order.

You can then search on the ID (in this case 0x98 0xDA 0x90 0x15) to find 
the details.

If there is no NAND ID then you might be able to get it using the tool 
described here 
. 
IT works on the A20 and the H3 so probably also on the A31. It's best to 
run it when nand.ko is not loaded.

Of course you can also open up your device and look at the actual NAND chip 
details.

Op maandag 26 juli 2021 om 01:31:10 UTC+2 schreef petr@gmail.com:

> Hi Andre,
>
> > On Sat, 24 Jul 2021 18:27:53 +0200
> > Petr Vorel  wrote:
>
> > Hi Petr,
>
> > > [ Dropping Greg and linu...@vger.kernel.org ]
> > > > Peter, 
>
> > > > On Sat, 24 Jul 2021 at 15:22, Petr Vorel  
> wrote: 
>
> > > > > Hi Greg, 
>
> > > > > > On Sat, Jul 24, 2021 at 03:41:42PM +0200, Petr Vorel wrote: 
> > > > > > > > Why is this even a driver at all, it looks like you can 
> write a small
> > > > > > > > userspace program using libusb to do everything it does, 
> right? What
> > > > > > > > exactly is this driver needed for? 
>
> > > > > > > I'm sorry for not providing more info at the beginning. This 
> is a driver for
> > > > > > > host computer (i.e. developers laptop) used by LiveSuit tool 
> [2] to flash Images
> > > > > > > to the NAND of Allwinner devices. LiveSuit itself [3] is 
> unfortunately provided
> > > > > > > only in binary form. The only open source code with GPL v2 
> license is awusb
> > > > > > > driver. Thus I thought I could ease my life with upstreaming 
> at least the
> > > > > > > kernel driver. But maybe it's not a good idea. I'm using 
> LiveSuit for flashing
> > > > > > > Allwinner A31, but it requires quite old distro due libqtgui4. 
> Maybe sunxi folks
> > > > > > > use something newer nowadays, but I haven't found anything in 
> their wiki. 
>
> > > > > > Ah, that's not going to be good then. Really, this doesn't seem 
> to need
> > > > > > to be a driver at all, and the ioctls are really strange so we 
> would
> > > > > > need to change them anyway before it could be merged. But with no
> > > > > > access to userspace code, that will be quite difficult, so I 
> would push
> > > > > > back on allwinner and have them work on resolving this. 
> > > > > Understand, it makes sense. Thanks for your time! 
>
> > > > > @Sunxi community: am I missing something? Using LiveSuit with old 
> distro chroot
> > > > > and Xephyr with out-of-tree module isn't fun :(. 
>
> > > > Suggest you take a look at sunxi-tools - specifically the sunxi-fel
> > > > tool. This is a libusb-based userland tool to talk to these devices.
> > > > I'm not sure if it supports flashing to nand on A31 - never tried it 
> -
> > > > but have used it to flash to eMMC and SPI flash on their other 
> chips. 
> > > Thanks for a tip. Looking into sources it does not look like sunxi-fel 
> supports
> > > NAND.
>
> > > Also from Debian wiki [1] (which describes bootable SD Card) it looks 
> like only
> > > old Allwinner u-boot supported access to NAND, thus I'd be surprised if
> > > sunxi-tools supported it. sunxi-bootinfo does not implement NAND,
> > > sunxi-nand-image-builder (which is not built by default) creates raw 
> NAND
> > > images, but now word about flashing.
>
> > > I wonder why NAND is (probably) not supported by sunxi? Lack of 
> documentation?
>
> > Pure NAND is getting rarer these days, on modern boards we see mostly
> > eMMC now (maybe SPI NAND). So NAND is only a concern for older SoCs.
>
> > There is (limited) NAND support for mainline U-Boot on the C.H.I.P.
> > boards[1], which use an A13 (derivative). But reliable operation is
> > only possible with SLC NAND, which means only on the Chip Pro board,
> > IIUC. Most boards will probably utilise MLC (or worse) NAND these days,
> > where effects like write and read disturb make operation more
> > complicated. Maxime has some stories to tell about this.
> > So it would be first good to know if you have SLC NAND or not.
>
> I have no idea which type of NAND device has.
> It's device based on low end tablet. Can I find this info on running system
> (sysfs, /proc, ...). dmesg does not say anything special.
>
> Or is it possible to find it in source code? nand.ko module is some out of 
> tree
> code in modules/nand (kernel 3.3):
> description: Generic NAND flash driver code
> author: nand flash groups
>
> But nothing mentions SLC or MLC. Or do I have to have HW spec?
>
>
> > Because of this direct support for NAND in the tools is understandably
> > "limited" (as in: non-existent). Except for SPI NOR flash there is no
> > "direct" flashing support (for eMMC) in the tools anyway, it just relies
> > on U-Boot support.
> > How this works is that you use sunxi-fel to upload a (mainline) 

Re: [linux-sunxi] Re: Mainlining Linux Sunxi SoC AW USB

2021-07-28 Thread Maxime Ripard
Hi,

On Sat, Jul 24, 2021 at 06:04:32PM +0100, Andre Przywara wrote:
> On Sat, 24 Jul 2021 18:27:53 +0200
> Petr Vorel  wrote:
> 
> Hi Petr,
> 
> > [ Dropping Greg and linux-...@vger.kernel.org ]
> > > Peter,  
> > 
> > > On Sat, 24 Jul 2021 at 15:22, Petr Vorel  wrote:  
> > 
> > > > Hi Greg,  
> > 
> > > > > On Sat, Jul 24, 2021 at 03:41:42PM +0200, Petr Vorel wrote:  
> > > > > > > Why is this even a driver at all, it looks like you can write a 
> > > > > > > small
> > > > > > > userspace program using libusb to do everything it does, right?  
> > > > > > > What
> > > > > > > exactly is this driver needed for?  
> > 
> > > > > > I'm sorry for not providing more info at the beginning. This is a 
> > > > > > driver for
> > > > > > host computer (i.e. developers laptop) used by LiveSuit tool [2] to 
> > > > > > flash Images
> > > > > > to the NAND of Allwinner devices. LiveSuit itself [3] is 
> > > > > > unfortunately provided
> > > > > > only in binary form. The only open source code with GPL v2 license 
> > > > > > is awusb
> > > > > > driver. Thus I thought I could ease my life with upstreaming at 
> > > > > > least the
> > > > > > kernel driver. But maybe it's not a good idea. I'm using LiveSuit 
> > > > > > for flashing
> > > > > > Allwinner A31, but it requires quite old distro due libqtgui4. 
> > > > > > Maybe sunxi folks
> > > > > > use something newer nowadays, but I haven't found anything in their 
> > > > > > wiki.  
> > 
> > > > > Ah, that's not going to be good then.  Really, this doesn't seem to 
> > > > > need
> > > > > to be a driver at all, and the ioctls are really strange so we would
> > > > > need to change them anyway before it could be merged.  But with no
> > > > > access to userspace code, that will be quite difficult, so I would 
> > > > > push
> > > > > back on allwinner and have them work on resolving this.  
> > > > Understand, it makes sense. Thanks for your time!  
> > 
> > > > @Sunxi community: am I missing something? Using LiveSuit with old 
> > > > distro chroot
> > > > and Xephyr with out-of-tree module isn't fun :(.  
> > 
> > > Suggest you take a look at sunxi-tools - specifically the sunxi-fel
> > > tool. This is a libusb-based userland tool to talk to these devices.
> > > I'm not sure if it supports flashing to nand on A31 - never tried it -
> > > but have used it to flash to eMMC and SPI flash on their other chips.  
> > Thanks for a tip. Looking into sources it does not look like sunxi-fel 
> > supports
> > NAND.
> > 
> > Also from Debian wiki [1] (which describes bootable SD Card) it looks like 
> > only
> > old Allwinner u-boot supported access to NAND, thus I'd be surprised if
> > sunxi-tools supported it. sunxi-bootinfo does not implement NAND,
> > sunxi-nand-image-builder (which is not built by default) creates raw NAND
> > images, but now word about flashing.
> > 
> > I wonder why NAND is (probably) not supported by sunxi? Lack of 
> > documentation?
> 
> Pure NAND is getting rarer these days, on modern boards we see mostly
> eMMC now (maybe SPI NAND). So NAND is only a concern for older SoCs.
> 
> There is (limited) NAND support for mainline U-Boot on the C.H.I.P.
> boards[1], which use an A13 (derivative). But reliable operation is
> only possible with SLC NAND, which means only on the Chip Pro board,
> IIUC. Most boards will probably utilise MLC (or worse) NAND these days,
> where effects like write and read disturb make operation more
> complicated. Maxime has some stories to tell about this.
> So it would be first good to know if you have SLC NAND or not.
> 
> Because of this direct support for NAND in the tools is understandably
> "limited" (as in: non-existent). Except for SPI NOR flash there is no
> "direct" flashing support (for eMMC) in the tools anyway, it just relies
> on U-Boot support.
> How this works is that you use sunxi-fel to upload a (mainline) U-Boot
> binary directly into DRAM, and launch that. Then you can use the full
> functionality of U-Boot to load your image. Most popular for NAND
> support seems to be U-Boot's Android Fastboot implementation over a USB
> gadget device, so you can use the off-the-shelf fastboot tool on your
> host computer to flash the NAND. Other possibilities would be to use
> USB host support or TFTP to first load an image into DRAM, then use
> U-Boot commands to write that into the NAND flash.
>
> To my knowledge NAND flash in U-Boot *only* works on the A13/R8/GR8
> chips with SLC NAND, and is only enabled and tested on the Chip boards.
> Every other combination would require some work; much more work the
> farther you move from there (other SoC, MLC, ...).

It works on the A33 as well (the Nintendo board has support for it). And
I guess it works with virtually any SoC, the culprit really is MLC vs
SLC, the NAND controller hasn't really changed.

Maxime

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails 

Re: [linux-sunxi] Re: Mainlining Linux Sunxi SoC AW USB

2021-07-25 Thread Petr Vorel
Hi Andre,

> On Sat, 24 Jul 2021 18:27:53 +0200
> Petr Vorel  wrote:

> Hi Petr,

> > [ Dropping Greg and linux-...@vger.kernel.org ]
> > > Peter,  

> > > On Sat, 24 Jul 2021 at 15:22, Petr Vorel  wrote:  

> > > > Hi Greg,  

> > > > > On Sat, Jul 24, 2021 at 03:41:42PM +0200, Petr Vorel wrote:  
> > > > > > > Why is this even a driver at all, it looks like you can write a 
> > > > > > > small
> > > > > > > userspace program using libusb to do everything it does, right?  
> > > > > > > What
> > > > > > > exactly is this driver needed for?  

> > > > > > I'm sorry for not providing more info at the beginning. This is a 
> > > > > > driver for
> > > > > > host computer (i.e. developers laptop) used by LiveSuit tool [2] to 
> > > > > > flash Images
> > > > > > to the NAND of Allwinner devices. LiveSuit itself [3] is 
> > > > > > unfortunately provided
> > > > > > only in binary form. The only open source code with GPL v2 license 
> > > > > > is awusb
> > > > > > driver. Thus I thought I could ease my life with upstreaming at 
> > > > > > least the
> > > > > > kernel driver. But maybe it's not a good idea. I'm using LiveSuit 
> > > > > > for flashing
> > > > > > Allwinner A31, but it requires quite old distro due libqtgui4. 
> > > > > > Maybe sunxi folks
> > > > > > use something newer nowadays, but I haven't found anything in their 
> > > > > > wiki.  

> > > > > Ah, that's not going to be good then.  Really, this doesn't seem to 
> > > > > need
> > > > > to be a driver at all, and the ioctls are really strange so we would
> > > > > need to change them anyway before it could be merged.  But with no
> > > > > access to userspace code, that will be quite difficult, so I would 
> > > > > push
> > > > > back on allwinner and have them work on resolving this.  
> > > > Understand, it makes sense. Thanks for your time!  

> > > > @Sunxi community: am I missing something? Using LiveSuit with old 
> > > > distro chroot
> > > > and Xephyr with out-of-tree module isn't fun :(.  

> > > Suggest you take a look at sunxi-tools - specifically the sunxi-fel
> > > tool. This is a libusb-based userland tool to talk to these devices.
> > > I'm not sure if it supports flashing to nand on A31 - never tried it -
> > > but have used it to flash to eMMC and SPI flash on their other chips.  
> > Thanks for a tip. Looking into sources it does not look like sunxi-fel 
> > supports
> > NAND.

> > Also from Debian wiki [1] (which describes bootable SD Card) it looks like 
> > only
> > old Allwinner u-boot supported access to NAND, thus I'd be surprised if
> > sunxi-tools supported it. sunxi-bootinfo does not implement NAND,
> > sunxi-nand-image-builder (which is not built by default) creates raw NAND
> > images, but now word about flashing.

> > I wonder why NAND is (probably) not supported by sunxi? Lack of 
> > documentation?

> Pure NAND is getting rarer these days, on modern boards we see mostly
> eMMC now (maybe SPI NAND). So NAND is only a concern for older SoCs.

> There is (limited) NAND support for mainline U-Boot on the C.H.I.P.
> boards[1], which use an A13 (derivative). But reliable operation is
> only possible with SLC NAND, which means only on the Chip Pro board,
> IIUC. Most boards will probably utilise MLC (or worse) NAND these days,
> where effects like write and read disturb make operation more
> complicated. Maxime has some stories to tell about this.
> So it would be first good to know if you have SLC NAND or not.

I have no idea which type of NAND device has.
It's device based on low end tablet. Can I find this info on running system
(sysfs, /proc, ...). dmesg does not say anything special.

Or is it possible to find it in source code? nand.ko module is some out of tree
code in modules/nand (kernel 3.3):
description:Generic NAND flash driver code
author: nand flash groups

But nothing mentions SLC or MLC. Or do I have to have HW spec?


> Because of this direct support for NAND in the tools is understandably
> "limited" (as in: non-existent). Except for SPI NOR flash there is no
> "direct" flashing support (for eMMC) in the tools anyway, it just relies
> on U-Boot support.
> How this works is that you use sunxi-fel to upload a (mainline) U-Boot
> binary directly into DRAM, and launch that. Then you can use the full
> functionality of U-Boot to load your image. Most popular for NAND
> support seems to be U-Boot's Android Fastboot implementation over a USB
> gadget device, so you can use the off-the-shelf fastboot tool on your
> host computer to flash the NAND. Other possibilities would be to use
> USB host support or TFTP to first load an image into DRAM, then use
> U-Boot commands to write that into the NAND flash.
> To my knowledge NAND flash in U-Boot *only* works on the A13/R8/GR8
> chips with SLC NAND, and is only enabled and tested on the Chip boards.
> Every other combination would require some work; much more work the
> farther you move from there (other SoC, MLC, ...).

Thanks for detailed 

Re: [linux-sunxi] Re: Mainlining Linux Sunxi SoC AW USB

2021-07-24 Thread Andre Przywara
On Sat, 24 Jul 2021 18:27:53 +0200
Petr Vorel  wrote:

Hi Petr,

> [ Dropping Greg and linux-...@vger.kernel.org ]
> > Peter,  
> 
> > On Sat, 24 Jul 2021 at 15:22, Petr Vorel  wrote:  
> 
> > > Hi Greg,  
> 
> > > > On Sat, Jul 24, 2021 at 03:41:42PM +0200, Petr Vorel wrote:  
> > > > > > Why is this even a driver at all, it looks like you can write a 
> > > > > > small
> > > > > > userspace program using libusb to do everything it does, right?  
> > > > > > What
> > > > > > exactly is this driver needed for?  
> 
> > > > > I'm sorry for not providing more info at the beginning. This is a 
> > > > > driver for
> > > > > host computer (i.e. developers laptop) used by LiveSuit tool [2] to 
> > > > > flash Images
> > > > > to the NAND of Allwinner devices. LiveSuit itself [3] is 
> > > > > unfortunately provided
> > > > > only in binary form. The only open source code with GPL v2 license is 
> > > > > awusb
> > > > > driver. Thus I thought I could ease my life with upstreaming at least 
> > > > > the
> > > > > kernel driver. But maybe it's not a good idea. I'm using LiveSuit for 
> > > > > flashing
> > > > > Allwinner A31, but it requires quite old distro due libqtgui4. Maybe 
> > > > > sunxi folks
> > > > > use something newer nowadays, but I haven't found anything in their 
> > > > > wiki.  
> 
> > > > Ah, that's not going to be good then.  Really, this doesn't seem to need
> > > > to be a driver at all, and the ioctls are really strange so we would
> > > > need to change them anyway before it could be merged.  But with no
> > > > access to userspace code, that will be quite difficult, so I would push
> > > > back on allwinner and have them work on resolving this.  
> > > Understand, it makes sense. Thanks for your time!  
> 
> > > @Sunxi community: am I missing something? Using LiveSuit with old distro 
> > > chroot
> > > and Xephyr with out-of-tree module isn't fun :(.  
> 
> > Suggest you take a look at sunxi-tools - specifically the sunxi-fel
> > tool. This is a libusb-based userland tool to talk to these devices.
> > I'm not sure if it supports flashing to nand on A31 - never tried it -
> > but have used it to flash to eMMC and SPI flash on their other chips.  
> Thanks for a tip. Looking into sources it does not look like sunxi-fel 
> supports
> NAND.
> 
> Also from Debian wiki [1] (which describes bootable SD Card) it looks like 
> only
> old Allwinner u-boot supported access to NAND, thus I'd be surprised if
> sunxi-tools supported it. sunxi-bootinfo does not implement NAND,
> sunxi-nand-image-builder (which is not built by default) creates raw NAND
> images, but now word about flashing.
> 
> I wonder why NAND is (probably) not supported by sunxi? Lack of documentation?

Pure NAND is getting rarer these days, on modern boards we see mostly
eMMC now (maybe SPI NAND). So NAND is only a concern for older SoCs.

There is (limited) NAND support for mainline U-Boot on the C.H.I.P.
boards[1], which use an A13 (derivative). But reliable operation is
only possible with SLC NAND, which means only on the Chip Pro board,
IIUC. Most boards will probably utilise MLC (or worse) NAND these days,
where effects like write and read disturb make operation more
complicated. Maxime has some stories to tell about this.
So it would be first good to know if you have SLC NAND or not.

Because of this direct support for NAND in the tools is understandably
"limited" (as in: non-existent). Except for SPI NOR flash there is no
"direct" flashing support (for eMMC) in the tools anyway, it just relies
on U-Boot support.
How this works is that you use sunxi-fel to upload a (mainline) U-Boot
binary directly into DRAM, and launch that. Then you can use the full
functionality of U-Boot to load your image. Most popular for NAND
support seems to be U-Boot's Android Fastboot implementation over a USB
gadget device, so you can use the off-the-shelf fastboot tool on your
host computer to flash the NAND. Other possibilities would be to use
USB host support or TFTP to first load an image into DRAM, then use
U-Boot commands to write that into the NAND flash.
To my knowledge NAND flash in U-Boot *only* works on the A13/R8/GR8
chips with SLC NAND, and is only enabled and tested on the Chip boards.
Every other combination would require some work; much more work the
farther you move from there (other SoC, MLC, ...).

Cheers,
Andre

[1] https://linux-sunxi.org/NextThingCo_CHIP

-- 
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/20210724180432.4423b9e3%40slackpad.fritz.box.


[linux-sunxi] Re: Mainlining Linux Sunxi SoC AW USB

2021-07-24 Thread Petr Vorel
Hi Jernej,

[ Dropping Greg and linux-...@vger.kernel.org ]

> Dne sobota, 24. julij 2021 ob 16:22:16 CEST je Petr Vorel napisal(a):
> > Hi Greg,

> > > On Sat, Jul 24, 2021 at 03:41:42PM +0200, Petr Vorel wrote:
> > > > > Why is this even a driver at all, it looks like you can write a small
> > > > > userspace program using libusb to do everything it does, right?  What
> > > > > exactly is this driver needed for?

> > > > I'm sorry for not providing more info at the beginning. This is a driver
> > > > for host computer (i.e. developers laptop) used by LiveSuit tool [2] to
> > > > flash Images to the NAND of Allwinner devices. LiveSuit itself [3] is
> > > > unfortunately provided only in binary form. The only open source code
> > > > with GPL v2 license is awusb driver. Thus I thought I could ease my
> > > > life with upstreaming at least the kernel driver. But maybe it's not a
> > > > good idea. I'm using LiveSuit for flashing Allwinner A31, but it
> > > > requires quite old distro due libqtgui4. Maybe sunxi folks use
> > > > something newer nowadays, but I haven't found anything in their wiki.> 
> > > Ah, that's not going to be good then.  Really, this doesn't seem to need
> > > to be a driver at all, and the ioctls are really strange so we would
> > > need to change them anyway before it could be merged.  But with no
> > > access to userspace code, that will be quite difficult, so I would push
> > > back on allwinner and have them work on resolving this.

> > Understand, it makes sense. Thanks for your time!

> > @Sunxi community: am I missing something? Using LiveSuit with old distro
> > chroot and Xephyr with out-of-tree module isn't fun :(.

> Community is mostly concerned with mainline kernel nowadays and thus with 
> standard tools. Few people still use vendor (BSP) kernel and most of those 
> use 
> it without LiveSuit (like custom distro images).
Understand. LiveSuit is for me a way back to original firmware.

Kind regards,
Petr

> Now and then people ask about LiveSuit on IRC, but they usually get little 
> response.

> 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/YPxD4J3u2jo319JY%40pevik.


[linux-sunxi] Re: Mainlining Linux Sunxi SoC AW USB

2021-07-24 Thread Petr Vorel
Hi Felipe,

[ Dropping Greg and linux-...@vger.kernel.org ]

> Hi,

> Petr Vorel  writes:
> >> > [1] 
> >> > https://github.com/linux-sunxi/sunxi-livesuite/blob/master/awusb/awusb.c

> >> Why is this even a driver at all, it looks like you can write a small
> >> userspace program using libusb to do everything it does, right?  What
> >> exactly is this driver needed for?

> > I'm sorry for not providing more info at the beginning. This is a driver for
> > host computer (i.e. developers laptop) used by LiveSuit tool [2] to flash 
> > Images
> > to the NAND of Allwinner devices. LiveSuit itself [3] is unfortunately 
> > provided
> > only in binary form. The only open source code with GPL v2 license is awusb
> > driver. Thus I thought I could ease my life with upstreaming at least the
> > kernel driver. But maybe it's not a good idea. I'm using LiveSuit for 
> > flashing
> > Allwinner A31, but it requires quite old distro due libqtgui4. Maybe sunxi 
> > folks
> > use something newer nowadays, but I haven't found anything in their wiki.

> looks like you could implement that entirely in userspace with libusb ;-)
Thanks for a hint. Yes, whole thing should be able to implement in userspace.
I'll have look if I'm able to reveal what current userspace code (LiveSuit)
does. The goal is to have simple command line tool (no GUI).

Kind regards,
Petr

-- 
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/YPxBID3rk0NY5IC8%40pevik.


Re: [linux-sunxi] Re: Mainlining Linux Sunxi SoC AW USB

2021-07-24 Thread Petr Vorel
Hi Chris, all,

[ Dropping Greg and linux-...@vger.kernel.org ]
> Peter,

> On Sat, 24 Jul 2021 at 15:22, Petr Vorel  wrote:

> > Hi Greg,

> > > On Sat, Jul 24, 2021 at 03:41:42PM +0200, Petr Vorel wrote:
> > > > > Why is this even a driver at all, it looks like you can write a small
> > > > > userspace program using libusb to do everything it does, right?  What
> > > > > exactly is this driver needed for?

> > > > I'm sorry for not providing more info at the beginning. This is a 
> > > > driver for
> > > > host computer (i.e. developers laptop) used by LiveSuit tool [2] to 
> > > > flash Images
> > > > to the NAND of Allwinner devices. LiveSuit itself [3] is unfortunately 
> > > > provided
> > > > only in binary form. The only open source code with GPL v2 license is 
> > > > awusb
> > > > driver. Thus I thought I could ease my life with upstreaming at least 
> > > > the
> > > > kernel driver. But maybe it's not a good idea. I'm using LiveSuit for 
> > > > flashing
> > > > Allwinner A31, but it requires quite old distro due libqtgui4. Maybe 
> > > > sunxi folks
> > > > use something newer nowadays, but I haven't found anything in their 
> > > > wiki.

> > > Ah, that's not going to be good then.  Really, this doesn't seem to need
> > > to be a driver at all, and the ioctls are really strange so we would
> > > need to change them anyway before it could be merged.  But with no
> > > access to userspace code, that will be quite difficult, so I would push
> > > back on allwinner and have them work on resolving this.
> > Understand, it makes sense. Thanks for your time!

> > @Sunxi community: am I missing something? Using LiveSuit with old distro 
> > chroot
> > and Xephyr with out-of-tree module isn't fun :(.

> Suggest you take a look at sunxi-tools - specifically the sunxi-fel
> tool. This is a libusb-based userland tool to talk to these devices.
> I'm not sure if it supports flashing to nand on A31 - never tried it -
> but have used it to flash to eMMC and SPI flash on their other chips.
Thanks for a tip. Looking into sources it does not look like sunxi-fel supports
NAND.

Also from Debian wiki [1] (which describes bootable SD Card) it looks like only
old Allwinner u-boot supported access to NAND, thus I'd be surprised if
sunxi-tools supported it. sunxi-bootinfo does not implement NAND,
sunxi-nand-image-builder (which is not built by default) creates raw NAND
images, but now word about flashing.

I wonder why NAND is (probably) not supported by sunxi? Lack of documentation?

Kind regards,
Petr

[1] https://wiki.debian.org/InstallingDebianOn/Allwinner

> hth,
> Chris


> > Kind regards,
> > Petr

> > > thanks,

> > > greg k-h

> > --
> > 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/YPwiGB7VnzECN/jg%40pevik.

-- 
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/YPw/iTdsqggtvlKL%40pevik.


[linux-sunxi] Re: Mainlining Linux Sunxi SoC AW USB

2021-07-24 Thread Jernej Škrabec
Dne sobota, 24. julij 2021 ob 16:22:16 CEST je Petr Vorel napisal(a):
> Hi Greg,
> 
> > On Sat, Jul 24, 2021 at 03:41:42PM +0200, Petr Vorel wrote:
> > > > Why is this even a driver at all, it looks like you can write a small
> > > > userspace program using libusb to do everything it does, right?  What
> > > > exactly is this driver needed for?
> > > 
> > > I'm sorry for not providing more info at the beginning. This is a driver
> > > for host computer (i.e. developers laptop) used by LiveSuit tool [2] to
> > > flash Images to the NAND of Allwinner devices. LiveSuit itself [3] is
> > > unfortunately provided only in binary form. The only open source code
> > > with GPL v2 license is awusb driver. Thus I thought I could ease my
> > > life with upstreaming at least the kernel driver. But maybe it's not a
> > > good idea. I'm using LiveSuit for flashing Allwinner A31, but it
> > > requires quite old distro due libqtgui4. Maybe sunxi folks use
> > > something newer nowadays, but I haven't found anything in their wiki.> 
> > Ah, that's not going to be good then.  Really, this doesn't seem to need
> > to be a driver at all, and the ioctls are really strange so we would
> > need to change them anyway before it could be merged.  But with no
> > access to userspace code, that will be quite difficult, so I would push
> > back on allwinner and have them work on resolving this.
> 
> Understand, it makes sense. Thanks for your time!
> 
> @Sunxi community: am I missing something? Using LiveSuit with old distro
> chroot and Xephyr with out-of-tree module isn't fun :(.

Community is mostly concerned with mainline kernel nowadays and thus with 
standard tools. Few people still use vendor (BSP) kernel and most of those use 
it without LiveSuit (like custom distro images).

Now and then people ask about LiveSuit on IRC, but they usually get little 
response.

Best regards,
Jernej

> 
> Kind regards,
> Petr
> 
> > thanks,
> > 
> > greg k-h




-- 
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/4183659.s5WrjGzUDR%40jernej-laptop.


Re: [linux-sunxi] Re: Mainlining Linux Sunxi SoC AW USB

2021-07-24 Thread Christopher Obbard
Peter,

On Sat, 24 Jul 2021 at 15:22, Petr Vorel  wrote:
>
> Hi Greg,
>
> > On Sat, Jul 24, 2021 at 03:41:42PM +0200, Petr Vorel wrote:
> > > > Why is this even a driver at all, it looks like you can write a small
> > > > userspace program using libusb to do everything it does, right?  What
> > > > exactly is this driver needed for?
>
> > > I'm sorry for not providing more info at the beginning. This is a driver 
> > > for
> > > host computer (i.e. developers laptop) used by LiveSuit tool [2] to flash 
> > > Images
> > > to the NAND of Allwinner devices. LiveSuit itself [3] is unfortunately 
> > > provided
> > > only in binary form. The only open source code with GPL v2 license is 
> > > awusb
> > > driver. Thus I thought I could ease my life with upstreaming at least the
> > > kernel driver. But maybe it's not a good idea. I'm using LiveSuit for 
> > > flashing
> > > Allwinner A31, but it requires quite old distro due libqtgui4. Maybe 
> > > sunxi folks
> > > use something newer nowadays, but I haven't found anything in their wiki.
>
> > Ah, that's not going to be good then.  Really, this doesn't seem to need
> > to be a driver at all, and the ioctls are really strange so we would
> > need to change them anyway before it could be merged.  But with no
> > access to userspace code, that will be quite difficult, so I would push
> > back on allwinner and have them work on resolving this.
> Understand, it makes sense. Thanks for your time!
>
> @Sunxi community: am I missing something? Using LiveSuit with old distro 
> chroot
> and Xephyr with out-of-tree module isn't fun :(.

Suggest you take a look at sunxi-tools - specifically the sunxi-fel
tool. This is a libusb-based userland tool to talk to these devices.
I'm not sure if it supports flashing to nand on A31 - never tried it -
but have used it to flash to eMMC and SPI flash on their other chips.

hth,
Chris

>
> Kind regards,
> Petr
>
> > thanks,
>
> > greg k-h
>
> --
> 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/YPwiGB7VnzECN/jg%40pevik.

-- 
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/CAP03Xer3QK7gFa5szL7gQLq-%3D-muyPDzH-D24mhafDpUjj5%3Dbw%40mail.gmail.com.


[linux-sunxi] Re: Mainlining Linux Sunxi SoC AW USB

2021-07-24 Thread Petr Vorel
Hi Greg,

> On Sat, Jul 24, 2021 at 03:41:42PM +0200, Petr Vorel wrote:
> > > Why is this even a driver at all, it looks like you can write a small
> > > userspace program using libusb to do everything it does, right?  What
> > > exactly is this driver needed for?

> > I'm sorry for not providing more info at the beginning. This is a driver for
> > host computer (i.e. developers laptop) used by LiveSuit tool [2] to flash 
> > Images
> > to the NAND of Allwinner devices. LiveSuit itself [3] is unfortunately 
> > provided
> > only in binary form. The only open source code with GPL v2 license is awusb
> > driver. Thus I thought I could ease my life with upstreaming at least the
> > kernel driver. But maybe it's not a good idea. I'm using LiveSuit for 
> > flashing
> > Allwinner A31, but it requires quite old distro due libqtgui4. Maybe sunxi 
> > folks
> > use something newer nowadays, but I haven't found anything in their wiki.

> Ah, that's not going to be good then.  Really, this doesn't seem to need
> to be a driver at all, and the ioctls are really strange so we would
> need to change them anyway before it could be merged.  But with no
> access to userspace code, that will be quite difficult, so I would push
> back on allwinner and have them work on resolving this.
Understand, it makes sense. Thanks for your time!

@Sunxi community: am I missing something? Using LiveSuit with old distro chroot
and Xephyr with out-of-tree module isn't fun :(.

Kind regards,
Petr

> thanks,

> greg k-h

-- 
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/YPwiGB7VnzECN/jg%40pevik.


[linux-sunxi] Re: Mainlining Linux Sunxi SoC AW USB

2021-07-24 Thread Greg KH
On Sat, Jul 24, 2021 at 03:41:42PM +0200, Petr Vorel wrote:
> > Why is this even a driver at all, it looks like you can write a small
> > userspace program using libusb to do everything it does, right?  What
> > exactly is this driver needed for?
> 
> I'm sorry for not providing more info at the beginning. This is a driver for
> host computer (i.e. developers laptop) used by LiveSuit tool [2] to flash 
> Images
> to the NAND of Allwinner devices. LiveSuit itself [3] is unfortunately 
> provided
> only in binary form. The only open source code with GPL v2 license is awusb
> driver. Thus I thought I could ease my life with upstreaming at least the
> kernel driver. But maybe it's not a good idea. I'm using LiveSuit for flashing
> Allwinner A31, but it requires quite old distro due libqtgui4. Maybe sunxi 
> folks
> use something newer nowadays, but I haven't found anything in their wiki.

Ah, that's not going to be good then.  Really, this doesn't seem to need
to be a driver at all, and the ioctls are really strange so we would
need to change them anyway before it could be merged.  But with no
access to userspace code, that will be quite difficult, so I would push
back on allwinner and have them work on resolving this.

thanks,

greg k-h

-- 
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/YPwhAsK/rDkVeK0y%40kroah.com.


[linux-sunxi] Re: Mainlining Linux Sunxi SoC AW USB

2021-07-24 Thread Petr Vorel
Hi Greg,

[ Cc: linux-su...@lists.linux.dev and linux-sunxi@googlegroups.com, which I
should have done before ]

> On Sat, Jul 24, 2021 at 11:54:40AM +0200, Petr Vorel wrote:
> > Hi,

> > I'd like to cleanup and mainline Linux Sunxi SoC AW USB host driver [1].

> Great!

> > What are the most ugly parts which should be replaced? Loading module does 
> > not
> > complain about anything?
> > [267044.912155] awusb: loading out-of-tree module taints kernel.

> That will be fixed by moving it into the tree.

> > [267044.912257] awusb: module verification failed: signature and/or 
> > required key missing - tainting kernel

> That shows a mis-match between you building a kernel and what keys were
> used to build the distro kernel you are using.

> > [267044.913399] usbcore: registered new interface driver allwinner
> > [267044.913401] awusb: v0.5:AW USB driver

> Looks fine.
Yep, I meant by this, that I see nothing serious (i.e. agree with you).

> > BTW should it go to the host/Kconfig or misc/Kconfig or elsewhere?

> No idea, is this a host driver or does it control a USB device you plug
> into the system?

> > [1] https://github.com/linux-sunxi/sunxi-livesuite/blob/master/awusb/awusb.c

> I looked at this, and it's a device driver, not a host controller
> driver.

> But it looks to need a userspace program for the ioctls, where is that
> code at?  And why does it need any ioctls at all?

> Why is this even a driver at all, it looks like you can write a small
> userspace program using libusb to do everything it does, right?  What
> exactly is this driver needed for?

I'm sorry for not providing more info at the beginning. This is a driver for
host computer (i.e. developers laptop) used by LiveSuit tool [2] to flash Images
to the NAND of Allwinner devices. LiveSuit itself [3] is unfortunately provided
only in binary form. The only open source code with GPL v2 license is awusb
driver. Thus I thought I could ease my life with upstreaming at least the
kernel driver. But maybe it's not a good idea. I'm using LiveSuit for flashing
Allwinner A31, but it requires quite old distro due libqtgui4. Maybe sunxi folks
use something newer nowadays, but I haven't found anything in their wiki.

Kind regards,
Petr

[2] https://github.com/linux-sunxi/sunxi-livesuite
[3] https://github.com/linux-sunxi/sunxi-livesuite/tree/master/x86-64

> thanks,

> greg k-h

-- 
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/YPwYlvh4DqaUsPCF%40pevik.