[linux-sunxi] U-Boot sun7i NAND SPL - Cubieboard2 - MTD - Help

2016-08-21 Thread Ezaul Zillmer
Good evening everyone

We are working to rotate BAT / NAND in a Cubieboard2 with Samsung NAND 316 
K9GBG08U0A SCB0

Below show the whole process I am following:


All changed files are attached!


#
#
sunxi-tools
git clone git://github.com/linux-sunxi/sunxi-tools.git
make misc

#
#
U-Boot Denx
git clone git://git.denx.de/u-boot.git -b master u-boot-denx

configs/Cubieboard2_defconfig
CONFIG_SUNXI_NAND=y

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- Cubieboard2_defconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
add NAND
add MTD

.config 
follows the attachment

I changed the following files:

##
arch/arm/dts/sun7i-a20.dtsi

nand_clk: clk@01c20080 {
#clock-cells = <0>;
compatible = "allwinner,sun4i-a10-mod0-clk";
reg = <0x01c20080 0x4>;
clocks = <>, < 1>, < 1>;
clock-output-names = "nand";
};

nfc: nand@01c03000 {
compatible = "allwinner,sun4i-a10-nand";
reg = <0x01c03000 0x1000>;
interrupts = ;
clocks = <_gates 13>, <_clk>;
clock-names = "ahb", "mod";
dmas = < SUN4I_DMA_DEDICATED 3>;
dma-names = "rxtx";
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;

nand_pins_a: nand_base0@0 {
allwinner,pins = "PC0", "PC1", "PC2",
"PC5", "PC8", "PC9", "PC10",
"PC11", "PC12", "PC13", 
"PC14",
"PC15", "PC16";
allwinner,function = "nand0";
allwinner,drive = ;
allwinner,pull = ;
};

nand_cs0_pins_a: nand_cs@0 {
allwinner,pins = "PC4";
allwinner,function = "nand0";
allwinner,drive = ;
allwinner,pull = ;
};

nand_cs1_pins_a: nand_cs@1 {
allwinner,pins = "PC3";
allwinner,function = "nand0";
allwinner,drive = ;
allwinner,pull = ;
};

nand_cs2_pins_a: nand_cs@2 {
allwinner,pins = "PC17";
allwinner,function = "nand0";
allwinner,drive = ;
allwinner,pull = ;
};

nand_cs3_pins_a: nand_cs@3 {
allwinner,pins = "PC18";
allwinner,function = "nand0";
allwinner,drive = ;
allwinner,pull = ;
};

nand_cs4_pins_a: nand_cs@4 {
allwinner,pins = "PC19";
allwinner,function = "nand0";
allwinner,drive = ;
allwinner,pull = ;
};

nand_cs5_pins_a: nand_cs@5 {
allwinner,pins = "PC20";
allwinner,function = "nand0";
allwinner,drive = ;
allwinner,pull = ;
};

nand_cs6_pins_a: nand_cs@6 {
allwinner,pins = "PC21";
allwinner,function = "nand0";
allwinner,drive = ;
allwinner,pull = ;
};

nand_cs7_pins_a: nand_cs@7 {
allwinner,pins = "PC22";
allwinner,function = "nand0";
allwinner,drive = ;
allwinner,pull = ;
};

nand_rb0_pins_a: nand_rb@0 {
allwinner,pins = "PC6";

Re: [linux-sunxi] Kernel damaged device?

2016-08-21 Thread Leonardo
Em domingo, 21 de agosto de 2016 09:16:09 UTC-3, Luc Verhaegen escreveu:
>
> On Sat, Aug 20, 2016 at 07:26:46PM -0700, Leonardo wrote: 
> > Hi. I'm building a very minimal Linux distro to use as an embedded 
> system 
> > on a A20 tablet. I don't want to believe this, but I think that booting 
> my 
> > distro has damaged the device. The tablet came with Android. I had it 
> > rooted so I could extract the fex file. Then I got kernel 3.4.104 and 
> uboot 
> > 2016.02 from GitHub, built my file system with buildroot and so on. I'm 
> > using an SD card for now. So I tried booting my system and nothing came 
> up 
> > on the LCD. Then I remove my SD card, try to get back to Android and 
> still 
> > nothing on the screen! The device is not dead. I can access it using ssh 
> > over the wifi, the usb port works fine. Basically I can do anything 
> > remotely. At first I thought I might have damaged something on the PCB 
> > while performing the tests, so I had a second tablet. Boot on Android, 
> > display works fine. Boot on my distro, nothing on screen. Try to get 
> back 
> > to Android, and nothing on the screen again. By the way, the backlight 
> > lights up as usual, so the display is not dead also. I've worked on a 
> > similar project last year and had no problem like this at all. I have no 
> > idea what went wrong. Is it possible that my kernel has damaged the 
> device 
> > somehow? 
>
> Damage, no. Ruined nand content due to different settings, yes. 
>
> Thank allwinner for changing its mind on how to configure its nand 
> controller in the middle of the A20 lifetime, while having code in 
> its nand driver that clears the ram if it finds garbage. 
>
> Luc Verhaegen. 
>

That makes sense. I tried dumping /dev/nand and got 8GB of 0xFF. In 
addition to that, there's this message on boot:

[NAND] nand driver version: 0x2 0x9
Dev Sunxi softw311 nand magic does not match for MBR 1: 
...
Dev Sunxi softw311 nand header bad for all MBR copies, MBR corrupted or not 
present.
 nand: unknown partition table
[NAND]nand driver, ok.

Last year I had this embedded system running on a 7" tablet. Now I'm trying 
the same using a 9" one. Both are A20 and from the same manufacturer. 
Actually the designs are quite similar, except for the screen size and some 
small changes on the PCB. So I got the system I'm currently setting up, 
changed its fex for the 7" one and gave it a try
on the smaller tablet. I got everything on screen by the first run... Back 
to the 9" tablet, after changing back the fex file, and blank screen 
again... I was thinking before that I could have stripped down my kernel 
too much, and because of that the screen wasn't working, but now I don't 
know what to think... 

-- 
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] Kernel damaged device?

2016-08-21 Thread Leonardo
2016-08-21 9:20 GMT-03:00 Luc Verhaegen :
>
> On Sat, Aug 20, 2016 at 07:26:46PM -0700, Leonardo wrote:
> > Hi. I'm building a very minimal Linux distro to use as an embedded system
> > on a A20 tablet. I don't want to believe this, but I think that booting my
> > distro has damaged the device. The tablet came with Android. I had it
> > rooted so I could extract the fex file. Then I got kernel 3.4.104 and uboot
> > 2016.02 from GitHub, built my file system with buildroot and so on. I'm
> > using an SD card for now. So I tried booting my system and nothing came up
> > on the LCD. Then I remove my SD card, try to get back to Android and still
> > nothing on the screen! The device is not dead. I can access it using ssh
> > over the wifi, the usb port works fine. Basically I can do anything
> > remotely. At first I thought I might have damaged something on the PCB
> > while performing the tests, so I had a second tablet. Boot on Android,
> > display works fine. Boot on my distro, nothing on screen. Try to get back
> > to Android, and nothing on the screen again. By the way, the backlight
> > lights up as usual, so the display is not dead also. I've worked on a
> > similar project last year and had no problem like this at all. I have no
> > idea what went wrong. Is it possible that my kernel has damaged the device
> > somehow?
>
> Damage, no. Ruined nand content due to different settings, yes.
>
> Thank allwinner for changing its mind on how to configure its nand
> controller in the middle of the A20 lifetime, while having code in
> its nand driver that clears the ram if it finds garbage.
>
> Luc Verhaegen.

That makes sense. I tried dumping /dev/nand and got 8GB of 0xFF. In
addition to that, there's this message on boot:

[NAND] nand driver version: 0x2 0x9
Dev Sunxi softw311 nand magic does not match for MBR 1: 
...
Dev Sunxi softw311 nand header bad for all MBR copies, MBR corrupted
or not present.
 nand: unknown partition table
[NAND]nand driver, ok.

Last year I had this embedded system running on a 7" tablet. Now I'm
trying the same using a 9" one. Both are A20 and from the same
manufacturer. Actually the designs are quite similar, except for the
screen size and some small changes on the PCB. So I got the system I'm
currently setting up, changed its fex for the 7" one and gave it a try
on the smaller tablet. I got everything on screen by the first run...
Back to the 9" tablet, after changing back the fex file, and blank
screen again... I was thinking before that I could have stripped down
my kernel too much, and because of that the screen wasn't working, but
now I don't know what to think...

-- 
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] Kernel damaged device?

2016-08-21 Thread Leonardo
Hi. I'm using the fex I've extracted from its nand.

2016-08-21 2:05 GMT-03:00 Alexsey Shestacov :

> Noway, kernel it self cant do that, do you.unsing same *.fex file that
> before?
>
> воскресенье, 21 августа 2016 г. пользователь Leonardo написал:
>
>> Hi. I'm building a very minimal Linux distro to use as an embedded system
>> on a A20 tablet. I don't want to believe this, but I think that booting my
>> distro has damaged the device. The tablet came with Android. I had it
>> rooted so I could extract the fex file. Then I got kernel 3.4.104 and uboot
>> 2016.02 from GitHub, built my file system with buildroot and so on. I'm
>> using an SD card for now. So I tried booting my system and nothing came up
>> on the LCD. Then I remove my SD card, try to get back to Android and still
>> nothing on the screen! The device is not dead. I can access it using ssh
>> over the wifi, the usb port works fine. Basically I can do anything
>> remotely. At first I thought I might have damaged something on the PCB
>> while performing the tests, so I had a second tablet. Boot on Android,
>> display works fine. Boot on my distro, nothing on screen. Try to get back
>> to Android, and nothing on the screen again. By the way, the backlight
>> lights up as usual, so the display is not dead also. I've worked on a
>> similar project last year and had no problem like this at all. I have no
>> idea what went wrong. Is it possible that my kernel has damaged the device
>> somehow?
>>
>>

