]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/9/bcm/dat.h
ether8169: support rtl8402 variant
[plan9front.git] / sys / src / 9 / bcm / dat.h
index 20cbf3880253b8b8b960be68fa343f08c5b4caa4..dec4e58609e615b8583b8c317b1e87f1a5dd5361 100644 (file)
@@ -27,6 +27,7 @@ typedef struct PhysUart       PhysUart;
 typedef struct PMMU    PMMU;
 typedef struct Proc    Proc;
 typedef u32int         PTE;
+typedef struct Soc     Soc;
 typedef struct Uart    Uart;
 typedef struct Ureg    Ureg;
 typedef uvlong         Tval;
@@ -98,7 +99,7 @@ enum
 struct Confmem
 {
        uintptr base;
-       usize   npage;
+       ulong   npage;
        uintptr limit;
        uintptr kbase;
        uintptr klimit;
@@ -110,7 +111,7 @@ struct Conf
        ulong   nproc;          /* processes */
        Confmem mem[1];         /* physical memory */
        ulong   npage;          /* total physical pages of memory */
-       usize   upages;         /* user page pool */
+       ulong   upages;         /* user page pool */
        ulong   copymode;       /* 0 is copy on write, 1 is copy on reference */
        ulong   ialloc;         /* max interrupt time allocation in bytes */
        ulong   pipeqsize;      /* size in bytes of pipe queues */
@@ -149,42 +150,17 @@ struct Mach
 {
        int     machno;                 /* physical id of processor */
        uintptr splpc;                  /* pc of last caller to splhi */
-
-       Proc*   proc;                   /* current process */
+       Proc*   proc;                   /* current process on this processor */
 
        MMMU;
-       int     flushmmu;               /* flush current proc mmu state */
-
-       ulong   ticks;                  /* of the clock since boot time */
-       Label   sched;                  /* scheduler wakeup */
-       Lock    alarmlock;              /* access to alarm list */
-       void*   alarm;                  /* alarms bound to this clock */
+       /* end of offsets known to asm */
 
-       Proc*   readied;                /* for runproc */
-       ulong   schedticks;             /* next forced context switch */
+       PMach;
 
        int     cputype;
        ulong   delayloop;
-
-       /* stats */
-       int     tlbfault;
-       int     tlbpurge;
-       int     pfault;
-       int     cs;
-       int     syscall;
-       int     load;
-       int     intr;
-       uvlong  fastclock;              /* last sampled value */
-       uvlong  inidle;                 /* time spent in idlehands() */
-       ulong   spuriousintr;
-       int     lastintr;
-       int     ilockdepth;
-       Perf    perf;                   /* performance counters */
-
-
        int     cpumhz;
        uvlong  cpuhz;                  /* speed of cpu */
-       uvlong  cyclefreq;              /* Frequency of user readable cycle counter */
 
        /* vfp2 or vfp3 fpu */
        int     havefp;
@@ -205,7 +181,7 @@ struct Mach
        u32int  smon[5];                /* probably not needed */
        u32int  ssys[5];
 
-       int     stack[1];
+       uintptr stack[1];
 };
 
 /*
@@ -214,7 +190,7 @@ struct Mach
 typedef void           KMap;
 #define        VA(k)           ((uintptr)(k))
 #define        kmap(p)         (KMap*)((p)->pa|kseg0)
-#define        kunmap(k)
+extern void kunmap(KMap*);
 
 struct
 {
@@ -226,7 +202,6 @@ extern register Mach* m;                    /* R10 */
 extern register Proc* up;                      /* R9 */
 extern uintptr kseg0;
 extern Mach* machaddr[MAXMACH];
-extern ulong memsize;
 extern int normalprint;
 
 /*
@@ -279,3 +254,29 @@ struct DevConf
        Devport *ports;                 /* The ports themselves */
 };
 
+struct Soc {                   /* SoC dependent configuration */
+       ulong   dramsize;
+       ulong   iosize;
+       uintptr busdram;
+       uintptr busio;
+       uintptr physio;
+       uintptr virtio;
+       uintptr armlocal;
+       u32int  l1ptedramattrs;
+       u32int  l2ptedramattrs;
+};
+extern Soc soc;
+
+/*
+ * GPIO
+ */
+enum {
+       Input   = 0x0,
+       Output  = 0x1,
+       Alt0    = 0x4,
+       Alt1    = 0x5,
+       Alt2    = 0x6,
+       Alt3    = 0x7,
+       Alt4    = 0x3,
+       Alt5    = 0x2,
+};