linux/drivers/mtd/maps/sbc_gxx.c

// SPDX-License-Identifier: GPL-2.0-or-later
/* sbc_gxx.c -- MTD map driver for Arcom Control Systems SBC-MediaGX,
                SBC-GXm and SBC-GX1 series boards.

   Copyright (C) 2001 Arcom Control System Ltd


The SBC-MediaGX / SBC-GXx has up to 16 MiB of
Intel StrataFlash (28F320/28F640) in x8 mode.

This driver uses the CFI probe and Intel Extended Command Set drivers.

The flash is accessed as follows:

   16 KiB memory window at 0xdc000-0xdffff

   Two IO address locations for paging

   0x258
       bit 0-7: address bit 14-21
   0x259
       bit 0-1: address bit 22-23
       bit 7:   0 - reset/powered down
                1 - device enabled

The single flash device is divided into 3 partition which appear as
separate MTD devices.

25/04/2001 AJL (Arcom)  Modified signon strings and partition sizes
                        (to support bzImages up to 638KiB-ish)
*/

// Includes

#include <linux/module.h>
#include <linux/ioport.h>
#include <linux/init.h>
#include <asm/io.h>

#include <linux/mtd/mtd.h>
#include <linux/mtd/map.h>
#include <linux/mtd/partitions.h>

// Defines

// - Hardware specific

#define WINDOW_START

/* Number of bits in offset. */
#define WINDOW_SHIFT
#define WINDOW_LENGTH

/* The bits for the offset into the window. */
#define WINDOW_MASK
#define PAGE_IO
#define PAGE_IO_SIZE

/* bit 7 of 0x259 must be 1 to enable device. */
#define DEVICE_ENABLE

// - Flash / Partition sizing

#define MAX_SIZE_KiB
#define BOOT_PARTITION_SIZE_KiB
#define DATA_PARTITION_SIZE_KiB
#define APP_PARTITION_SIZE_KiB

// Globals

static volatile int page_in_window =; // Current page in window.
static void __iomem *iomapadr;
static DEFINE_SPINLOCK(sbc_gxx_spin);

/* partition_info gives details on the logical partitions that the split the
 * single flash device into. If the size if zero we use up to the end of the
 * device. */
static const struct mtd_partition partition_info[] =;

#define NUM_PARTITIONS

static inline void sbc_gxx_page(struct map_info *map, unsigned long ofs)
{}


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

static void sbc_gxx_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
{}

static void sbc_gxx_write8(struct map_info *map, map_word d, unsigned long adr)
{}

static void sbc_gxx_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
{}

static struct map_info sbc_gxx_map =;

/* MTD device for all of the flash. */
static struct mtd_info *all_mtd;

static void cleanup_sbc_gxx(void)
{}

static int __init init_sbc_gxx(void)
{}

module_init();
module_exit(cleanup_sbc_gxx);

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