Hi,

I've created a trivial PR for adding SPI flash support for A10 :
https://github.com/linux-sunxi/sunxi-tools/pull/138
It seems that nothing more was needed, just adding the ID to the supported
list.

Thanks!

On Fri, Sep 11, 2020 at 6:39 PM Adrian N <[email protected]> wrote:

> That was an awesome tip Gediz!
> I added the line:
>    case 0x1623: /* Allwinner A10 */
> right before this line:
> https://github.com/linux-sunxi/sunxi-tools/blob/7fe6024211ffed3024b0491ee9f2a19c17848c12/fel-spiflash.c#L163
> because it seems A10 is actually more similar to A20 in terms of booting
> from spi flash than A13 (line 154 that you suggested).
> I tried both variants, but it worked only after adding before line 163.
> So now spiflash-info command succeeds and tells me it's a Macronix 16 MB
> flash.
> I was able to dump it, and then running strings command on it yielded some
> very interesting strings:
> eGON.BT0
> sunxi-cubieboarda10
> sunxi SPI
> U-Boot SPL 2019.10 (Oct 15 2019 - 20:11:30 +0800)
> U-Boot 2017.01-rc2-00098-gc88edf
> bootcmd=sf probe 0; sf read 0x41000000 0x80000 0x400000; bootz 0x41000000
> bootdelay=0
> baudrate=115200
> arch=arm
> cpu=armv7
> board=sunxi
> board_name=sunxi
> soc=sunxi
> stdin=serial
> stdout=serial
> stderr=serial
> bootm_size=0xa000000
> kernel_addr_r=0x42000000
> fdt_addr_r=0x43000000
> scriptaddr=0x43100000
> pxefile_addr_r=0x43200000
> ramdisk_addr_r=0x43300000
> dfu_alt_info_ram=kernel ram 0x42000000 0x1000000;fdt ram 0x43000000
> 0x100000;ramdisk ram 0x43300000 0x4000000
> fdtfile=sun4i-a10-cubieboard.dtb
> console=ttyS0,115200
> boot_prefixes=/ /boot/
> boot_scripts=boot.scr.uimg boot.scr
> boot_script_dhcp=boot.scr.uimg
> boot_targets=fel
>
> This list is only partial. I'm not going to put here the full list because
> it is very long. I also cannot post publicly the contents of the SPI flash
> for obvious reasons.
>
> My goal is now to extract some useful config info from this dump to be
> able to re-create from scratch a fully open-source and very small firmware
> based on linux by following the steps from
> https://linux-sunxi.org/New_Device_howto
>
> The biggest problems are the flash and SDRAM of this device are very
> limited: 16MB flash, 128 MBytes DDR2 RAM (based on the ELIXIR N2TU1G16GG-AC
> label on the chip). Is that too little ?
>
> Btw, it would be good to add that one-line patch to git master. I'll make
> a PR next week.
>
> I also found 3 unmarked round pads that might be the serial console, but I
> cannot confirm that yet.
>
> Thanks a lot!
>
> On Fri, Sep 11, 2020 at 1:05 PM Nazım Gediz AYDINDOĞMUŞ <
> [email protected]> wrote:
>
>> On 10.09.2020 13:02, Adrian N wrote:
>> >   Hi Gediz,
>> >
>> > I followed the wiki, checked out from git repo, installed required deps
>> > and built sunxi tools successfully. Then I was able to put the device
>> in
>> > FEL mode by keeping the button pressed when plugging the usb.
>> > This is the output I get from running sudo ./sunxi-fel version
>> > AWUSBFEX soc=00001623(A10) 00000001 ver=0001 44 08 scratchpad=00007e00
>> > 00000000 00000000
>>
>> That's good news.
>>
>> > But attempts to read anything from it are failing with time out.
>> >    sudo ./sunxi-fel read 0x42400000 0x82d0 boot1.header
>> >    sudo ./sunxi-fel read 0x43000000 0x20000 script.bin
>> >
>> > The exact error message is: usb_bulk_send() ERROR -7: Operation timed
>> out
>> >
>> > What could be the cause of this ?
>>
>> Memory space for A10 (sun4i) starts from 0x40000000 according to the
>> memory map (http://linux-sunxi.org/Memory_map). 0x42400000 and
>> 0x43000000 are in the range of the general memory space so this is an
>> attempt to reach the DRAM. If DRAM memory controller is not initialized
>> yet, trying to access to the mentioned addresses may fail. You may
>> consider using "sunxi-fel spl" or "sunxi-fel uboot" commands and
>> initialize the DRAM first. But you would need an SPL (sunxi-spl.bin) or
>> U-Boot (u-boot-sunxi-with) file, produced by U-Boot. Further information
>> can be found on the help output of the sunxi-fel tool.
>>
>>
>> On 10.09.2020 15:09, Adrian N wrote:
>> > I only noticed now Gediz that you mentioned 'spiflash-read', not
>> 'read'.
>> > So I tried again. No luck.
>> >
>> > sudo ./sunxi-fel spiflash-info
>> >
>> > says:
>> >
>> > SPI support not implemented yet for 1623 (A10)!
>> >
>> > So what are the options now?
>>
>> It's really interesting because as far as I know, SPI flash controller
>> of A10, A13 and A20 are too much similar if not completely same and
>> apparently A13 and A20 are supported by sunxi-fel. I did not work with
>> any board that is powered by A10 before but the first thing I'd do is a
>> dirty hack: adding 0x1623 to the list of the supported devices (in here
>>
>> https://github.com/linux-sunxi/sunxi-tools/blob/7fe6024211ffed3024b0491ee9f2a19c17848c12/fel-spiflash.c#L154)
>>
>> and see the result. I really have no other idea.
>>
>> On 10.09.2020 15:36, Adrian N wrote:
>> > But, maybe the timeout is caused by the device not really having that
>> > much memory.
>> > So I tried with a lower address, sudo ./sunxi-fel read 0x0 0x90000
>> > xxxx.bin and it did work
>>
>> According to the memory map, again, SRAM (on-chip RAM which does not
>> require an external init routine) starts from address 0x0 and goes until
>> 0x0002ffff. But 0x90000 exceeds even after the Bank B of the SRAM so
>> 0x90000 is probably not a valid address. So "xxxx.bin" is partly the
>> contents of the SRAM, and remaining part is most likely zero filled.
>>
>

-- 
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 [email protected].
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/CAAuDtmd6MA_bHueDPDPuWX4iRdwTXE0QNxybh4q%2ByS37vtVuEA%40mail.gmail.com.

Reply via email to