ref: 0763dd42793dea2023e0f345f647af9932486841
parent: 4971db9e32dadf72dff6df6293774df2a4f57a89
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Thu Jun 14 17:54:42 EDT 2018
zunq: add sdram driver
--- a/sys/src/9/zynq/dat.h
+++ b/sys/src/9/zynq/dat.h
@@ -60,7 +60,6 @@
struct Confmem
{
uintptr base;
- uintptr limit;
usize npage;
uintptr kbase;
uintptr klimit;
@@ -70,7 +69,7 @@
{
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 */
--- a/sys/src/9/zynq/main.c
+++ b/sys/src/9/zynq/main.c
@@ -177,10 +177,14 @@
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)
--- a/sys/src/9/zynq/zynq
+++ b/sys/src/9/zynq/zynq
@@ -34,6 +34,7 @@
misc
uartzynq
sdmmc emmc
+ sdram
ip
tcp