nand linux-sunxi 3.4

301 views
Skip to first unread message

Mohamed MEDIOUNI

unread,
Jan 13, 2015, 10:56:03 AM1/13/15
to linux...@googlegroups.com
Loading sunxi_nand in the Kurio7S just makes 100% CPU usage for nandd without working access

Toroshin Dmitry

unread,
Jan 13, 2015, 11:09:07 AM1/13/15
to linux...@googlegroups.com


On Tuesday, January 13, 2015 at 9:56:03 PM UTC+6, Mohamed MEDIOUNI wrote:
Loading sunxi_nand in the Kurio7S just makes 100% CPU usage for nandd without working access
sunxi-3.4 nand format is incompatible with lichee-3.4 (sdk kernel).
You can try this port of new nand driver:
 https://github.com/mittorn/sun7i-nand-sunxi
First you should make source in lib dir, after that run make in root path with LICHEE_KDIR set to sunxi kernel sources path, you shuld get out-of-tree nand.ko module. You need to enable sunxi partition table support in kernel to detect partitions.

Tim Tisdall

unread,
Jan 14, 2015, 1:23:59 PM1/14/15
to linux...@googlegroups.com
On Tuesday, 13 January 2015 11:09:07 UTC-5, Toroshin Dmitry wrote:
sunxi-3.4 nand format is incompatible with lichee-3.4 (sdk kernel).
You can try this port of new nand driver:
 https://github.com/mittorn/sun7i-nand-sunxi
First you should make source in lib dir, after that run make in root path with LICHEE_KDIR set to sunxi kernel sources path, you shuld get out-of-tree nand.ko module. You need to enable sunxi partition table support in kernel to detect partitions.

wait..  what is this?  I thought the latest nand driver from the SDK had a binary blob in it. 

Mohamed MEDIOUNI

unread,
Jan 15, 2015, 7:38:20 AM1/15/15
to linux...@googlegroups.com
just crashes after insmod ( 3.4.79)

Toroshin Dmitry

unread,
Jan 15, 2015, 8:17:50 AM1/15/15
to linux...@googlegroups.com
There is open source sun7i nand driver in https://github.com/cubieboard2/linux-sunxi/tree/sunxi-3.3-cb2/modules/nand
I don't know if latest blob has any differences, but it is binary compatible.

Toroshin Dmitry

unread,
Jan 15, 2015, 8:26:15 AM1/15/15
to linux...@googlegroups.com
I have tested it only on 3.4.101 and 3.4.104 kernels. And you need to enable sunxi partition table support (i have disabled creating nodes for partitions as sunxi kernel already have this feature, it creatres nand1, nand2 etc).
Did you have any warnings at the build time? Try to insmod it with fb console with high loglevel.

Mohamed MEDIOUNI

unread,
Jan 15, 2015, 1:09:01 PM1/15/15
to linux...@googlegroups.com
It crashes in the DMA driver,...
Can you upload a kernel with the ft5x_ts fix for the Kurio 7S with kernel headers?

Mohamed MEDIOUNI

