zunq: add sdram driver

This commit is contained in:
cinap_lenrek 2018-06-14 21:54:42 +02:00
parent 4971db9e32
commit 0763dd4279
3 changed files with 8 additions and 4 deletions

View file

@ -60,7 +60,6 @@ enum
struct Confmem
{
uintptr base;
uintptr limit;
usize npage;
uintptr kbase;
uintptr klimit;
@ -70,7 +69,7 @@ struct Conf
{
ulong nmach; /* processors */
ulong nproc; /* processes */
Confmem mem[1]; /* physical memory */
Confmem mem[2]; /* physical memory */
ulong npage; /* total physical pages of memory */
usize upages; /* user page pool */
ulong copymode; /* 0 is copy on write, 1 is copy on reference */

View file

@ -177,10 +177,14 @@ confinit(void)
conf.ialloc = 16*1024*1024;
conf.nimage = 200;
conf.mem[0].base = PGROUND((ulong)end - KZERO);
conf.mem[0].limit = 1024*1024*1024;
conf.mem[0].npage = (1024*1024*1024 - conf.mem[0].base) >> PGSHIFT;
ramdiskinit();
conf.npage = 0;
for(i = 0; i < nelem(conf.mem); i++)
conf.npage += conf.mem[i].npage = (conf.mem[i].limit - conf.mem[i].base) >> PGSHIFT;
conf.npage += conf.mem[i].npage;
kmem = 200*1024*1024;
conf.upages = conf.npage - kmem/BY2PG;
kmem -= conf.upages*sizeof(Page)

View file

@ -34,6 +34,7 @@ link
misc
uartzynq
sdmmc emmc
sdram
ip
tcp