SPDX: Convert all of our single license tags to Linux Kernel style
[platform/kernel/u-boot.git] / board / freescale / common / qixis.h
index 8d914d5..c11062e 100644 (file)
@@ -1,12 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Copyright 2011 Freescale Semiconductor
  * Author: Shengzhou Liu <Shengzhou.Liu@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.
- *
  * This file provides support for the QIXIS of some Freescale reference boards.
  */
 
@@ -78,7 +74,13 @@ struct qixis {
        u8 trig_stat;
        u8 res12[3];
        u8 trig_ctr[4];
-       u8 res13[48];
+       u8 res13[16];
+       u8 clk_freq[6]; /* Clock Measurement Registers */
+       u8 res_c6[8];
+       u8 clk_base[2]; /* Clock Frequency Base Reg */
+       u8 res_d0[8];
+       u8 cms[2];      /* Core Management Space Address Register, 0xD8 */
+       u8 res_c0[6];
        u8 aux2[4];     /* Auxiliary Registers,0xE0 */
        u8 res14[10];
        u8 aux_ad;
@@ -97,12 +99,38 @@ u8 qixis_read_i2c(unsigned int reg);
 void qixis_write_i2c(unsigned int reg, u8 value);
 #endif
 
+#if defined(CONFIG_QIXIS_I2C_ACCESS) && defined(CONFIG_SYS_I2C_FPGA_ADDR)
+#define QIXIS_READ(reg) qixis_read_i2c(offsetof(struct qixis, reg))
+#define QIXIS_WRITE(reg, value) \
+       qixis_write_i2c(offsetof(struct qixis, reg), value)
+#else
 #define QIXIS_READ(reg) qixis_read(offsetof(struct qixis, reg))
 #define QIXIS_WRITE(reg, value) qixis_write(offsetof(struct qixis, reg), value)
+#endif
+
 #ifdef CONFIG_SYS_I2C_FPGA_ADDR
 #define QIXIS_READ_I2C(reg) qixis_read_i2c(offsetof(struct qixis, reg))
 #define QIXIS_WRITE_I2C(reg, value) \
                        qixis_write_i2c(offsetof(struct qixis, reg), value)
 #endif
 
+/* Use for SDHC adapter card type identification and operation */
+#ifdef CONFIG_FSL_ESDHC_ADAPTER_IDENT
+#define QIXIS_SDID_MASK                         0x07
+#define QIXIS_ESDHC_ADAPTER_TYPE_EMMC45         0x1    /* eMMC Card Rev4.5 */
+#define QIXIS_ESDHC_ADAPTER_TYPE_SDMMC_LEGACY   0x2    /* SD/MMC Legacy Card */
+#define QIXIS_ESDHC_ADAPTER_TYPE_EMMC44         0x3    /* eMMC Card Rev4.4 */
+#define QIXIS_ESDHC_ADAPTER_TYPE_RSV            0x4    /* Reserved */
+#define QIXIS_ESDHC_ADAPTER_TYPE_MMC            0x5    /* MMC Card */
+#define QIXIS_ESDHC_ADAPTER_TYPE_SD             0x6    /* SD Card Rev2.0 3.0 */
+#define QIXIS_ESDHC_NO_ADAPTER                  0x7    /* No Card is Present*/
+
+#define QIXIS_SDCLKIN          0x08
+#define QIXIS_SDCLKOUT         0x02
+#define QIXIS_DAT5_6_7         0X02
+#define QIXIS_DAT4             0X01
+
+#define QIXIS_EVDD_BY_SDHC_VS  0x0c
+#endif
+
 #endif