linux/drivers/mtd/maps/ck804xrom.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * ck804xrom.c
 *
 * Normal mappings of chips in physical memory
 *
 * Dave Olsen <[email protected]>
 * Ryan Jackson <[email protected]>
 */

#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <asm/io.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/map.h>
#include <linux/mtd/cfi.h>
#include <linux/mtd/flashchip.h>
#include <linux/pci.h>
#include <linux/pci_ids.h>
#include <linux/list.h>


#define MOD_NAME

#define ADDRESS_NAME_LEN

#define ROM_PROBE_STEP_SIZE

#define DEV_CK804
#define DEV_MCP55

struct ck804xrom_window {};

struct ck804xrom_map_info {};

/*
 * The following applies to ck804 only:
 * The 2 bits controlling the window size are often set to allow reading
 * the BIOS, but too small to allow writing, since the lock registers are
 * 4MiB lower in the address space than the data.
 *
 * This is intended to prevent flashing the bios, perhaps accidentally.
 *
 * This parameter allows the normal driver to override the BIOS settings.
 *
 * The bits are 6 and 7.  If both bits are set, it is a 5MiB window.
 * If only the 7 Bit is set, it is a 4MiB window.  Otherwise, a
 * 64KiB window.
 *
 * The following applies to mcp55 only:
 * The 15 bits controlling the window size are distributed as follows: 
 * byte @0x88: bit 0..7
 * byte @0x8c: bit 8..15
 * word @0x90: bit 16..30
 * If all bits are enabled, we have a 16? MiB window
 * Please set win_size_bits to 0x7fffffff if you actually want to do something
 */
static uint win_size_bits =;
module_param(win_size_bits, uint, 0);
MODULE_PARM_DESC();

static struct ck804xrom_window ck804xrom_window =;

static void ck804xrom_cleanup(struct ck804xrom_window *window)
{}


static int __init ck804xrom_init_one(struct pci_dev *pdev,
				     const struct pci_device_id *ent)
{}


static void ck804xrom_remove_one(struct pci_dev *pdev)
{}

static const struct pci_device_id ck804xrom_pci_tbl[] =;

#if 0
MODULE_DEVICE_TABLE(pci, ck804xrom_pci_tbl);

static struct pci_driver ck804xrom_driver = {
	.name =		MOD_NAME,
	.id_table =	ck804xrom_pci_tbl,
	.probe =	ck804xrom_init_one,
	.remove =	ck804xrom_remove_one,
};
#endif

static int __init init_ck804xrom(void)
{}

static void __exit cleanup_ck804xrom(void)
{}

module_init();
module_exit(cleanup_ck804xrom);

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