-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ARM] S3C24XX: Add physmap device for all Simtec NOR equiped boards.
Move to using the physmap platform device code to attached NOR flash on Simtec boards so that the old bast-flash driver can be safely removed. Signed-off-by: Ben Dooks <ben-linux@fluff.org>
- Loading branch information
Ben Dooks
committed
Jul 3, 2008
1 parent
b9db83a
commit 9d529c6
Showing
6 changed files
with
119 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/* linux/arch/arm/mach-s3c2410/nor-simtec.c | ||
* | ||
* Copyright (c) 2008 Simtec Electronics | ||
* http://armlinux.simtec.co.uk/ | ||
* Ben Dooks <ben@simtec.co.uk> | ||
* | ||
* Simtec NOR mapping | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
*/ | ||
|
||
#include <linux/module.h> | ||
#include <linux/types.h> | ||
#include <linux/init.h> | ||
#include <linux/kernel.h> | ||
#include <linux/platform_device.h> | ||
|
||
#include <linux/mtd/mtd.h> | ||
#include <linux/mtd/map.h> | ||
#include <linux/mtd/physmap.h> | ||
#include <linux/mtd/partitions.h> | ||
|
||
#include <asm/mach/arch.h> | ||
#include <asm/mach/map.h> | ||
#include <asm/mach/irq.h> | ||
|
||
#include <asm/arch/map.h> | ||
#include <asm/arch/bast-map.h> | ||
#include <asm/arch/bast-cpld.h> | ||
|
||
|
||
static void simtec_nor_vpp(struct map_info *map, int vpp) | ||
{ | ||
unsigned int val; | ||
unsigned long flags; | ||
|
||
local_irq_save(flags); | ||
val = __raw_readb(BAST_VA_CTRL3); | ||
|
||
printk(KERN_DEBUG "%s(%d)\n", __func__, vpp); | ||
|
||
if (vpp) | ||
val |= BAST_CPLD_CTRL3_ROMWEN; | ||
else | ||
val &= ~BAST_CPLD_CTRL3_ROMWEN; | ||
|
||
__raw_writeb(val, BAST_VA_CTRL3); | ||
local_irq_restore(flags); | ||
} | ||
|
||
struct physmap_flash_data simtec_nor_pdata = { | ||
.width = 2, | ||
.set_vpp = simtec_nor_vpp, | ||
.nr_parts = 0, | ||
}; | ||
|
||
static struct resource simtec_nor_resource[] = { | ||
[0] = { | ||
.start = S3C2410_CS1 + 0x4000000, | ||
.end = S3C2410_CS1 + 0x4000000 + SZ_8M - 1, | ||
.flags = IORESOURCE_MEM, | ||
} | ||
}; | ||
|
||
static struct platform_device simtec_device_nor = { | ||
.name = "physmap-flash", | ||
.id = -1, | ||
.num_resources = ARRAY_SIZE(simtec_nor_resource), | ||
.resource = simtec_nor_resource, | ||
.dev = { | ||
.platform_data = &simtec_nor_pdata, | ||
}, | ||
}; | ||
|
||
void __init nor_simtec_init(void) | ||
{ | ||
int ret; | ||
|
||
ret = platform_device_register(&simtec_device_nor); | ||
if (ret < 0) | ||
printk(KERN_ERR "failed to register physmap-flash device\n"); | ||
else | ||
simtec_nor_vpp(NULL, 1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* linux/arch/arm/mach-s3c2410/nor-simtec.h | ||
* | ||
* Copyright (c) 2008 Simtec Electronics | ||
* http://armlinux.simtec.co.uk/ | ||
* Ben Dooks <ben@simtec.co.uk> | ||
* | ||
* Simtec NOR mapping | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
*/ | ||
|
||
extern void nor_simtec_init(void); |