-- 
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] Kernel damaged device?

2016-08-21 Thread Leonardo
2016-08-21 6:58 GMT-03:00 Hans de Goede :

> Hi,
>
> On 21-08-16 04:26, Leonardo wrote:
>
>> Hi. I'm building a very minimal Linux distro to use as an embedded system
>> on a A20 tablet. I don't want to believe this, but I think that booting my
>> distro has damaged the device. The tablet came with Android. I had it
>> rooted so I could extract the fex file. Then I got kernel 3.4.104 and uboot
>> 2016.02 from GitHub, built my file system with buildroot and so on. I'm
>> using an SD card for now. So I tried booting my system and nothing came up
>> on the LCD. Then I remove my SD card, try to get back to Android and still
>> nothing on the screen! The device is not dead. I can access it using ssh
>> over the
>> wifi, the usb port works fine. Basically I can do anything remotely. At
>> first I thought I might have damaged something on the PCB while performing
>> the tests, so I had a second tablet. Boot on Android, display works fine.
>> Boot on my distro, nothing on screen. Try to get back to Android, and
>> nothing on the screen again. By the way, the backlight lights up as usual,
>> so the display is not dead also. I've worked on a similar project last year
>> and had no problem like this at all. I have no idea what went wrong. Is it
>> possible that my kernel has damaged the device somehow?
>>
>
> Try removing all power from the device to really get it in a clean hw
> state. You can force shutdown
> the device by keeping the power button pressed for 12+ seconds.
>
> Regards,
>
> Hans
>

Thank you for taking a shot, but no success so far. I'm not sure what
exactly happened, but now it won't turn on. I'll wait for the battery to
run out and try again tomorrow.

-- 
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] [PATCH v2 0/3] clk: sunxi-ng: Add the A83T clocks

2016-08-21 Thread Vishnu Patekar
Hello Jean-Francois Moine,

Thanks for followup patches for a83t modern clock.

well, this patch series does not apply on sunxi/for-next.



Regards,
Vishnu Pateakr

On Sun, Jun 12, 2016 at 1:39 AM, Jean-Francois Moine 
wrote:

> This patch series adds the clocks of the sunxi A83T in the "modern"
> clock framework proposed by Maxime Ripard.
> It applies on the V2 of his patch series.
>
> It is currently being tested on a Banana Pi M3 with the legacy u-boot.
> - working:
> mmc0
> mmc2 (eMMC) but slow clock
> ths
> uart0
> usb0
> - not working:
> mmc1 (wifi/bt)
> video (machine freeze on reading/writing the DE I/O memory)
> - not yet tested
> audio
> prcm
>
> Jean-Francois Moine (3):
>   clk: sunxi-ng: Add N-D-M-P-factor clock support
>   clk: sunxi-ng: Add the A83T clocks and resets
>   dt: sun8i: Define the clocks of the A83T
>
>  arch/arm/boot/dts/sun8i-a83t.dtsi  |  18 +-
>  drivers/clk/sunxi-ng/Makefile  |   3 +-
>  drivers/clk/sunxi-ng/ccu-sun8i-a83t.c  | 675
> +
>  drivers/clk/sunxi-ng/ccu_common.h  |   1 +
>  drivers/clk/sunxi-ng/ccu_ndmp.c| 239 
>  drivers/clk/sunxi-ng/ccu_ndmp.h|  96 +
>  include/dt-bindings/clock/sun8i-a83t.h | 150 
>  include/dt-bindings/reset/sun8i-a83t.h |  94 +
>  8 files changed, 1270 insertions(+), 6 deletions(-)
>  create mode 100644 drivers/clk/sunxi-ng/ccu-sun8i-a83t.c
>  create mode 100644 drivers/clk/sunxi-ng/ccu_ndmp.c
>  create mode 100644 drivers/clk/sunxi-ng/ccu_ndmp.h
>  create mode 100644 include/dt-bindings/clock/sun8i-a83t.h
>  create mode 100644 include/dt-bindings/reset/sun8i-a83t.h
>
> --
> 2.8.4
>
> --
> 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.
>

-- 
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] Kernel damaged device?

2016-08-21 Thread Luc Verhaegen
On Sat, Aug 20, 2016 at 07:26:46PM -0700, Leonardo wrote:
> Hi. I'm building a very minimal Linux distro to use as an embedded system 
> on a A20 tablet. I don't want to believe this, but I think that booting my 
> distro has damaged the device. The tablet came with Android. I had it 
> rooted so I could extract the fex file. Then I got kernel 3.4.104 and uboot 
> 2016.02 from GitHub, built my file system with buildroot and so on. I'm 
> using an SD card for now. So I tried booting my system and nothing came up 
> on the LCD. Then I remove my SD card, try to get back to Android and still 
> nothing on the screen! The device is not dead. I can access it using ssh 
> over the wifi, the usb port works fine. Basically I can do anything 
> remotely. At first I thought I might have damaged something on the PCB 
> while performing the tests, so I had a second tablet. Boot on Android, 
> display works fine. Boot on my distro, nothing on screen. Try to get back 
> to Android, and nothing on the screen again. By the way, the backlight 
> lights up as usual, so the display is not dead also. I've worked on a 
> similar project last year and had no problem like this at all. I have no 
> idea what went wrong. Is it possible that my kernel has damaged the device 
> somehow?

Damage, no. Ruined nand content due to different settings, yes.

Thank allwinner for changing its mind on how to configure its nand 
controller in the middle of the A20 lifetime, while having code in 
its nand driver that clears the ram if it finds garbage.

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


Re: [linux-sunxi] [PATCH 0/9] mfd: axp20x: Add support for AXP809 PMIC

2016-08-21 Thread Priit Laes
On Sun, 2016-08-21 at 10:11 +0800, Chen-Yu Tsai wrote:
> Hi everyone,
> 
> This series adds support for X-Powers' AXP806 PMIC. This is the
> secondary
> PMIC accompanying Allwinner's A80 SoC. For now, only the regulators
> are
> supported. While the AXP806 supports standalone operation, no
> hardware
> exists, so this will not be supported.

Title says AXP809, but in text and in subsequent patches there's also
806/809 confusion.

> 
> Patch 1 adds AXP806 to the axp20x bindings.
> 
> Patch 2 adds AXP806 support to the axp20x mfd driver.
> 
> Patch 3 fixes regulator output adjustment during regulator
> registration
> so it doesn't fail if the higher or lower bounds of its voltage
> constraints
> don't match up with the regulator's voltage granularity.
> 
> Patch 4 adds AXP806 support to the axp20x regulator driver.
> 
> Patch 5 adds the unused SW switch output of the AXP809 PMIC on the
> A80
> Optimus board. This was accidentally left out of the AXP809 series.
> 
> Patch 6 adds the unused SW switch output of the AXP809 PMIC on the
> Cubieboard 4. This was accidentally left out of the AXP809 series.
> 
> Patch 7 enables AXP809 support on the A80 Optimus board.
> 
> Patch 8 enables AXP809 support on the Cubieboard 4.
> 
> Patch 9 disables EHCI1 on the A80 Optimus board.
> 
> 
> Regards
> ChenYu
> 
> Chen-Yu Tsai (9):
>   mfd: axp20x: Add bindings for AXP806 PMIC
>   mfd: axp20x: Add support for AXP806 PMIC
>   regulator: core: Try full range when adjusting regulators to
> constraints
>   regulator: axp20x: support AXP806 variant
>   ARM: dts: sun9i: a80-optimus: Declare AXP809 SW regulator as unused
>   ARM: dts: sun9i: cubieboard4: Declare AXP809 SW regulator as unused
>   ARM: dts: sun9i: a80-optimus: Add AXP806 PMIC device node and
> regulators
>   ARM: dts: sun9i: cubieboard4: Add AXP806 PMIC device node and
> regulators
>   ARM: dts: sun9i: a80-optimus: Disable EHCI1
> 
>  Documentation/devicetree/bindings/mfd/axp20x.txt |  28 +-
>  arch/arm/boot/dts/sun9i-a80-cubieboard4.dts  | 116
> +
>  arch/arm/boot/dts/sun9i-a80-optimus.dts  | 123
> ++-
>  drivers/mfd/axp20x-rsb.c |   1 +
>  drivers/mfd/axp20x.c |  72 +
>  drivers/regulator/axp20x-regulator.c | 117
> +++--
>  drivers/regulator/core.c |   8 +-
>  include/linux/mfd/axp20x.h   |  60 +++
>  8 files changed, 508 insertions(+), 17 deletions(-)
> 
> -- 
> 2.9.3
> 

-- 
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.