]> git.sur5r.net Git - u-boot/blobdiff - board/freescale/common/ngpixis.h
Merge branch 'u-boot-samsung/master' into 'u-boot-arm/master'
[u-boot] / board / freescale / common / ngpixis.h
index 3c59ea80283c26a431adb665a67aee0a1ebcef83..364e74954ebe4693ca83352195499c0665013964 100644 (file)
@@ -1,11 +1,8 @@
 /**
- * Copyright 2010 Freescale Semiconductor
+ * Copyright 2010-2011 Freescale Semiconductor
  * Author: Timur Tabi <timur@freescale.com>
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
+ * SPDX-License-Identifier:    GPL-2.0+
  *
  * This file provides support for the ngPIXIS, a board-specific FPGA used on
  * some Freescale reference boards.
@@ -20,16 +17,17 @@ typedef struct ngpixis {
        u8 scver;
        u8 csr;
        u8 rst;
-       u8 res1;
+       u8 serclk;
        u8 aux;
        u8 spd;
        u8 brdcfg0;
        u8 brdcfg1;     /* On some boards, this register is called 'dma' */
        u8 addr;
-       u8 res2[2];
+       u8 brdcfg2;
+       u8 gpiodir;
        u8 data;
        u8 led;
-       u8 res3;
+       u8 tag;
        u8 vctl;
        u8 vstat;
        u8 vcfgen0;
@@ -44,8 +42,8 @@ typedef struct ngpixis {
        struct {
                u8 sw;
                u8 en;
-       } s[8];
-} ngpixis_t  __attribute__ ((aligned(1)));
+       } s[9];         /* s[0]..s[7] is SW1..SW8, and s[8] is SW11 */
+} __attribute__ ((packed)) ngpixis_t;
 
 /* Pointer to the PIXIS register set */
 #define pixis ((ngpixis_t *)PIXIS_BASE)
@@ -55,3 +53,9 @@ typedef struct ngpixis {
 
 /* The PIXIS EN register that corresponds to board switch X, where x >= 1 */
 #define PIXIS_EN(x)            (pixis->s[(x) - 1].en)
+
+u8 pixis_read(unsigned int reg);
+void pixis_write(unsigned int reg, u8 value);
+
+#define PIXIS_READ(reg) pixis_read(offsetof(ngpixis_t, reg))
+#define PIXIS_WRITE(reg, value) pixis_write(offsetof(ngpixis_t, reg), value)