aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/files/arch/mips/ath79/mach-rb91x.c
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2014-02-23 07:19:32 +0000
committerGabor Juhos <juhosg@openwrt.org>2014-02-23 07:19:32 +0000
commit3d906ac6ac160613bc4c7a5093e6a4e16db8ffa0 (patch)
tree5a1b5ad3de61b670312b8426f120d2b90d255fa6 /target/linux/ar71xx/files/arch/mips/ath79/mach-rb91x.c
parent8fea668cb78c5f007fdc0c576f295580df2dceeb (diff)
downloadupstream-3d906ac6ac160613bc4c7a5093e6a4e16db8ffa0.tar.gz
upstream-3d906ac6ac160613bc4c7a5093e6a4e16db8ffa0.tar.bz2
upstream-3d906ac6ac160613bc4c7a5093e6a4e16db8ffa0.zip
ar71xx: rb91x-nand: rewrite to use GPIO API
Rewrite tha rb91x-nand driver to use GPIO API to modify the NAND control lines. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 39700
Diffstat (limited to 'target/linux/ar71xx/files/arch/mips/ath79/mach-rb91x.c')
-rw-r--r--target/linux/ar71xx/files/arch/mips/ath79/mach-rb91x.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb91x.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb91x.c
index 1da447b406..cb9abf7627 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb91x.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb91x.c
@@ -23,6 +23,7 @@
#include <linux/routerboot.h>
#include <linux/gpio.h>
#include <linux/platform_data/gpio-latch.h>
+#include <linux/platform_data/rb91x_nand.h>
#include <asm/prom.h>
#include <asm/mach-ath79/ath79.h>
@@ -54,6 +55,14 @@
#define RB91X_LATCH_GPIO_BASE AR934X_GPIO_COUNT
#define RB91X_LATCH_GPIO(_x) (RB91X_LATCH_GPIO_BASE + (_x))
+#define RB91X_GPIO_NAND_READ RB91X_LATCH_GPIO(3)
+#define RB91X_GPIO_NAND_RDY RB91X_LATCH_GPIO(4)
+#define RB91X_GPIO_NLE RB91X_LATCH_GPIO(11)
+#define RB91X_GPIO_NAND_NRW RB91X_LATCH_GPIO(12)
+#define RB91X_GPIO_NAND_NCE RB91X_LATCH_GPIO(13)
+#define RB91X_GPIO_NAND_CLE RB91X_LATCH_GPIO(14)
+#define RB91X_GPIO_NAND_ALE RB91X_LATCH_GPIO(15)
+
struct rb_board_info {
const char *name;
u32 flags;
@@ -97,6 +106,16 @@ static struct gpio_latch_platform_data rb711gr100_gpio_latch_data __initdata = {
.le_active_low = true,
};
+static struct rb91x_nand_platform_data rb711gr100_nand_data __initdata = {
+ .gpio_nce = RB91X_GPIO_NAND_NCE,
+ .gpio_ale = RB91X_GPIO_NAND_ALE,
+ .gpio_cle = RB91X_GPIO_NAND_CLE,
+ .gpio_rdy = RB91X_GPIO_NAND_RDY,
+ .gpio_read = RB91X_GPIO_NAND_READ,
+ .gpio_nrw = RB91X_GPIO_NAND_NRW,
+ .gpio_nle = RB91X_GPIO_NLE,
+};
+
static void __init rb711gr100_init_partitions(const struct rb_info *info)
{
rb711gr100_spi_partitions[0].size = info->hard_cfg_offs;
@@ -179,7 +198,9 @@ static void __init rb711gr100_setup(void)
rb711gr100_wlan_init();
- platform_device_register_simple("rb91x-nand", -1, NULL, 0);
+ platform_device_register_data(NULL, "rb91x-nand", -1,
+ &rb711gr100_nand_data,
+ sizeof(rb711gr100_nand_data));
platform_device_register_data(NULL, "gpio-latch", -1,
&rb711gr100_gpio_latch_data,