unread,
Jan 15, 2015, 1:11:25 PM1/15/15
to linux...@googlegroups.com
downloading libnand,...
( I forgotten to say that there is a LONG backtrace into dmesg.

Alejandro Mery

unread,
Jan 15, 2015, 1:43:46 PM1/15/15
to Toroshin Dmitry, linux...@googlegroups.com
Hi,

On 15.01.2015 14:26, Toroshin Dmitry wrote:
>
>
> On Thursday, January 15, 2015 at 6:38:20 PM UTC+6, Mohamed MEDIOUNI wrote:
>
> just crashes after insmod ( 3.4.79)
>
> Le mardi 13 janvier 2015 16:09:07 UTC, Toroshin Dmitry a écrit :
>
>
>
> On Tuesday, January 13, 2015 at 9:56:03 PM UTC+6, Mohamed
> MEDIOUNI wrote:
>
> Loading sunxi_nand in the Kurio7S just makes 100% CPU usage
> for nandd without working access
>
> sunxi-3.4 nand format is incompatible with lichee-3.4 (sdk kernel).
> You can try this port of new nand driver:
> https://github.com/mittorn/sun7i-nand-sunxi
> <https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fmittorn%2Fsun7i-nand-sunxi&sa=D&sntz=1&usg=AFQjCNEpAwshe_H84gn6NrYlGPvnbhMrsw>
> First you should make source in lib dir, after that run make in
> root path with LICHEE_KDIR set to sunxi kernel sources path, you
> shuld get out-of-tree nand.ko module. You need to enable sunxi
> partition table support in kernel to detect partitions.
>
> I have tested it only on 3.4.101 and 3.4.104 kernels. And you need to
> enable sunxi partition table support (i have disabled creating nodes for
> partitions as sunxi kernel already have this feature, it creatres nand1,
> nand2 etc).
> Did you have any warnings at the build time? Try to insmod it with fb
> console with high loglevel.

can you submit it to be merged into sunxi-3.4?

Toroshin Dmitry

unread,
Jan 16, 2015, 8:07:19 AM1/16/15
to linux...@googlegroups.com, mit...@sibmail.com
Code has some bugs (for example rmmod does not work with it).
And it must be adapded and included to kernel tree.

Luca M.

unread,
Jan 30, 2015, 10:05:46 AM1/30/15
to linux...@googlegroups.com
Hello,
I've tried driver at
https://github.com/mittorn/sun7i-nand-sunxi
with 3.4.105 kernel. Module is loaded but I have a segfault message.
No device appear under /dev/
Another strange thing is that when I load this driver or
sunxi-nand driver the partition table become corrupted.
(seems that when driver is loaded something were wrote on the  nand)
So when i boot without sdcard u-boot do not recognize partition and
and stop booting.
Than I have to flash firmware with livesuit sdcard image to reboot android.
the device is an txcz_a20 http://linux-sunxi.org/TXCZ_A20

Any idea on this issue?

Thanks

Tim Tisdall

unread,
Jan 30, 2015, 10:37:34 AM1/30/15
to linux...@googlegroups.com
:O  Do actually have an Android image for that device?  I created that wiki page, but I've yet to find a legit Android to fix my image.  I used the libnand that was part of the sunxi-3.4 kernel and it broke the nand image on the device.

--
You received this message because you are subscribed to a topic in the Google Groups "linux-sunxi" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/linux-sunxi/uZeEkJ0hiaA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to linux-sunxi...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

Toroshin Dmitry

unread,
Jan 30, 2015, 2:07:12 PM1/30/15
to linux...@googlegroups.com
Hello
Can you post dmesg output after inserting module?
It seems that it erase whole nand flash when somethink wrong.
Of cause it must be fixed before trying to merge it to kernel tree.

Mohamed MEDIOUNI

unread,
Feb 4, 2015, 6:45:39 AM2/4/15
to linux...@googlegroups.com
It works, finally after adding it to /etc/modules , but it erased boot0 at startup...
(mittorn's driver)

So I now have another problem,...

Tim Tisdall

unread,
Feb 4, 2015, 12:39:38 PM2/4/15
to linux...@googlegroups.com
On Fri, Jan 30, 2015 at 10:05 AM, Luca M. <luca.m...@gmail.com> wrote:
Than I have to flash firmware with livesuit sdcard image to reboot android.
the device is an txcz_a20 http://linux-sunxi.org/TXCZ_A20

I still need to fix one of these devices after using the bad libnand driver in the sunxi-3.4 kernel.  Can you make the livesuit image available or point me to where you got it from? 

tkg

unread,
Mar 6, 2015, 6:05:19 PM3/6/15
to linux...@googlegroups.com
Hi Tim,

You said you need to fix "one of" these devices. If you have at least one that is working you might be able to extract the system recovery partition from it using adb or a serial cable to get a root shell. My system recovery partition image is about 606MB and I used it with phoenixcard to create a bootable sdcard to restore my device.

I have been in a similar corrupted situation after running the sunxi-3.4 nand driver on a Linux booted from sdcard but luckily before doing that I succeeded to log in into my TXCZ (mine is V3.0, slightly different box and possibly different chips as I needed new dram settings) and save the image (in my case) from the nandi partition.

Regarding why the driver corrupts the nand, it might be that it has mismatching parameters (different block, oob or even ecc size, and/or different nand randomizer/scrambler settings) or also maybe it doesn't use properly the page pairing for MLC nands ...

I had a play with a custom u-boot based on https://github.com/rgwan/u-boot-sunxi/tree/sunxi-current and I can say that the default boot0 from the android nand is written using the randomizer enabled (seed 0x4a80). When I tried to read it using nand read.raw the data was scrambled and when I used 1k reads, the code thought there was an ecc error and it attempted to correct the data on the nand...
This might mean that while the initial sunxi 3.4 nand driver might have some nand support, it might have a different idea about how to store and read data on the nand than the original android code.

Regards,
tkg
Reply all
Reply to author
Forward
0 new messages