zunq: add sdram driver
This commit is contained in:
parent
4971db9e32
commit
0763dd4279
3 changed files with 8 additions and 4 deletions
|
@ -60,7 +60,6 @@ enum
|
||||||
struct Confmem
|
struct Confmem
|
||||||
{
|
{
|
||||||
uintptr base;
|
uintptr base;
|
||||||
uintptr limit;
|
|
||||||
usize npage;
|
usize npage;
|
||||||
uintptr kbase;
|
uintptr kbase;
|
||||||
uintptr klimit;
|
uintptr klimit;
|
||||||
|
@ -70,7 +69,7 @@ struct Conf
|
||||||
{
|
{
|
||||||
ulong nmach; /* processors */
|
ulong nmach; /* processors */
|
||||||
ulong nproc; /* processes */
|
ulong nproc; /* processes */
|
||||||
Confmem mem[1]; /* physical memory */
|
Confmem mem[2]; /* physical memory */
|
||||||
ulong npage; /* total physical pages of memory */
|
ulong npage; /* total physical pages of memory */
|
||||||
usize upages; /* user page pool */
|
usize upages; /* user page pool */
|
||||||
ulong copymode; /* 0 is copy on write, 1 is copy on reference */
|
ulong copymode; /* 0 is copy on write, 1 is copy on reference */
|
||||||
|
|
|
@ -177,10 +177,14 @@ confinit(void)
|
||||||
conf.ialloc = 16*1024*1024;
|
conf.ialloc = 16*1024*1024;
|
||||||
conf.nimage = 200;
|
conf.nimage = 200;
|
||||||
conf.mem[0].base = PGROUND((ulong)end - KZERO);
|
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;
|
conf.npage = 0;
|
||||||
for(i = 0; i < nelem(conf.mem); i++)
|
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;
|
kmem = 200*1024*1024;
|
||||||
conf.upages = conf.npage - kmem/BY2PG;
|
conf.upages = conf.npage - kmem/BY2PG;
|
||||||
kmem -= conf.upages*sizeof(Page)
|
kmem -= conf.upages*sizeof(Page)
|
||||||
|
|
|
@ -34,6 +34,7 @@ link
|
||||||
misc
|
misc
|
||||||
uartzynq
|
uartzynq
|
||||||
sdmmc emmc
|
sdmmc emmc
|
||||||
|
sdram
|
||||||
|
|
||||||
ip
|
ip
|
||||||
tcp
|
tcp
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue