Commit 8e404fff authored by Arve Hjønnevåg's avatar Arve Hjønnevåg Committed by Greg Kroah-Hartman

goldfish: NAND flash driver

Fold together the NAND driver for Goldfish from Arve with cleanups by
Jun Nakajima and a tidy up to 3.7 and checkpatch.

This provides a virtual flash driver for the Goldfish Android Virtual Platform,
and which is normally used as the root file system when testing emulated
devices.
Signed-off-by: default avatarMike A. Chan <mikechan@google.com>
Signed-off-by: default avatarArve Hjønnevåg <arve@android.com>
[Ported to handle x86]
Signed-off-by: default avatarSheng Yang <sheng@linux.intel.com>
Signed-off-by: default avatarYunhong Jiang <yunhong.jiang@intel.com>
Signed-off-by: default avatarXiaohui Xin <xiaohui.xin@intel.com>
Signed-off-by: default avatarJun Nakajima <jun.nakajima@intel.com>
Signed-off-by: default avatarBruce Beare <bruce.j.beare@intel.com>
[Ported to 3.4]
Signed-off-by: default avatarTom Keel <thomas.keel@intel.com>
[Ported to 3.7 and tided for checkpatch etc]
Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2e82b83d
...@@ -4,3 +4,9 @@ config GOLDFISH_AUDIO ...@@ -4,3 +4,9 @@ config GOLDFISH_AUDIO
---help--- ---help---
Emulated audio channel for the Goldfish Android Virtual Device Emulated audio channel for the Goldfish Android Virtual Device
config MTD_GOLDFISH_NAND
tristate "Goldfish NAND device"
depends on GOLDFISH
help
Drives the emulated NAND flash device on the Google Goldfish
Android virtual device.
...@@ -3,3 +3,4 @@ ...@@ -3,3 +3,4 @@
# #
obj-$(CONFIG_GOLDFISH_AUDIO) += goldfish_audio.o obj-$(CONFIG_GOLDFISH_AUDIO) += goldfish_audio.o
obj-$(CONFIG_MTD_GOLDFISH_NAND) += goldfish_nand.o
Audio
-----
- Move to using the ALSA framework not faking it - Move to using the ALSA framework not faking it
- Fix the wrong user page DMA (moving to ALSA may fix that too) - Fix the wrong user page DMA (moving to ALSA may fix that too)
NAND
----
- Switch from spinlock to mutex
- Remove excess checking of parameters in calls
- Use dma coherent memory not kmalloc/__pa for the memory (this is just
a cleanliness issue not a correctness one)
This diff is collapsed.
/* drivers/mtd/devices/goldfish_nand_reg.h
**
** Copyright (C) 2007 Google, Inc.
**
** This software is licensed under the terms of the GNU General Public
** License version 2, as published by the Free Software Foundation, and
** may be copied, distributed, and modified under those terms.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
*/
#ifndef GOLDFISH_NAND_REG_H
#define GOLDFISH_NAND_REG_H
enum nand_cmd {
NAND_CMD_GET_DEV_NAME, /* Write device name for NAND_DEV to NAND_DATA (vaddr) */
NAND_CMD_READ,
NAND_CMD_WRITE,
NAND_CMD_ERASE,
NAND_CMD_BLOCK_BAD_GET, /* NAND_RESULT is 1 if block is bad, 0 if it is not */
NAND_CMD_BLOCK_BAD_SET,
NAND_CMD_READ_WITH_PARAMS,
NAND_CMD_WRITE_WITH_PARAMS,
NAND_CMD_ERASE_WITH_PARAMS
};
enum nand_dev_flags {
NAND_DEV_FLAG_READ_ONLY = 0x00000001,
NAND_DEV_FLAG_CMD_PARAMS_CAP = 0x00000002,
};
#define NAND_VERSION_CURRENT (1)
enum nand_reg {
/* Global */
NAND_VERSION = 0x000,
NAND_NUM_DEV = 0x004,
NAND_DEV = 0x008,
/* Dev info */
NAND_DEV_FLAGS = 0x010,
NAND_DEV_NAME_LEN = 0x014,
NAND_DEV_PAGE_SIZE = 0x018,
NAND_DEV_EXTRA_SIZE = 0x01c,
NAND_DEV_ERASE_SIZE = 0x020,
NAND_DEV_SIZE_LOW = 0x028,
NAND_DEV_SIZE_HIGH = 0x02c,
/* Command */
NAND_RESULT = 0x040,
NAND_COMMAND = 0x044,
NAND_DATA = 0x048,
NAND_TRANSFER_SIZE = 0x04c,
NAND_ADDR_LOW = 0x050,
NAND_ADDR_HIGH = 0x054,
NAND_CMD_PARAMS_ADDR_LOW = 0x058,
NAND_CMD_PARAMS_ADDR_HIGH = 0x05c,
};
struct cmd_params {
uint32_t dev;
uint32_t addr_low;
uint32_t addr_high;
uint32_t transfer_size;
uint32_t data;
uint32_t result;
};
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment