#include <linux/export.h>
#include <linux/of_device.h>
#include <linux/mtd/map.h>
#include <linux/mtd/xip.h>
#include <linux/mfd/syscon.h>
#include <linux/regmap.h>
#include <linux/bitops.h>
#include <linux/pinctrl/consumer.h>
#include "physmap-gemini.h"
#define GLOBAL_STATUS 0x04
#define FLASH_TYPE_MASK (0x3 << 24)
#define FLASH_TYPE_NAND_2K (0x3 << 24)
#define FLASH_TYPE_NAND_512 (0x2 << 24)
#define FLASH_TYPE_PARALLEL (0x1 << 24)
#define FLASH_TYPE_SERIAL (0x0 << 24)
#define FLASH_WIDTH_16BIT (1 << 23)
#define FLASH_ATMEL (1 << 23)
#define FLASH_SIZE_MASK (0x3 << 21)
#define NAND_256M (0x3 << 21)
#define NAND_128M (0x2 << 21)
#define NAND_64M (0x1 << 21)
#define NAND_32M (0x0 << 21)
#define ATMEL_16M (0x3 << 21)
#define ATMEL_8M (0x2 << 21)
#define ATMEL_4M_2M (0x1 << 21)
#define ATMEL_1M (0x0 << 21)
#define STM_32M (1 << 22)
#define STM_16M (0 << 22)
#define FLASH_PARALLEL_HIGH_PIN_CNT (1 << 20)
static const struct of_device_id syscon_match[] = {
{ .compatible = "cortina,gemini-syscon" },
struct pinctrl_state *enabled_state;
struct pinctrl_state *disabled_state;
static struct gemini_flash *gf;