linux/drivers/mtd/maps/physmap-core.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * Normal mappings of chips in physical memory
 *
 * Copyright (C) 2003 MontaVista Software Inc.
 * Author: Jun Sun, [email protected] or [email protected]
 *
 * 031022 - [jsun] add run-time configure and partition setup
 *
 * Device tree support:
 *    Copyright (C) 2006 MontaVista Software Inc.
 *    Author: Vitaly Wool <[email protected]>
 *
 *    Revised to handle newer style flash binding by:
 *    Copyright (C) 2007 David Gibson, IBM Corporation.
 *
 * GPIO address extension:
 *    Handle the case where a flash device is mostly addressed using physical
 *    line and supplemented by GPIOs.  This way you can hook up say a 8MiB flash
 *    to a 2MiB memory range and use the GPIOs to select a particular range.
 *
 *    Copyright © 2000 Nicolas Pitre <[email protected]>
 *    Copyright © 2005-2009 Analog Devices Inc.
 */

#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/device.h>
#include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/map.h>
#include <linux/mtd/partitions.h>
#include <linux/mtd/physmap.h>
#include <linux/mtd/concat.h>
#include <linux/mtd/cfi_endian.h>
#include <linux/io.h>
#include <linux/of.h>
#include <linux/pm_runtime.h>
#include <linux/gpio/consumer.h>

#include "physmap-bt1-rom.h"
#include "physmap-gemini.h"
#include "physmap-ixp4xx.h"
#include "physmap-versatile.h"

struct physmap_flash_info {};

static void physmap_flash_remove(struct platform_device *dev)
{}

static void physmap_set_vpp(struct map_info *map, int state)
{}

#if IS_ENABLED(CONFIG_MTD_PHYSMAP_GPIO_ADDR)
static void physmap_set_addr_gpios(struct physmap_flash_info *info,
				   unsigned long ofs)
{}

#define win_mask(order)

static map_word physmap_addr_gpios_read(struct map_info *map,
					unsigned long ofs)
{}

static void physmap_addr_gpios_copy_from(struct map_info *map, void *buf,
					 unsigned long ofs, ssize_t len)
{}

static void physmap_addr_gpios_write(struct map_info *map, map_word mw,
				     unsigned long ofs)
{}

static void physmap_addr_gpios_copy_to(struct map_info *map, unsigned long ofs,
				       const void *buf, ssize_t len)
{}

static int physmap_addr_gpios_map_init(struct map_info *map)
{}
#else
static int physmap_addr_gpios_map_init(struct map_info *map)
{
	return -ENOTSUPP;
}
#endif

#if IS_ENABLED(CONFIG_MTD_PHYSMAP_OF)
static const struct of_device_id of_flash_match[] =;
MODULE_DEVICE_TABLE(of, of_flash_match);

static const char * const of_default_part_probes[] =;

static const char * const *of_get_part_probes(struct platform_device *dev)
{}

static const char *of_select_probe_type(struct platform_device *dev)
{}

static int physmap_flash_of_init(struct platform_device *dev)
{}
#else /* IS_ENABLED(CONFIG_MTD_PHYSMAP_OF) */
#define of_flash_match

static int physmap_flash_of_init(struct platform_device *dev)
{
	return -ENOTSUPP;
}
#endif /* IS_ENABLED(CONFIG_MTD_PHYSMAP_OF) */

static const char * const rom_probe_types[] =;

static const char * const part_probe_types[] =;

static int physmap_flash_pdata_init(struct platform_device *dev)
{}

static int physmap_flash_probe(struct platform_device *dev)
{}

#ifdef CONFIG_PM
static void physmap_flash_shutdown(struct platform_device *dev)
{}
#else
#define physmap_flash_shutdown
#endif

static struct platform_driver physmap_flash_driver =;

#ifdef CONFIG_MTD_PHYSMAP_COMPAT
static struct physmap_flash_data physmap_flash_data =;

static struct resource physmap_flash_resource =;

static struct platform_device physmap_flash =;
#endif

static int __init physmap_init(void)
{}

static void __exit physmap_exit(void)
{}

module_init();
module_exit(physmap_exit);

MODULE_LICENSE();
MODULE_AUTHOR();
MODULE_AUTHOR();
MODULE_AUTHOR();
MODULE_DESCRIPTION();

/* legacy platform drivers can't hotplug or coldplg */
#ifndef CONFIG_MTD_PHYSMAP_COMPAT
/* work with hotplug and coldplug */
MODULE_ALIAS("platform:physmap-flash");
#endif