[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Re: NextThing C.H.I.P. v1.0 - Debian Stretch Installer from USB



On Tue, May 26, 2020 at 11:09:34AM -0700, Vagrant Cascadian wrote:

> >> > 2.) If you want vanilla Debian I am willing to help you. 
> >> > Most of what I know and did is summarized in this thread:
> >> > https://lists.phcomp.co.uk/pipermail/arm-netbook/2017-August/014646.html
> >
> > I have made major progress yesterday and managed to install mainline
> > U-Boot to CHIPs builtin NAND so all quirks concerning the boot process
> > mentioned in this thread are no longer relevant. 
> 
> How did you flash it? 

After multiple failed attempts to extract some useful knowledge out of
NextThings bash scripts called CHIP-tools I finally found this blog post
(http://hulifox008.github.io/2018/07/17/chip-build.html) quite helpful
and straightforward.

So here is what I did:

I had a copy of NextThings version of U-boot on my computer but a 'git clone http://chip.jfpossibilities.com/gits/CHIP-u-boot.git' should do the trick (this is an archived version of NextThings U-boot)
In NextThings U-Boot directory:
'git checkout c2d284fbba74083eed8ae853a10f665f6febfdf1'

Then build like in the blog post of hulifox008. But there is a major
pitfall. My chip has a different NAND OOB_Size so I used
'SUNXI_NAND_OOB_SIZE=1664' There are Chips with two types of NAND so
maybe this is the explanation.
We need u-boot-sunxi-with-spl.bin and sunxi-spl-with-ecc.bin (from dir
spl/) 
This is a U-boot version that can interact with the builtin NAND:

'sunxi-fel uboot u-boot-sunxi-with-spl.bin write 0x43000000
sunxi-spl-with-ecc.bin'

Once at the U-Boot command line one can run 'nand info' to get oobsize
and pagesize.
For my type of NAND the write size is 0xc6
so:
'nand erase.chip'
'nand write.raw.noverify 0x430000000 0x0 0xc6'

Do a 'reset' to get Chip into fel mode again (not very elegant, to do it
in two steps, but it works)

Flash mainline u-boot to NAND:
So again take U-boot-sunxi-with-spl.bin from NextThings U-Boot git but
u-boot-dtb.bin from *Mainline* U-Boot (I used an old build from 2017 but
hopefully current Mainline or Debians versions work straightaway)

'sunxi-fel uboot u-boot-sunxi-with-spl.bin write 0x43000000
u-boot-dtb.bin'

and finally at the U-Boot command line:
'nand erase.spread 0x800000 0x400000' 
'nand write 0x43000000 0x800000 0x400000'

> Is there anything needed different from what's in the packaged in
> u-boot-sunxi? Did you need any patches or configuration changes?

So like written above I used u-boot-sunxi-with-spl.bin form NextThings
patched U-Boot sources to flash and sunxi-spl-with-ecc.bin is written to
NAND.
>From Mainline U-Boot I used a version without spl which is afaik not
part of u-boot-sunxi.

> 
> I've considered dropping it from u-boot-sunxi's debian package as it
> seemed there wasn't much of a future for the platform and it only worked
> with sunxi-fel, but sounds like I should instead take a look at it
> again.

I appreciate if you or others with the hardware could test and give
feedback if it works. (Please keep good backups of your NAND if data on
NAND matters to you as 'nand erase.chip' erases everything and I have
not tested the partial erase command)

kind regards
Pablo



Reply to: