Skip to content

Commit

Permalink
ARM: 6903/1: Realview: Use physmap driver instead of integrator-flash
Browse files Browse the repository at this point in the history
Tested on a PB11-MPCore.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Marc Zyngier authored and Russell King committed May 20, 2011
1 parent b7281ca commit b8b87ae
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 29 deletions.
2 changes: 1 addition & 1 deletion arch/arm/configs/realview-smp_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ CONFIG_MTD_BLOCK=y
CONFIG_MTD_CFI=y
CONFIG_MTD_CFI_INTELEXT=y
CONFIG_MTD_CFI_AMDSTD=y
CONFIG_MTD_ARM_INTEGRATOR=y
CONFIG_MTD_PHYSMAP=y
CONFIG_ARM_CHARLCD=y
CONFIG_NETDEVICES=y
CONFIG_SMSC_PHY=y
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/configs/realview_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ CONFIG_MTD_BLOCK=y
CONFIG_MTD_CFI=y
CONFIG_MTD_CFI_INTELEXT=y
CONFIG_MTD_CFI_AMDSTD=y
CONFIG_MTD_ARM_INTEGRATOR=y
CONFIG_MTD_PHYSMAP=y
CONFIG_ARM_CHARLCD=y
CONFIG_NETDEVICES=y
CONFIG_SMSC_PHY=y
Expand Down
31 changes: 4 additions & 27 deletions arch/arm/mach-realview/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <linux/amba/mmci.h>
#include <linux/gfp.h>
#include <linux/clkdev.h>
#include <linux/mtd/physmap.h>

#include <asm/system.h>
#include <mach/hardware.h>
Expand All @@ -41,7 +42,6 @@
#include <asm/hardware/icst.h>

#include <asm/mach/arch.h>
#include <asm/mach/flash.h>
#include <asm/mach/irq.h>
#include <asm/mach/map.h>

Expand Down Expand Up @@ -77,27 +77,7 @@ void __init realview_adjust_zones(unsigned long *size, unsigned long *hole)

#define REALVIEW_FLASHCTRL (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_FLASH_OFFSET)

static int realview_flash_init(void)
{
u32 val;

val = __raw_readl(REALVIEW_FLASHCTRL);
val &= ~REALVIEW_FLASHPROG_FLVPPEN;
__raw_writel(val, REALVIEW_FLASHCTRL);

return 0;
}

static void realview_flash_exit(void)
{
u32 val;

val = __raw_readl(REALVIEW_FLASHCTRL);
val &= ~REALVIEW_FLASHPROG_FLVPPEN;
__raw_writel(val, REALVIEW_FLASHCTRL);
}

static void realview_flash_set_vpp(int on)
static void realview_flash_set_vpp(struct map_info *map, int on)
{
u32 val;

Expand All @@ -109,16 +89,13 @@ static void realview_flash_set_vpp(int on)
__raw_writel(val, REALVIEW_FLASHCTRL);
}

static struct flash_platform_data realview_flash_data = {
.map_name = "cfi_probe",
static struct physmap_flash_data realview_flash_data = {
.width = 4,
.init = realview_flash_init,
.exit = realview_flash_exit,
.set_vpp = realview_flash_set_vpp,
};

struct platform_device realview_flash_device = {
.name = "armflash",
.name = "physmap-flash",
.id = 0,
.dev = {
.platform_data = &realview_flash_data,
Expand Down

0 comments on commit b8b87ae

Please sign in to comment.