]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/9/bcm/dat.h
merge
[plan9front.git] / sys / src / 9 / bcm / dat.h
index 56a5383ec915643488147e0533fc430a7d41cd48..0c4f7351f234daae7a727d8ac05be9dbab9adbb4 100644 (file)
@@ -15,18 +15,19 @@ enum {
 typedef struct Conf    Conf;
 typedef struct Confmem Confmem;
 typedef struct FPsave  FPsave;
+typedef struct PFPU    PFPU;
 typedef struct ISAConf ISAConf;
 typedef struct Label   Label;
 typedef struct Lock    Lock;
 typedef struct Memcache        Memcache;
 typedef struct MMMU    MMMU;
 typedef struct Mach    Mach;
-typedef struct Notsave Notsave;
 typedef struct Page    Page;
 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;
@@ -56,14 +57,14 @@ struct Label
        uintptr pc;
 };
 
+/*
+ * emulated or vfp3 floating point
+ */
 enum {
        Maxfpregs       = 32,   /* could be 16 or 32, see Mach.fpnregs */
        Nfpctlregs      = 16,
 };
 
-/*
- * emulated or vfp3 floating point
- */
 struct FPsave
 {
        ulong   status;
@@ -78,9 +79,12 @@ struct FPsave
        uintptr pc;             /* of failed fp instr. */
 };
 
-/*
- * FPsave.fpstate
- */
+struct PFPU
+{
+       int     fpstate;
+       FPsave  fpsave[1];
+};
+
 enum
 {
        FPinit,
@@ -119,13 +123,6 @@ struct Conf
        int     monitor;        /* flag */
 };
 
-/*
- *  things saved in the Proc structure during a notify
- */
-struct Notsave {
-       int     emptiness;
-};
-
 /*
  *  MMU stuff in Mach.
  */
@@ -218,11 +215,10 @@ 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
 {
-       Lock;
        char    machs[MAXMACH];         /* active CPUs */
        int     exiting;                /* shutdown */
 }active;
@@ -231,7 +227,6 @@ extern register Mach* m;                    /* R10 */
 extern register Proc* up;                      /* R9 */
 extern uintptr kseg0;
 extern Mach* machaddr[MAXMACH];
-extern ulong memsize;
 extern int normalprint;
 
 /*
@@ -284,3 +279,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,
+};