On Sun, 18 Jan 2015 08:43:46 -0800 (PST)
Toroshin Dmitry <mitt...@sibmail.com> wrote:

> Meminfo works strange on lichee kernel: on first boot zq is 0x7f, but after 
> standby it is 0x12b73b7f

This is fishy, but I don't think that we support lichee kernels here.
Having bugs there is not surprising, maybe this can be reported to
Allwinner?

> I added this fucntion to meminfo utility to get full dram register dump on 
> a20:
> 
> static int
>  sun4i_dram_regs_print(void)
>  {
>      void *base;
>         base = mmap(NULL, SUN4I_IO_DRAM_SIZE, PROT_READ,
>                     MAP_SHARED, devmem_fd, SUN4I_IO_DRAM_BASE);
>         if (base == MAP_FAILED) {
>                 fprintf(stderr, "Failed to map dram registers: %s\n",
>                         strerror(errno));
>                 return errno;
>         }
> 
>      unsigned int i=0;
>     for(i=0;i<SUN4I_IO_DRAM_SIZE;i+=4)
>     {
>         if(!(i%16)) printf("\n0x%08x ", i);
>         printf("%08x ",sunxi_io_read(base,i));
>     }
>  }
> 
> Differences in dump before standby:
> diff meminfo_sunxi1 meminfo-aw1

[...]

> And this is after standby:
> diff meminfo_sunxi2 meminfo-aw2

[...]

> Some registers has changed after reboot to lichee kernel and back to sunxi:
> 
> diff meminfo_sunxi1 meminfo_sunxi2

[...]

Sorry, the logs were not very readable with that formatting and
non-unified diffs. Are you worried about some specific register(s)?

> What is wrong?

The differences in DRAM controller registers between the mainline
u-boot and Allwinner's boot0 do not necessarily mean that something
is wrong.

The boot0 bootloader has evolved over time. And u-boot-sunxi has used
a very old boot0 version as a reference. They have parted ways since
a long time ago.

> What does mean zq value?

You can find everything that we know about the A10/A13/A20 DRAM
controller in the linux-sunxi wiki:
    http://linux-sunxi.org/A10_DRAM_Controller_Register_Guide
    http://linux-sunxi.org/A10_DRAM_Controller_Calibration

I believe that you should find all the answers there. If something
is not quite clear, I will be glad to update these pages.

> And why tpr values are different between kernels?

These values are initially set in the bootloaders. Yes, and the kernel
is also involved when waking up. But only the Allwinner's android
kernel, since the mainline kernel and sunxi-3.4 do not really support
suspend yet.

I believe that nowadays we are doing a better job configuring DRAM
on A10/A13/A20 than Allwinner. At least code-wise and when the settings
in the 'dram_para' struct are selected optimally (the settings are
currently a pile of junk though).

-- 
Best regards,
Siarhei Siamashka

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

Reply via email to