* [PATCH 1/4] pxa/colibri270: Refactor board definition file
@ 2010-05-11 2:26 Marek Vasut
2010-05-11 2:26 ` [PATCH 2/4] pxa/colibri270: Add MMC support Marek Vasut
` (4 more replies)
0 siblings, 5 replies; 11+ messages in thread
From: Marek Vasut @ 2010-05-11 2:26 UTC (permalink / raw)
To: linux-arm-kernel
This patch just moves code around and polishes it. Also, compile in only
selected pieces of hardware.
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
arch/arm/mach-pxa/colibri-pxa270.c | 69 ++++++++++++++++++------------
arch/arm/mach-pxa/include/mach/colibri.h | 9 +---
2 files changed, 43 insertions(+), 35 deletions(-)
diff --git a/arch/arm/mach-pxa/colibri-pxa270.c b/arch/arm/mach-pxa/colibri-pxa270.c
index 061c453..4519e89 100644
--- a/arch/arm/mach-pxa/colibri-pxa270.c
+++ b/arch/arm/mach-pxa/colibri-pxa270.c
@@ -3,6 +3,7 @@
*
* Support for Toradex PXA270 based Colibri module
* Daniel Mack <daniel@caiaq.de>
+ * Marek Vasut <marek.vasut@gmail.com>
*
* 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
@@ -36,23 +37,25 @@
#include "generic.h"
#include "devices.h"
-/*
- * GPIO configuration
- */
+/******************************************************************************
+ * Pin configuration
+ ******************************************************************************/
static mfp_cfg_t colibri_pxa270_pin_config[] __initdata = {
+ /* Ethernet */
GPIO78_nCS_2, /* Ethernet CS */
GPIO114_GPIO, /* Ethernet IRQ */
};
-/*
- * NOR flash
- */
+/******************************************************************************
+ * NOR Flash
+ ******************************************************************************/
+#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
static struct mtd_partition colibri_partitions[] = {
{
.name = "Bootloader",
.offset = 0x00000000,
.size = 0x00040000,
- .mask_flags = MTD_WRITEABLE /* force read-only */
+ .mask_flags = MTD_WRITEABLE /* force read-only */
}, {
.name = "Kernel",
.offset = 0x00040000,
@@ -90,42 +93,50 @@ static struct platform_device colibri_pxa270_flash_device = {
.num_resources = 1,
};
-/*
- * DM9000 Ethernet
- */
-#if defined(CONFIG_DM9000)
-static struct resource dm9000_resources[] = {
+static void __init colibri_pxa270_nor_init(void)
+{
+ platform_device_register(&colibri_pxa270_flash);
+}
+#else
+static inline void colibri_pxa270_nor_init(void) {}
+#endif
+
+/******************************************************************************
+ * Ethernet
+ ******************************************************************************/
+#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
+static struct resource colibri_pxa270_dm9000_resources[] = {
[0] = {
- .start = COLIBRI_PXA270_ETH_PHYS,
- .end = COLIBRI_PXA270_ETH_PHYS + 3,
+ .start = PXA_CS2_PHYS,
+ .end = PXA_CS2_PHYS + 3,
.flags = IORESOURCE_MEM,
},
[1] = {
- .start = COLIBRI_PXA270_ETH_PHYS + 4,
- .end = COLIBRI_PXA270_ETH_PHYS + 4 + 500,
+ .start = PXA_CS2_PHYS + 4,
+ .end = PXA_CS2_PHYS + 4 + 500,
.flags = IORESOURCE_MEM,
},
[2] = {
- .start = COLIBRI_PXA270_ETH_IRQ,
- .end = COLIBRI_PXA270_ETH_IRQ,
+ .start = gpio_to_irq(GPIO114_COLIBRI_PXA270_ETH_IRQ),
+ .end = gpio_to_irq(GPIO114_COLIBRI_PXA270_ETH_IRQ),
.flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING,
},
};
-static struct platform_device dm9000_device = {
+static struct platform_device colibri_pxa270_dm9000_device = {
.name = "dm9000",
.id = -1,
- .num_resources = ARRAY_SIZE(dm9000_resources),
- .resource = dm9000_resources,
+ .num_resources = ARRAY_SIZE(colibri_pxa270_dm9000_resources),
+ .resource = colibri_pxa270_dm9000_resources,
};
-#endif /* CONFIG_DM9000 */
-static struct platform_device *colibri_pxa270_devices[] __initdata = {
- &colibri_pxa270_flash_device,
-#if defined(CONFIG_DM9000)
- &dm9000_device,
+static void __init colibri_pxa270_eth_init(void)
+{
+ platform_device_register(&colibri_pxa270_dm9000_device);
+}
+#else
+static inline void colibri_pxa270_eth_init(void) {}
#endif
-};
static void __init colibri_pxa270_init(void)
{
@@ -133,7 +144,9 @@ static void __init colibri_pxa270_init(void)
pxa_set_ffuart_info(NULL);
pxa_set_btuart_info(NULL);
pxa_set_stuart_info(NULL);
- platform_add_devices(ARRAY_AND_SIZE(colibri_pxa270_devices));
+
+ colibri_pxa270_nor_init();
+ colibri_pxa270_eth_init();
}
MACHINE_START(COLIBRI, "Toradex Colibri PXA270")
diff --git a/arch/arm/mach-pxa/include/mach/colibri.h b/arch/arm/mach-pxa/include/mach/colibri.h
index 811743c..0b24a20 100644
--- a/arch/arm/mach-pxa/include/mach/colibri.h
+++ b/arch/arm/mach-pxa/include/mach/colibri.h
@@ -32,13 +32,8 @@ static inline void colibri_pxa3xx_init_nand(void) {}
/* physical memory regions */
#define COLIBRI_SDRAM_BASE 0xa0000000 /* SDRAM region */
-/* definitions for Colibri PXA270 */
-
-#define COLIBRI_PXA270_FLASH_PHYS (PXA_CS0_PHYS) /* Flash region */
-#define COLIBRI_PXA270_ETH_PHYS (PXA_CS2_PHYS) /* Ethernet */
-#define COLIBRI_PXA270_ETH_IRQ_GPIO 114
-#define COLIBRI_PXA270_ETH_IRQ \
- gpio_to_irq(mfp_to_gpio(COLIBRI_PXA270_ETH_IRQ_GPIO))
+/* GPIO definitions for Colibri PXA270 */
+#define GPIO114_COLIBRI_PXA270_ETH_IRQ 114
#endif /* _COLIBRI_H_ */
--
1.7.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 2/4] pxa/colibri270: Add MMC support
2010-05-11 2:26 [PATCH 1/4] pxa/colibri270: Refactor board definition file Marek Vasut
@ 2010-05-11 2:26 ` Marek Vasut
2010-05-11 8:52 ` Daniel Mack
2010-05-11 2:26 ` [PATCH 3/4] pxa/colibri270: Add FFUART MFP Marek Vasut
` (3 subsequent siblings)
4 siblings, 1 reply; 11+ messages in thread
From: Marek Vasut @ 2010-05-11 2:26 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
arch/arm/mach-pxa/colibri-pxa270.c | 31 ++++++++++++++++++++++++++++++
arch/arm/mach-pxa/include/mach/colibri.h | 1 +
2 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-pxa/colibri-pxa270.c b/arch/arm/mach-pxa/colibri-pxa270.c
index 4519e89..5490c5f 100644
--- a/arch/arm/mach-pxa/colibri-pxa270.c
+++ b/arch/arm/mach-pxa/colibri-pxa270.c
@@ -33,6 +33,7 @@
#include <mach/pxa27x.h>
#include <mach/colibri.h>
+#include <mach/mmc.h>
#include "generic.h"
#include "devices.h"
@@ -44,6 +45,15 @@ static mfp_cfg_t colibri_pxa270_pin_config[] __initdata = {
/* Ethernet */
GPIO78_nCS_2, /* Ethernet CS */
GPIO114_GPIO, /* Ethernet IRQ */
+
+ /* MMC */
+ GPIO32_MMC_CLK,
+ GPIO92_MMC_DAT_0,
+ GPIO109_MMC_DAT_1,
+ GPIO110_MMC_DAT_2,
+ GPIO111_MMC_DAT_3,
+ GPIO112_MMC_CMD,
+ GPIO0_GPIO, /* SD detect */
};
/******************************************************************************
@@ -138,6 +148,26 @@ static void __init colibri_pxa270_eth_init(void)
static inline void colibri_pxa270_eth_init(void) {}
#endif
+/******************************************************************************
+ * SD/MMC card controller
+ ******************************************************************************/
+#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
+static struct pxamci_platform_data colibri_pxa270_mci_platform_data = {
+ .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
+ .gpio_power = -1,
+ .gpio_card_detect = GPIO0_COLIBRI_PXA270_SD_DETECT,
+ .gpio_card_ro = -1,
+ .detect_delay_ms = 200,
+};
+
+static void __init colibri_pxa270_mmc_init(void)
+{
+ pxa_set_mci_info(&colibri_pxa270_mci_platform_data);
+}
+#else
+static inline void colibri_pxa270_mmc_init(void) {}
+#endif
+
static void __init colibri_pxa270_init(void)
{
pxa2xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa270_pin_config));
@@ -147,6 +177,7 @@ static void __init colibri_pxa270_init(void)
colibri_pxa270_nor_init();
colibri_pxa270_eth_init();
+ colibri_pxa270_mmc_init();
}
MACHINE_START(COLIBRI, "Toradex Colibri PXA270")
diff --git a/arch/arm/mach-pxa/include/mach/colibri.h b/arch/arm/mach-pxa/include/mach/colibri.h
index 0b24a20..08bee63 100644
--- a/arch/arm/mach-pxa/include/mach/colibri.h
+++ b/arch/arm/mach-pxa/include/mach/colibri.h
@@ -34,6 +34,7 @@ static inline void colibri_pxa3xx_init_nand(void) {}
/* GPIO definitions for Colibri PXA270 */
#define GPIO114_COLIBRI_PXA270_ETH_IRQ 114
+#define GPIO0_COLIBRI_PXA270_SD_DETECT 0
#endif /* _COLIBRI_H_ */
--
1.7.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 3/4] pxa/colibri270: Add FFUART MFP
2010-05-11 2:26 [PATCH 1/4] pxa/colibri270: Refactor board definition file Marek Vasut
2010-05-11 2:26 ` [PATCH 2/4] pxa/colibri270: Add MMC support Marek Vasut
@ 2010-05-11 2:26 ` Marek Vasut
2010-05-11 2:26 ` [PATCH 4/4] pxa/colibri270: Add UHC support Marek Vasut
` (2 subsequent siblings)
4 siblings, 0 replies; 11+ messages in thread
From: Marek Vasut @ 2010-05-11 2:26 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
arch/arm/mach-pxa/colibri-pxa270.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-pxa/colibri-pxa270.c b/arch/arm/mach-pxa/colibri-pxa270.c
index 5490c5f..18b208a 100644
--- a/arch/arm/mach-pxa/colibri-pxa270.c
+++ b/arch/arm/mach-pxa/colibri-pxa270.c
@@ -54,6 +54,10 @@ static mfp_cfg_t colibri_pxa270_pin_config[] __initdata = {
GPIO111_MMC_DAT_3,
GPIO112_MMC_CMD,
GPIO0_GPIO, /* SD detect */
+
+ /* FFUART */
+ GPIO39_FFUART_TXD,
+ GPIO34_FFUART_RXD,
};
/******************************************************************************
--
1.7.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 4/4] pxa/colibri270: Add UHC support
2010-05-11 2:26 [PATCH 1/4] pxa/colibri270: Refactor board definition file Marek Vasut
2010-05-11 2:26 ` [PATCH 2/4] pxa/colibri270: Add MMC support Marek Vasut
2010-05-11 2:26 ` [PATCH 3/4] pxa/colibri270: Add FFUART MFP Marek Vasut
@ 2010-05-11 2:26 ` Marek Vasut
2010-05-11 8:48 ` [PATCH 1/4] pxa/colibri270: Refactor board definition file Daniel Mack
2010-05-14 10:37 ` Daniel Mack
4 siblings, 0 replies; 11+ messages in thread
From: Marek Vasut @ 2010-05-11 2:26 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
arch/arm/mach-pxa/colibri-pxa270.c | 34 ++++++++++++++++++++++++++++++++++
1 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-pxa/colibri-pxa270.c b/arch/arm/mach-pxa/colibri-pxa270.c
index 18b208a..1cbeb61 100644
--- a/arch/arm/mach-pxa/colibri-pxa270.c
+++ b/arch/arm/mach-pxa/colibri-pxa270.c
@@ -34,6 +34,8 @@
#include <mach/pxa27x.h>
#include <mach/colibri.h>
#include <mach/mmc.h>
+#include <mach/ohci.h>
+#include <mach/pxa27x-udc.h>
#include "generic.h"
#include "devices.h"
@@ -58,6 +60,12 @@ static mfp_cfg_t colibri_pxa270_pin_config[] __initdata = {
/* FFUART */
GPIO39_FFUART_TXD,
GPIO34_FFUART_RXD,
+
+ /* UHC */
+ GPIO88_USBH1_PWR,
+ GPIO89_USBH1_PEN,
+ GPIO119_USBH2_PWR,
+ GPIO120_USBH2_PEN,
};
/******************************************************************************
@@ -172,6 +180,31 @@ static void __init colibri_pxa270_mmc_init(void)
static inline void colibri_pxa270_mmc_init(void) {}
#endif
+/******************************************************************************
+ * USB Host
+ ******************************************************************************/
+#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
+static int colibri_pxa270_ohci_init(struct device *dev)
+{
+ UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE;
+ return 0;
+}
+
+static struct pxaohci_platform_data colibri_pxa270_ohci_info = {
+ .port_mode = PMM_PERPORT_MODE,
+ .flags = ENABLE_PORT1 | ENABLE_PORT2 |
+ POWER_CONTROL_LOW | POWER_SENSE_LOW,
+ .init = colibri_pxa270_ohci_init,
+};
+
+static void __init colibri_pxa270_uhc_init(void)
+{
+ pxa_set_ohci_info(&colibri_pxa270_ohci_info);
+}
+#else
+static inline void colibri_pxa270_uhc_init(void) {}
+#endif
+
static void __init colibri_pxa270_init(void)
{
pxa2xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa270_pin_config));
@@ -182,6 +215,7 @@ static void __init colibri_pxa270_init(void)
colibri_pxa270_nor_init();
colibri_pxa270_eth_init();
colibri_pxa270_mmc_init();
+ colibri_pxa270_uhc_init();
}
MACHINE_START(COLIBRI, "Toradex Colibri PXA270")
--
1.7.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 1/4] pxa/colibri270: Refactor board definition file
2010-05-11 2:26 [PATCH 1/4] pxa/colibri270: Refactor board definition file Marek Vasut
` (2 preceding siblings ...)
2010-05-11 2:26 ` [PATCH 4/4] pxa/colibri270: Add UHC support Marek Vasut
@ 2010-05-11 8:48 ` Daniel Mack
2010-05-14 10:37 ` Daniel Mack
4 siblings, 0 replies; 11+ messages in thread
From: Daniel Mack @ 2010-05-11 8:48 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, May 11, 2010 at 04:26:55AM +0200, Marek Vasut wrote:
> This patch just moves code around and polishes it. Also, compile in only
> selected pieces of hardware.
I couldn't test this yet, but all changes look fine to me. Especially
the removal of the header file macros which only have one user makes
sense.
> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Acked-by: Daniel Mack <daniel@caiaq.de>
Thanks,
Daniel
> ---
> arch/arm/mach-pxa/colibri-pxa270.c | 69 ++++++++++++++++++------------
> arch/arm/mach-pxa/include/mach/colibri.h | 9 +---
> 2 files changed, 43 insertions(+), 35 deletions(-)
>
> diff --git a/arch/arm/mach-pxa/colibri-pxa270.c b/arch/arm/mach-pxa/colibri-pxa270.c
> index 061c453..4519e89 100644
> --- a/arch/arm/mach-pxa/colibri-pxa270.c
> +++ b/arch/arm/mach-pxa/colibri-pxa270.c
> @@ -3,6 +3,7 @@
> *
> * Support for Toradex PXA270 based Colibri module
> * Daniel Mack <daniel@caiaq.de>
> + * Marek Vasut <marek.vasut@gmail.com>
> *
> * 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
> @@ -36,23 +37,25 @@
> #include "generic.h"
> #include "devices.h"
>
> -/*
> - * GPIO configuration
> - */
> +/******************************************************************************
> + * Pin configuration
> + ******************************************************************************/
> static mfp_cfg_t colibri_pxa270_pin_config[] __initdata = {
> + /* Ethernet */
> GPIO78_nCS_2, /* Ethernet CS */
> GPIO114_GPIO, /* Ethernet IRQ */
> };
>
> -/*
> - * NOR flash
> - */
> +/******************************************************************************
> + * NOR Flash
> + ******************************************************************************/
> +#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
> static struct mtd_partition colibri_partitions[] = {
> {
> .name = "Bootloader",
> .offset = 0x00000000,
> .size = 0x00040000,
> - .mask_flags = MTD_WRITEABLE /* force read-only */
> + .mask_flags = MTD_WRITEABLE /* force read-only */
> }, {
> .name = "Kernel",
> .offset = 0x00040000,
> @@ -90,42 +93,50 @@ static struct platform_device colibri_pxa270_flash_device = {
> .num_resources = 1,
> };
>
> -/*
> - * DM9000 Ethernet
> - */
> -#if defined(CONFIG_DM9000)
> -static struct resource dm9000_resources[] = {
> +static void __init colibri_pxa270_nor_init(void)
> +{
> + platform_device_register(&colibri_pxa270_flash);
> +}
> +#else
> +static inline void colibri_pxa270_nor_init(void) {}
> +#endif
> +
> +/******************************************************************************
> + * Ethernet
> + ******************************************************************************/
> +#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
> +static struct resource colibri_pxa270_dm9000_resources[] = {
> [0] = {
> - .start = COLIBRI_PXA270_ETH_PHYS,
> - .end = COLIBRI_PXA270_ETH_PHYS + 3,
> + .start = PXA_CS2_PHYS,
> + .end = PXA_CS2_PHYS + 3,
> .flags = IORESOURCE_MEM,
> },
> [1] = {
> - .start = COLIBRI_PXA270_ETH_PHYS + 4,
> - .end = COLIBRI_PXA270_ETH_PHYS + 4 + 500,
> + .start = PXA_CS2_PHYS + 4,
> + .end = PXA_CS2_PHYS + 4 + 500,
> .flags = IORESOURCE_MEM,
> },
> [2] = {
> - .start = COLIBRI_PXA270_ETH_IRQ,
> - .end = COLIBRI_PXA270_ETH_IRQ,
> + .start = gpio_to_irq(GPIO114_COLIBRI_PXA270_ETH_IRQ),
> + .end = gpio_to_irq(GPIO114_COLIBRI_PXA270_ETH_IRQ),
> .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING,
> },
> };
>
> -static struct platform_device dm9000_device = {
> +static struct platform_device colibri_pxa270_dm9000_device = {
> .name = "dm9000",
> .id = -1,
> - .num_resources = ARRAY_SIZE(dm9000_resources),
> - .resource = dm9000_resources,
> + .num_resources = ARRAY_SIZE(colibri_pxa270_dm9000_resources),
> + .resource = colibri_pxa270_dm9000_resources,
> };
> -#endif /* CONFIG_DM9000 */
>
> -static struct platform_device *colibri_pxa270_devices[] __initdata = {
> - &colibri_pxa270_flash_device,
> -#if defined(CONFIG_DM9000)
> - &dm9000_device,
> +static void __init colibri_pxa270_eth_init(void)
> +{
> + platform_device_register(&colibri_pxa270_dm9000_device);
> +}
> +#else
> +static inline void colibri_pxa270_eth_init(void) {}
> #endif
> -};
>
> static void __init colibri_pxa270_init(void)
> {
> @@ -133,7 +144,9 @@ static void __init colibri_pxa270_init(void)
> pxa_set_ffuart_info(NULL);
> pxa_set_btuart_info(NULL);
> pxa_set_stuart_info(NULL);
> - platform_add_devices(ARRAY_AND_SIZE(colibri_pxa270_devices));
> +
> + colibri_pxa270_nor_init();
> + colibri_pxa270_eth_init();
> }
>
> MACHINE_START(COLIBRI, "Toradex Colibri PXA270")
> diff --git a/arch/arm/mach-pxa/include/mach/colibri.h b/arch/arm/mach-pxa/include/mach/colibri.h
> index 811743c..0b24a20 100644
> --- a/arch/arm/mach-pxa/include/mach/colibri.h
> +++ b/arch/arm/mach-pxa/include/mach/colibri.h
> @@ -32,13 +32,8 @@ static inline void colibri_pxa3xx_init_nand(void) {}
> /* physical memory regions */
> #define COLIBRI_SDRAM_BASE 0xa0000000 /* SDRAM region */
>
> -/* definitions for Colibri PXA270 */
> -
> -#define COLIBRI_PXA270_FLASH_PHYS (PXA_CS0_PHYS) /* Flash region */
> -#define COLIBRI_PXA270_ETH_PHYS (PXA_CS2_PHYS) /* Ethernet */
> -#define COLIBRI_PXA270_ETH_IRQ_GPIO 114
> -#define COLIBRI_PXA270_ETH_IRQ \
> - gpio_to_irq(mfp_to_gpio(COLIBRI_PXA270_ETH_IRQ_GPIO))
> +/* GPIO definitions for Colibri PXA270 */
> +#define GPIO114_COLIBRI_PXA270_ETH_IRQ 114
>
> #endif /* _COLIBRI_H_ */
>
> --
> 1.7.0
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 2/4] pxa/colibri270: Add MMC support
2010-05-11 2:26 ` [PATCH 2/4] pxa/colibri270: Add MMC support Marek Vasut
@ 2010-05-11 8:52 ` Daniel Mack
2010-05-11 10:46 ` Eric Miao
0 siblings, 1 reply; 11+ messages in thread
From: Daniel Mack @ 2010-05-11 8:52 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, May 11, 2010 at 04:26:56AM +0200, Marek Vasut wrote:
> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
The rest of this set also looks ok to me.
For the future, we should think about having a modularized aproach for
these modules just like some mx31 boards have. We would need to split
resources on the module from such on the baseboard, so peope can easily
add support for a custom base board without touching the module code.
Daniel
> ---
> arch/arm/mach-pxa/colibri-pxa270.c | 31 ++++++++++++++++++++++++++++++
> arch/arm/mach-pxa/include/mach/colibri.h | 1 +
> 2 files changed, 32 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-pxa/colibri-pxa270.c b/arch/arm/mach-pxa/colibri-pxa270.c
> index 4519e89..5490c5f 100644
> --- a/arch/arm/mach-pxa/colibri-pxa270.c
> +++ b/arch/arm/mach-pxa/colibri-pxa270.c
> @@ -33,6 +33,7 @@
>
> #include <mach/pxa27x.h>
> #include <mach/colibri.h>
> +#include <mach/mmc.h>
>
> #include "generic.h"
> #include "devices.h"
> @@ -44,6 +45,15 @@ static mfp_cfg_t colibri_pxa270_pin_config[] __initdata = {
> /* Ethernet */
> GPIO78_nCS_2, /* Ethernet CS */
> GPIO114_GPIO, /* Ethernet IRQ */
> +
> + /* MMC */
> + GPIO32_MMC_CLK,
> + GPIO92_MMC_DAT_0,
> + GPIO109_MMC_DAT_1,
> + GPIO110_MMC_DAT_2,
> + GPIO111_MMC_DAT_3,
> + GPIO112_MMC_CMD,
> + GPIO0_GPIO, /* SD detect */
> };
>
> /******************************************************************************
> @@ -138,6 +148,26 @@ static void __init colibri_pxa270_eth_init(void)
> static inline void colibri_pxa270_eth_init(void) {}
> #endif
>
> +/******************************************************************************
> + * SD/MMC card controller
> + ******************************************************************************/
> +#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
> +static struct pxamci_platform_data colibri_pxa270_mci_platform_data = {
> + .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
> + .gpio_power = -1,
> + .gpio_card_detect = GPIO0_COLIBRI_PXA270_SD_DETECT,
> + .gpio_card_ro = -1,
> + .detect_delay_ms = 200,
> +};
> +
> +static void __init colibri_pxa270_mmc_init(void)
> +{
> + pxa_set_mci_info(&colibri_pxa270_mci_platform_data);
> +}
> +#else
> +static inline void colibri_pxa270_mmc_init(void) {}
> +#endif
> +
> static void __init colibri_pxa270_init(void)
> {
> pxa2xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa270_pin_config));
> @@ -147,6 +177,7 @@ static void __init colibri_pxa270_init(void)
>
> colibri_pxa270_nor_init();
> colibri_pxa270_eth_init();
> + colibri_pxa270_mmc_init();
> }
>
> MACHINE_START(COLIBRI, "Toradex Colibri PXA270")
> diff --git a/arch/arm/mach-pxa/include/mach/colibri.h b/arch/arm/mach-pxa/include/mach/colibri.h
> index 0b24a20..08bee63 100644
> --- a/arch/arm/mach-pxa/include/mach/colibri.h
> +++ b/arch/arm/mach-pxa/include/mach/colibri.h
> @@ -34,6 +34,7 @@ static inline void colibri_pxa3xx_init_nand(void) {}
>
> /* GPIO definitions for Colibri PXA270 */
> #define GPIO114_COLIBRI_PXA270_ETH_IRQ 114
> +#define GPIO0_COLIBRI_PXA270_SD_DETECT 0
>
> #endif /* _COLIBRI_H_ */
>
> --
> 1.7.0
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 2/4] pxa/colibri270: Add MMC support
2010-05-11 8:52 ` Daniel Mack
@ 2010-05-11 10:46 ` Eric Miao
2010-05-11 10:48 ` Daniel Mack
0 siblings, 1 reply; 11+ messages in thread
From: Eric Miao @ 2010-05-11 10:46 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, May 11, 2010 at 4:52 PM, Daniel Mack <daniel@caiaq.de> wrote:
> On Tue, May 11, 2010 at 04:26:56AM +0200, Marek Vasut wrote:
>> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
>
> The rest of this set also looks ok to me.
>
> For the future, we should think about having a modularized aproach for
> these modules just like some mx31 boards have. We would need to split
> resources on the module from such on the baseboard, so peope can easily
> add support for a custom base board without touching the module code.
>
Daniel,
So Ack for this patch or not?
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 2/4] pxa/colibri270: Add MMC support
2010-05-11 10:46 ` Eric Miao
@ 2010-05-11 10:48 ` Daniel Mack
0 siblings, 0 replies; 11+ messages in thread
From: Daniel Mack @ 2010-05-11 10:48 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, May 11, 2010 at 06:46:21PM +0800, Eric Miao wrote:
> On Tue, May 11, 2010 at 4:52 PM, Daniel Mack <daniel@caiaq.de> wrote:
> > On Tue, May 11, 2010 at 04:26:56AM +0200, Marek Vasut wrote:
> >> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
> >
> > The rest of this set also looks ok to me.
> >
> > For the future, we should think about having a modularized aproach for
> > these modules just like some mx31 boards have. We would need to split
> > resources on the module from such on the baseboard, so peope can easily
> > add support for a custom base board without touching the module code.
> >
>
> Daniel,
>
> So Ack for this patch or not?
Yes, take my Ack for all of them. The idea I outlined is something TBD
in the future :)
Thanks,
Daniel
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 1/4] pxa/colibri270: Refactor board definition file
2010-05-11 2:26 [PATCH 1/4] pxa/colibri270: Refactor board definition file Marek Vasut
` (3 preceding siblings ...)
2010-05-11 8:48 ` [PATCH 1/4] pxa/colibri270: Refactor board definition file Daniel Mack
@ 2010-05-14 10:37 ` Daniel Mack
2010-05-19 6:36 ` Daniel Mack
4 siblings, 1 reply; 11+ messages in thread
From: Daniel Mack @ 2010-05-14 10:37 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, May 11, 2010 at 04:26:55AM +0200, Marek Vasut wrote:
[...]
> -/*
> - * NOR flash
> - */
> +/******************************************************************************
> + * NOR Flash
> + ******************************************************************************/
> +#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
> static struct mtd_partition colibri_partitions[] = {
> {
> .name = "Bootloader",
> .offset = 0x00000000,
> .size = 0x00040000,
> - .mask_flags = MTD_WRITEABLE /* force read-only */
> + .mask_flags = MTD_WRITEABLE /* force read-only */
> }, {
> .name = "Kernel",
> .offset = 0x00040000,
> @@ -90,42 +93,50 @@ static struct platform_device colibri_pxa270_flash_device = {
> .num_resources = 1,
> };
>
> -/*
> - * DM9000 Ethernet
> - */
> -#if defined(CONFIG_DM9000)
> -static struct resource dm9000_resources[] = {
> +static void __init colibri_pxa270_nor_init(void)
> +{
> + platform_device_register(&colibri_pxa270_flash);
Erm ...
arch/arm/mach-pxa/colibri-pxa270.c: In function 'colibri_pxa270_nor_init':
arch/arm/mach-pxa/colibri-pxa270.c:131: error: 'colibri_pxa270_flash' undeclared (first use in this function)
arch/arm/mach-pxa/colibri-pxa270.c:131: error: (Each undeclared identifier is reported only once
arch/arm/mach-pxa/colibri-pxa270.c:131: error: for each function it appears in.)
make[1]: *** [arch/arm/mach-pxa/colibri-pxa270.o] Error 1
make: *** [arch/arm/mach-pxa] Error 2
make: *** Waiting for unfinished jobs....
Eric, is that patch already queued?
I can send a trivial fix up - or should Marek send a new version of this
patch?
Daniel
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 1/4] pxa/colibri270: Refactor board definition file
2010-05-14 10:37 ` Daniel Mack
@ 2010-05-19 6:36 ` Daniel Mack
2010-05-21 2:36 ` Eric Miao
0 siblings, 1 reply; 11+ messages in thread
From: Daniel Mack @ 2010-05-19 6:36 UTC (permalink / raw)
To: linux-arm-kernel
Any update on this?
On Fri, May 14, 2010 at 12:37:57PM +0200, Daniel Mack wrote:
> On Tue, May 11, 2010 at 04:26:55AM +0200, Marek Vasut wrote:
>
> [...]
>
> > -/*
> > - * NOR flash
> > - */
> > +/******************************************************************************
> > + * NOR Flash
> > + ******************************************************************************/
> > +#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
> > static struct mtd_partition colibri_partitions[] = {
> > {
> > .name = "Bootloader",
> > .offset = 0x00000000,
> > .size = 0x00040000,
> > - .mask_flags = MTD_WRITEABLE /* force read-only */
> > + .mask_flags = MTD_WRITEABLE /* force read-only */
> > }, {
> > .name = "Kernel",
> > .offset = 0x00040000,
> > @@ -90,42 +93,50 @@ static struct platform_device colibri_pxa270_flash_device = {
> > .num_resources = 1,
> > };
> >
> > -/*
> > - * DM9000 Ethernet
> > - */
> > -#if defined(CONFIG_DM9000)
> > -static struct resource dm9000_resources[] = {
> > +static void __init colibri_pxa270_nor_init(void)
> > +{
> > + platform_device_register(&colibri_pxa270_flash);
>
> Erm ...
>
> arch/arm/mach-pxa/colibri-pxa270.c: In function 'colibri_pxa270_nor_init':
> arch/arm/mach-pxa/colibri-pxa270.c:131: error: 'colibri_pxa270_flash' undeclared (first use in this function)
> arch/arm/mach-pxa/colibri-pxa270.c:131: error: (Each undeclared identifier is reported only once
> arch/arm/mach-pxa/colibri-pxa270.c:131: error: for each function it appears in.)
> make[1]: *** [arch/arm/mach-pxa/colibri-pxa270.o] Error 1
> make: *** [arch/arm/mach-pxa] Error 2
> make: *** Waiting for unfinished jobs....
>
> Eric, is that patch already queued?
>
> I can send a trivial fix up - or should Marek send a new version of this
> patch?
>
> Daniel
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 1/4] pxa/colibri270: Refactor board definition file
2010-05-19 6:36 ` Daniel Mack
@ 2010-05-21 2:36 ` Eric Miao
0 siblings, 0 replies; 11+ messages in thread
From: Eric Miao @ 2010-05-21 2:36 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, May 19, 2010 at 2:36 PM, Daniel Mack <daniel@caiaq.de> wrote:
> Any update on this?
>
Fixed by using colibri_pxa270_flash_device instead, looks to be a typo to me.
Updated as below, and let me know if everyone is happy, thanks.
commit d206799c146a4377b99897af360395ea438e6f35
Author: Marek Vasut <marek.vasut@gmail.com>
Date: Tue May 11 04:26:55 2010 +0200
pxa/colibri270: Refactor board definition file
This patch just moves code around and polishes it. Also, compile in only
selected pieces of hardware.
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Reviewed-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
diff --git a/arch/arm/mach-pxa/colibri-pxa270.c
b/arch/arm/mach-pxa/colibri-pxa270.c
index 061c453..f8b3bfb 100644
--- a/arch/arm/mach-pxa/colibri-pxa270.c
+++ b/arch/arm/mach-pxa/colibri-pxa270.c
@@ -3,6 +3,7 @@
*
* Support for Toradex PXA270 based Colibri module
* Daniel Mack <daniel@caiaq.de>
+ * Marek Vasut <marek.vasut@gmail.com>
*
* 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
@@ -36,23 +37,25 @@
#include "generic.h"
#include "devices.h"
-/*
- * GPIO configuration
- */
+/******************************************************************************
+ * Pin configuration
+ ******************************************************************************/
static mfp_cfg_t colibri_pxa270_pin_config[] __initdata = {
+ /* Ethernet */
GPIO78_nCS_2, /* Ethernet CS */
GPIO114_GPIO, /* Ethernet IRQ */
};
-/*
- * NOR flash
- */
+/******************************************************************************
+ * NOR Flash
+ ******************************************************************************/
+#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
static struct mtd_partition colibri_partitions[] = {
{
.name = "Bootloader",
.offset = 0x00000000,
.size = 0x00040000,
- .mask_flags = MTD_WRITEABLE /* force read-only */
+ .mask_flags = MTD_WRITEABLE /* force read-only */
}, {
.name = "Kernel",
.offset = 0x00040000,
@@ -90,42 +93,50 @@ static struct platform_device
colibri_pxa270_flash_device = {
.num_resources = 1,
};
-/*
- * DM9000 Ethernet
- */
-#if defined(CONFIG_DM9000)
-static struct resource dm9000_resources[] = {
+static void __init colibri_pxa270_nor_init(void)
+{
+ platform_device_register(&colibri_pxa270_flash_device);
+}
+#else
+static inline void colibri_pxa270_nor_init(void) {}
+#endif
+
+/******************************************************************************
+ * Ethernet
+ ******************************************************************************/
+#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
+static struct resource colibri_pxa270_dm9000_resources[] = {
[0] = {
- .start = COLIBRI_PXA270_ETH_PHYS,
- .end = COLIBRI_PXA270_ETH_PHYS + 3,
+ .start = PXA_CS2_PHYS,
+ .end = PXA_CS2_PHYS + 3,
.flags = IORESOURCE_MEM,
},
[1] = {
- .start = COLIBRI_PXA270_ETH_PHYS + 4,
- .end = COLIBRI_PXA270_ETH_PHYS + 4 + 500,
+ .start = PXA_CS2_PHYS + 4,
+ .end = PXA_CS2_PHYS + 4 + 500,
.flags = IORESOURCE_MEM,
},
[2] = {
- .start = COLIBRI_PXA270_ETH_IRQ,
- .end = COLIBRI_PXA270_ETH_IRQ,
+ .start = gpio_to_irq(GPIO114_COLIBRI_PXA270_ETH_IRQ),
+ .end = gpio_to_irq(GPIO114_COLIBRI_PXA270_ETH_IRQ),
.flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING,
},
};
-static struct platform_device dm9000_device = {
+static struct platform_device colibri_pxa270_dm9000_device = {
.name = "dm9000",
.id = -1,
- .num_resources = ARRAY_SIZE(dm9000_resources),
- .resource = dm9000_resources,
+ .num_resources = ARRAY_SIZE(colibri_pxa270_dm9000_resources),
+ .resource = colibri_pxa270_dm9000_resources,
};
-#endif /* CONFIG_DM9000 */
-static struct platform_device *colibri_pxa270_devices[] __initdata = {
- &colibri_pxa270_flash_device,
-#if defined(CONFIG_DM9000)
- &dm9000_device,
+static void __init colibri_pxa270_eth_init(void)
+{
+ platform_device_register(&colibri_pxa270_dm9000_device);
+}
+#else
+static inline void colibri_pxa270_eth_init(void) {}
#endif
-};
static void __init colibri_pxa270_init(void)
{
@@ -133,7 +144,9 @@ static void __init colibri_pxa270_init(void)
pxa_set_ffuart_info(NULL);
pxa_set_btuart_info(NULL);
pxa_set_stuart_info(NULL);
- platform_add_devices(ARRAY_AND_SIZE(colibri_pxa270_devices));
+
+ colibri_pxa270_nor_init();
+ colibri_pxa270_eth_init();
}
MACHINE_START(COLIBRI, "Toradex Colibri PXA270")
diff --git a/arch/arm/mach-pxa/include/mach/colibri.h
b/arch/arm/mach-pxa/include/mach/colibri.h
index 5f2ba8d..9e47e1f 100644
--- a/arch/arm/mach-pxa/include/mach/colibri.h
+++ b/arch/arm/mach-pxa/include/mach/colibri.h
@@ -33,13 +33,8 @@ static inline void colibri_pxa3xx_init_nand(void) {}
/* physical memory regions */
#define COLIBRI_SDRAM_BASE 0xa0000000 /* SDRAM region */
-/* definitions for Colibri PXA270 */
-
-#define COLIBRI_PXA270_FLASH_PHYS (PXA_CS0_PHYS) /* Flash region */
-#define COLIBRI_PXA270_ETH_PHYS (PXA_CS2_PHYS) /* Ethernet */
-#define COLIBRI_PXA270_ETH_IRQ_GPIO 114
-#define COLIBRI_PXA270_ETH_IRQ \
- gpio_to_irq(mfp_to_gpio(COLIBRI_PXA270_ETH_IRQ_GPIO))
+/* GPIO definitions for Colibri PXA270 */
+#define GPIO114_COLIBRI_PXA270_ETH_IRQ 114
#endif /* _COLIBRI_H_ */
^ permalink raw reply related [flat|nested] 11+ messages in thread
end of thread, other threads:[~2010-05-21 2:36 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-11 2:26 [PATCH 1/4] pxa/colibri270: Refactor board definition file Marek Vasut
2010-05-11 2:26 ` [PATCH 2/4] pxa/colibri270: Add MMC support Marek Vasut
2010-05-11 8:52 ` Daniel Mack
2010-05-11 10:46 ` Eric Miao
2010-05-11 10:48 ` Daniel Mack
2010-05-11 2:26 ` [PATCH 3/4] pxa/colibri270: Add FFUART MFP Marek Vasut
2010-05-11 2:26 ` [PATCH 4/4] pxa/colibri270: Add UHC support Marek Vasut
2010-05-11 8:48 ` [PATCH 1/4] pxa/colibri270: Refactor board definition file Daniel Mack
2010-05-14 10:37 ` Daniel Mack
2010-05-19 6:36 ` Daniel Mack
2010-05-21 2:36 ` Eric Miao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).