linux/include/linux/mtd/pfow.h

/* SPDX-License-Identifier: GPL-2.0 */
/* Primary function overlay window definitions
 * and service functions used by LPDDR chips
 */
#ifndef __LINUX_MTD_PFOW_H
#define __LINUX_MTD_PFOW_H

#include <linux/mtd/qinfo.h>

/* PFOW registers addressing */
/* Address of symbol "P" */
#define PFOW_QUERY_STRING_P
/* Address of symbol "F" */
#define PFOW_QUERY_STRING_F
/* Address of symbol "O" */
#define PFOW_QUERY_STRING_O
/* Address of symbol "W" */
#define PFOW_QUERY_STRING_W
/* Identification info for LPDDR chip */
#define PFOW_MANUFACTURER_ID
#define PFOW_DEVICE_ID
/* Address in PFOW where prog buffer can be found */
#define PFOW_PROGRAM_BUFFER_OFFSET
/* Size of program buffer in words */
#define PFOW_PROGRAM_BUFFER_SIZE
/* Address command code register */
#define PFOW_COMMAND_CODE
/* command data register */
#define PFOW_COMMAND_DATA
/* command address register lower address bits */
#define PFOW_COMMAND_ADDRESS_L
/* command address register upper address bits */
#define PFOW_COMMAND_ADDRESS_H
/* number of bytes to be proggrammed lower address bits */
#define PFOW_DATA_COUNT_L
/* number of bytes to be proggrammed higher address bits */
#define PFOW_DATA_COUNT_H
/* command execution register, the only possible value is 0x01 */
#define PFOW_COMMAND_EXECUTE
/* 0x01 should be written at this address to clear buffer */
#define PFOW_CLEAR_PROGRAM_BUFFER
/* device program/erase suspend register */
#define PFOW_PROGRAM_ERASE_SUSPEND
/* device status register */
#define PFOW_DSR

/* LPDDR memory device command codes */
/* They are possible values of PFOW command code register */
#define LPDDR_WORD_PROGRAM
#define LPDDR_BUFF_PROGRAM
#define LPDDR_BLOCK_ERASE
#define LPDDR_LOCK_BLOCK
#define LPDDR_UNLOCK_BLOCK
#define LPDDR_READ_BLOCK_LOCK_STATUS
#define LPDDR_INFO_QUERY
#define LPDDR_READ_OTP
#define LPDDR_PROG_OTP
#define LPDDR_RESUME

/* Defines possible value of PFOW command execution register */
#define LPDDR_START_EXECUTION

/* Defines possible value of PFOW program/erase suspend register */
#define LPDDR_SUSPEND

/* Possible values of PFOW device status register */
/* access R - read; RC read & clearable */
#define DSR_DPS
#define DSR_PSS
#define DSR_VPPS
#define DSR_PROGRAM_STATUS
#define DSR_ERASE_STATUS
#define DSR_ESS
#define DSR_READY_STATUS
#define DSR_RPS
#define DSR_AOS
#define DSR_AVAILABLE

/* The superset of all possible error bits in DSR */
#define DSR_ERR

static inline void send_pfow_command(struct map_info *map,
				unsigned long cmd_code, unsigned long adr,
				unsigned long len, map_word *datum)
{}
#endif /* __LINUX_MTD_PFOW_H */