// SPDX-License-Identifier: GPL-2.0 /* * Intel IXP4xx OF physmap add-on * Copyright (C) 2019 Linus Walleij <linus.walleij@linaro.org> * * Based on the ixp4xx.c map driver, originally written by: * Intel Corporation * Deepak Saxena <dsaxena@mvista.com> * Copyright (C) 2002 Intel Corporation * Copyright (C) 2003-2004 MontaVista Software, Inc.
*/ #include <linux/export.h> #include <linux/of.h> #include <linux/platform_device.h> #include <linux/mtd/map.h> #include <linux/mtd/xip.h> #include"physmap-ixp4xx.h"
/* * Read/write a 16 bit word from flash address 'addr'. * * When the cpu is in little-endian mode it swizzles the address lines * ('address coherency') so we need to undo the swizzling to ensure commands * and the like end up on the correct flash address. * * To further complicate matters, due to the way the expansion bus controller * handles 32 bit reads, the byte stream ABCD is stored on the flash as: * D15 D0 * +---+---+ * | A | B | 0 * +---+---+ * | C | D | 2 * +---+---+ * This means that on LE systems each 16 bit word must be swapped. Note that * this requires CONFIG_MTD_CFI_BE_BYTE_SWAP to be enabled to 'unswap' the CFI * data and other flash commands which are always in D7-D0.
*/ #ifndef CONFIG_CPU_BIG_ENDIAN
/* * The IXP4xx expansion bus only allows 16-bit wide acceses * when attached to a 16-bit wide device (such as the 28F128J3A), * so we can't just memcpy_fromio().
*/ staticvoid ixp4xx_copy_from(struct map_info *map, void *to, unsignedlong from, ssize_t len)
{
u8 *dest = (u8 *) to; void __iomem *src = map->virt + from;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.