Skip to content

Commit

Permalink
ARM: imx: Change the way nand devices are registered (imx27)
Browse files Browse the repository at this point in the history
Make use of new mechanism to register a nand device.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
  • Loading branch information
Uwe Kleine-König committed Jun 30, 2010
1 parent b0c4845 commit 0e7a29a
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 38 deletions.
5 changes: 5 additions & 0 deletions arch/arm/mach-imx/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,14 @@ comment "MX27 platforms:"

config MACH_MX27ADS
bool "MX27ADS platform"
select IMX_HAVE_PLATFORM_MXC_NAND
help
Include support for MX27ADS platform. This includes specific
configurations for the board and its peripherals.

config MACH_PCM038
bool "Phytec phyCORE-i.MX27 CPU module (pcm038)"
select IMX_HAVE_PLATFORM_MXC_NAND
select MXC_ULPI if USB_ULPI
help
Include support for phyCORE-i.MX27 (aka pcm038) platform. This
Expand All @@ -108,6 +110,7 @@ endchoice

config MACH_CPUIMX27
bool "Eukrea CPUIMX27 module"
select IMX_HAVE_PLATFORM_MXC_NAND
help
Include support for Eukrea CPUIMX27 platform. This includes
specific configurations for the module and its peripherals.
Expand Down Expand Up @@ -147,13 +150,15 @@ config MACH_IMX27LITE

config MACH_PCA100
bool "Phytec phyCARD-s (pca100)"
select IMX_HAVE_PLATFORM_MXC_NAND
select MXC_ULPI if USB_ULPI
help
Include support for phyCARD-s (aka pca100) platform. This
includes specific configurations for the module and its peripherals.

config MACH_MXT_TD60
bool "Maxtrack i-MXT TD60"
select IMX_HAVE_PLATFORM_MXC_NAND
help
Include support for i-MXT (aka td60) platform. This
includes specific configurations for the module and its peripherals.
Expand Down
13 changes: 13 additions & 0 deletions arch/arm/mach-imx/devices-imx27.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Copyright (C) 2010 Pengutronix
* Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
*
* 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 <mach/mx27.h>
#include <mach/devices-common.h>

#define imx27_add_mxc_nand(pdata) \
imx_add_mxc_nand_v1(MX27_NFC_BASE_ADDR, MX27_INT_NANDFC, pdata)
24 changes: 0 additions & 24 deletions arch/arm/mach-imx/devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,30 +337,6 @@ struct platform_device mxc_w1_master_device = {
.resource = mxc_w1_master_resources,
};

#define DEFINE_MXC_NAND_DEVICE(pfx, baseaddr, irq) \
static struct resource pfx ## _nand_resources[] = { \
{ \
.start = baseaddr, \
.end = baseaddr + SZ_4K - 1, \
.flags = IORESOURCE_MEM, \
}, { \
.start = irq, \
.end = irq, \
.flags = IORESOURCE_IRQ, \
}, \
}; \
\
struct platform_device pfx ## _nand_device = { \
.name = "mxc_nand", \
.id = 0, \
.num_resources = ARRAY_SIZE(pfx ## _nand_resources), \
.resource = pfx ## _nand_resources, \
}

#ifdef CONFIG_MACH_MX27
DEFINE_MXC_NAND_DEVICE(imx27, MX27_NFC_BASE_ADDR, MX27_INT_NANDFC);
#endif

/*
* lcdc:
* - i.MX1: the basic controller
Expand Down
3 changes: 0 additions & 3 deletions arch/arm/mach-imx/devices.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ extern struct platform_device imx2x_uart_device4;
extern struct platform_device imx2x_uart_device5;
#endif
extern struct platform_device mxc_w1_master_device;
#ifdef CONFIG_MACH_MX27
extern struct platform_device imx27_nand_device;
#endif
extern struct platform_device mxc_fb_device;
extern struct platform_device mxc_fec_device;
extern struct platform_device mxc_pwm_device;
Expand Down
7 changes: 4 additions & 3 deletions arch/arm/mach-imx/mach-cpuimx27.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include <mach/imx-uart.h>
#include <mach/mxc_nand.h>

#include "devices-imx27.h"
#include "devices.h"

static int eukrea_cpuimx27_pins[] = {
Expand Down Expand Up @@ -119,7 +120,8 @@ static struct imxuart_platform_data uart_pdata[] = {
},
};

static struct mxc_nand_platform_data eukrea_cpuimx27_nand_board_info = {
static const struct mxc_nand_platform_data
cpuimx27_nand_board_info __initconst = {
.width = 1,
.hw_ecc = 1,
};
Expand Down Expand Up @@ -189,8 +191,7 @@ static void __init eukrea_cpuimx27_init(void)

mxc_register_device(&imx2x_uart_device0, &uart_pdata[0]);

mxc_register_device(&imx27_nand_device,
&eukrea_cpuimx27_nand_board_info);
imx27_add_mxc_nand(&cpuimx27_nand_board_info);

i2c_register_board_info(0, eukrea_cpuimx27_i2c_devices,
ARRAY_SIZE(eukrea_cpuimx27_i2c_devices));
Expand Down
6 changes: 4 additions & 2 deletions arch/arm/mach-imx/mach-mx27ads.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <mach/imxfb.h>
#include <mach/mmc.h>

#include "devices-imx27.h"
#include "devices.h"

/*
Expand Down Expand Up @@ -166,7 +167,8 @@ static unsigned int mx27ads_pins[] = {
PB9_PF_SD2_CLK,
};

static struct mxc_nand_platform_data mx27ads_nand_board_info = {
static const struct mxc_nand_platform_data
mx27ads_nand_board_info __initconst = {
.width = 1,
.hw_ecc = 1,
};
Expand Down Expand Up @@ -315,7 +317,7 @@ static void __init mx27ads_board_init(void)
mxc_register_device(&imx2x_uart_device3, &uart_pdata[3]);
mxc_register_device(&imx2x_uart_device4, &uart_pdata[4]);
mxc_register_device(&imx2x_uart_device5, &uart_pdata[5]);
mxc_register_device(&imx27_nand_device, &mx27ads_nand_board_info);
imx27_add_mxc_nand(&mx27ads_nand_board_info);

/* only the i2c master 1 is used on this CPU card */
i2c_register_board_info(1, mx27ads_i2c_devices,
Expand Down
6 changes: 4 additions & 2 deletions arch/arm/mach-imx/mach-mxt_td60.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <mach/imxfb.h>
#include <mach/mmc.h>

#include "devices-imx27.h"
#include "devices.h"

static unsigned int mxt_td60_pins[] __initdata = {
Expand Down Expand Up @@ -124,7 +125,8 @@ static unsigned int mxt_td60_pins[] __initdata = {
PB9_PF_SD2_CLK,
};

static struct mxc_nand_platform_data mxt_td60_nand_board_info = {
static const struct mxc_nand_platform_data
mxt_td60_nand_board_info __initconst = {
.width = 1,
.hw_ecc = 1,
};
Expand Down Expand Up @@ -253,7 +255,7 @@ static void __init mxt_td60_board_init(void)
mxc_register_device(&imx2x_uart_device0, &uart_pdata[0]);
mxc_register_device(&imx2x_uart_device1, &uart_pdata[1]);
mxc_register_device(&imx2x_uart_device2, &uart_pdata[2]);
mxc_register_device(&imx27_nand_device, &mxt_td60_nand_board_info);
imx27_add_mxc_nand(&mxt_td60_nand_board_info);

i2c_register_board_info(0, mxt_td60_i2c_devices,
ARRAY_SIZE(mxt_td60_i2c_devices));
Expand Down
6 changes: 4 additions & 2 deletions arch/arm/mach-imx/mach-pca100.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
#include <mach/mxc_ehci.h>
#include <mach/ulpi.h>

#include "devices-imx27.h"
#include "devices.h"

#define OTG_PHY_CS_GPIO (GPIO_PORTB + 23)
Expand Down Expand Up @@ -137,7 +138,8 @@ static struct imxuart_platform_data uart_pdata = {
.flags = IMXUART_HAVE_RTSCTS,
};

static struct mxc_nand_platform_data pca100_nand_board_info = {
static const struct mxc_nand_platform_data
pca100_nand_board_info __initconst = {
.width = 1,
.hw_ecc = 1,
};
Expand Down Expand Up @@ -325,7 +327,7 @@ static void __init pca100_init(void)
mxc_gpio_mode(GPIO_PORTC | 29 | GPIO_GPIO | GPIO_IN);
mxc_register_device(&mxc_sdhc_device1, &sdhc_pdata);

mxc_register_device(&imx27_nand_device, &pca100_nand_board_info);
imx27_add_mxc_nand(&pca100_nand_board_info);

/* only the i2c master 1 is used on this CPU card */
i2c_register_board_info(1, pca100_i2c_devices,
Expand Down
6 changes: 4 additions & 2 deletions arch/arm/mach-imx/mach-pcm038.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include <mach/mxc_ehci.h>
#include <mach/ulpi.h>

#include "devices-imx27.h"
#include "devices.h"

static int pcm038_pins[] = {
Expand Down Expand Up @@ -172,7 +173,8 @@ static struct imxuart_platform_data uart_pdata[] = {
},
};

static struct mxc_nand_platform_data pcm038_nand_board_info = {
static const struct mxc_nand_platform_data
pcm038_nand_board_info __initconst = {
.width = 1,
.hw_ecc = 1,
};
Expand Down Expand Up @@ -310,7 +312,7 @@ static void __init pcm038_init(void)
mxc_register_device(&imx2x_uart_device2, &uart_pdata[2]);

mxc_gpio_mode(PE16_AF_OWIRE);
mxc_register_device(&imx27_nand_device, &pcm038_nand_board_info);
imx27_add_mxc_nand(&pcm038_nand_board_info);

/* only the i2c master 1 is used on this CPU card */
i2c_register_board_info(1, pcm038_i2c_devices,
Expand Down

0 comments on commit 0e7a29a

Please sign in to comment.