Skip to contentSkip to conversation

mx53 update

PATCH New Jean-Christophe PLAGNIOL-VILLARD 1 participant 5 messages Dec 5, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mx53 update

HI,

this patch update the mx53 support
by fixing mmc devid
add card detect support and add smd board support

The following changes since commit 088afefa32a43bd7da80ed3c0a8cebb2c0f72ba7:

mci: add the probe parameter if any error happened during the probe (2011-12-04 00:12:22 +0800)

are available in the git repository at:
git ..BRANCH.NOT.VERIFIED..

Jean-Christophe PLAGNIOL-VILLARD (4):
mx53: fix devid for imx53_add_mmc1/2
imx-esdhc: add support of card detect
mx53 loco: update sd support
imx: add mx53 SMD board support

 arch/arm/Makefile                                 |    1 +
 arch/arm/boards/freescale-mx53-loco/board.c       |   36 +++++-
 arch/arm/boards/freescale-mx53-smd/Makefile       |    2 +
 arch/arm/boards/freescale-mx53-smd/board.c        |  170 +++++++++++++++++++++
 arch/arm/boards/freescale-mx53-smd/config.h       |   24 +++
 arch/arm/boards/freescale-mx53-smd/env/config     |   51 ++++++
 arch/arm/boards/freescale-mx53-smd/flash_header.c |  101 ++++++++++++
 arch/arm/boards/freescale-mx53-smd/mx53-smd.dox   |    4 +
 arch/arm/configs/freescale_mx53_smd_defconfig     |   51 ++++++
 arch/arm/mach-imx/Kconfig                         |    5 +
 arch/arm/mach-imx/devices.c                       |    2 +-
 arch/arm/mach-imx/include/mach/devices-imx25.h    |    2 +-
 arch/arm/mach-imx/include/mach/devices-imx35.h    |    6 +-
 arch/arm/mach-imx/include/mach/devices-imx51.h    |    4 +-
 arch/arm/mach-imx/include/mach/devices-imx53.h    |   15 ++-
 arch/arm/mach-imx/include/mach/devices.h          |    3 +-
 arch/arm/mach-imx/include/mach/esdhc.h            |   43 +++++
 drivers/mci/imx-esdhc.c                           |   37 +++++
 18 files changed, 543 insertions(+), 14 deletions(-)
 create mode 100644 arch/arm/boards/freescale-mx53-smd/Makefile
 create mode 100644 arch/arm/boards/freescale-mx53-smd/board.c
 create mode 100644 arch/arm/boards/freescale-mx53-smd/config.h
 create mode 100644 arch/arm/boards/freescale-mx53-smd/env/config
 create mode 100644 arch/arm/boards/freescale-mx53-smd/flash_header.c
 create mode 100644 arch/arm/boards/freescale-mx53-smd/mx53-smd.dox
 create mode 100644 arch/arm/configs/freescale_mx53_smd_defconfig
 create mode 100644 arch/arm/mach-imx/include/mach/esdhc.h

Best Regards,
J.

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#1 lore raw

PATCH 1/4 mx53: fix devid for imx53_add_mmc1/2

---
 arch/arm/mach-imx/include/mach/devices-imx53.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-imx/include/mach/devices-imx53.h +2 -2
index 70e7671..bc32048 100644
@@ -43,12 +43,12 @@ static inline struct device_d *imx53_add_mmc0(void *pdata)
 
 static inline struct device_d *imx53_add_mmc1(void *pdata)
 {
-	return imx_add_esdhc((void *)MX53_ESDHC2_BASE_ADDR, 0, pdata);
+	return imx_add_esdhc((void *)MX53_ESDHC2_BASE_ADDR, 1, pdata);
 }
 
 static inline struct device_d *imx53_add_mmc2(void *pdata)
 {
-	return imx_add_esdhc((void *)MX53_ESDHC3_BASE_ADDR, 0, pdata);
+	return imx_add_esdhc((void *)MX53_ESDHC3_BASE_ADDR, 2, pdata);
 }
 
 static inline struct device_d *imx53_add_nand(struct imx_nand_platform_data *pdata)
Signature · 7 lines
1.7.7


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

PATCH 2/4 imx-esdhc: add support of card detect

In reply to Jean-Christophe PLAGNIOL-VILLARD
---
 arch/arm/mach-imx/devices.c                    |    2 +-
 arch/arm/mach-imx/include/mach/devices-imx25.h |    2 +-
 arch/arm/mach-imx/include/mach/devices-imx35.h |    6 ++--
 arch/arm/mach-imx/include/mach/devices-imx51.h |    4 +-
 arch/arm/mach-imx/include/mach/devices-imx53.h |    6 ++--
 arch/arm/mach-imx/include/mach/devices.h       |    3 +-
 arch/arm/mach-imx/include/mach/esdhc.h         |   43 ++++++++++++++++++++++++
 drivers/mci/imx-esdhc.c                        |   37 ++++++++++++++++++++
 8 files changed, 92 insertions(+), 11 deletions(-)
 create mode 100644 arch/arm/mach-imx/include/mach/esdhc.h
arch/arm/mach-imx/devices.c +1 -1
index 5b062f5..6cd50f3 100644
@@ -48,7 +48,7 @@ struct device_d *imx_add_mmc(void *base, int id, void *pdata)
 	return imx_add_device("imx-mmc", id, base, 0x1000, pdata);
 }
 
-struct device_d *imx_add_esdhc(void *base, int id, void *pdata)
+struct device_d *imx_add_esdhc(void *base, int id, struct esdhc_platform_data *pdata)
 {
 	return imx_add_device("imx-esdhc", id, base, 0x1000, pdata);
 }
arch/arm/mach-imx/include/mach/devices-imx25.h +1 -1
index eff5977..bd9dd0a 100644
@@ -36,7 +36,7 @@ static inline struct device_d *imx25_add_fec(struct fec_platform_data *pdata)
 	return imx_add_fec((void *)IMX_FEC_BASE, pdata);
 }
 
-static inline struct device_d *imx25_add_mmc0(void *pdata)
+static inline struct device_d *imx25_add_mmc0(struct esdhc_platform_data *pdata)
 {
 	return imx_add_esdhc((void *)0x53fb4000, 0, pdata);
 }
arch/arm/mach-imx/include/mach/devices-imx35.h +3 -3
index 69f4b36..6c0d750 100644
@@ -41,17 +41,17 @@ static inline struct device_d *imx35_add_fec(struct fec_platform_data *pdata)
 	return imx_add_fec((void *)IMX_FEC_BASE, pdata);
 }
 
-static inline struct device_d *imx35_add_mmc0(void *pdata)
+static inline struct device_d *imx35_add_mmc0(struct esdhc_platform_data *pdata)
 {
 	return imx_add_esdhc((void *)IMX_SDHC1_BASE, 0, pdata);
 }
 
-static inline struct device_d *imx35_add_mmc1(void *pdata)
+static inline struct device_d *imx35_add_mmc1(struct esdhc_platform_data *pdata)
 {
 	return imx_add_esdhc((void *)IMX_SDHC2_BASE, 1, pdata);
 }
 
-static inline struct device_d *imx35_add_mmc2(void *pdata)
+static inline struct device_d *imx35_add_mmc2(struct esdhc_platform_data *pdata)
 {
 	return imx_add_esdhc((void *)IMX_SDHC3_BASE, 2, pdata);
 }
arch/arm/mach-imx/include/mach/devices-imx51.h +2 -2
index 23410a9..d9bed8c 100644
@@ -42,12 +42,12 @@ static inline struct device_d *imx51_add_fec(struct fec_platform_data *pdata)
 	return imx_add_fec((void *)MX51_MXC_FEC_BASE_ADDR, pdata);
 }
 
-static inline struct device_d *imx51_add_mmc0(void *pdata)
+static inline struct device_d *imx51_add_mmc0(struct esdhc_platform_data *pdata)
 {
 	return imx_add_esdhc((void *)MX51_MMC_SDHC1_BASE_ADDR, 0, pdata);
 }
 
-static inline struct device_d *imx51_add_mmc1(void *pdata)
+static inline struct device_d *imx51_add_mmc1(struct esdhc_platform_data *pdata)
 {
 	return imx_add_esdhc((void *)MX51_MMC_SDHC2_BASE_ADDR, 1, pdata);
 }
arch/arm/mach-imx/include/mach/devices-imx53.h +3 -3
index bc32048..bc01420 100644
@@ -36,17 +36,17 @@ static inline struct device_d *imx53_add_fec(struct fec_platform_data *pdata)
 	return imx_add_fec((void *)MX53_FEC_BASE_ADDR, pdata);
 }
 
-static inline struct device_d *imx53_add_mmc0(void *pdata)
+static inline struct device_d *imx53_add_mmc0(struct esdhc_platform_data *pdata)
 {
 	return imx_add_esdhc((void *)MX53_ESDHC1_BASE_ADDR, 0, pdata);
 }
 
-static inline struct device_d *imx53_add_mmc1(void *pdata)
+static inline struct device_d *imx53_add_mmc1(struct esdhc_platform_data *pdata)
 {
 	return imx_add_esdhc((void *)MX53_ESDHC2_BASE_ADDR, 1, pdata);
 }
 
-static inline struct device_d *imx53_add_mmc2(void *pdata)
+static inline struct device_d *imx53_add_mmc2(struct esdhc_platform_data *pdata)
 {
 	return imx_add_esdhc((void *)MX53_ESDHC3_BASE_ADDR, 2, pdata);
 }
arch/arm/mach-imx/include/mach/devices.h +2 -1
index 7338ac5..f0f730a 100644
@@ -5,6 +5,7 @@
 #include <mach/imx-nand.h>
 #include <mach/imxfb.h>
 #include <mach/imx-ipu-fb.h>
+#include <mach/esdhc.h>
 
 struct device_d *imx_add_fec(void *base, struct fec_platform_data *pdata);
 struct device_d *imx_add_spi(void *base, int id, struct spi_imx_master *pdata);
@@ -14,5 +15,5 @@ struct device_d *imx_add_nand(void *base, struct imx_nand_platform_data *pdata);
 struct device_d *imx_add_fb(void *base, struct imx_fb_platform_data *pdata);
 struct device_d *imx_add_ipufb(void *base, struct imx_ipu_fb_platform_data *pdata);
 struct device_d *imx_add_mmc(void *base, int id, void *pdata);
-struct device_d *imx_add_esdhc(void *base, int id, void *pdata);
+struct device_d *imx_add_esdhc(void *base, int id, struct esdhc_platform_data *pdata);
 
arch/arm/mach-imx/include/mach/esdhc.h new file +43 -0

43 lines not on this page · raw message

drivers/mci/imx-esdhc.c +37 -0
index a0e61f0..af9a1dd 100644
@@ -36,6 +36,8 @@
 #include <asm/mmu.h>
 #include <mach/clock.h>
 #include <mach/generic.h>
+#include <mach/esdhc.h>
+#include <gpio.h>
 
 #include "imx-esdhc.h"
 
@@ -391,6 +393,31 @@ static void esdhc_set_ios(struct mci_host *mci, struct device_d *dev,
 
 }
 
+static int esdhc_card_detect(struct fsl_esdhc_host *host)
+{
+	struct fsl_esdhc *regs = host->regs;
+	struct esdhc_platform_data *pdata = host->dev->platform_data;
+	int ret;
+
+	if (!pdata)
+		return 1;
+
+	switch (pdata->cd_type) {
+	case ESDHC_CD_NONE:
+	case ESDHC_CD_PERMANENT:
+		return 1;
+	case ESDHC_CD_CONTROLLER:
+		return !(esdhc_read32(&regs->prsstat) & PRSSTAT_WPSPL);
+	case ESDHC_CD_GPIO:
+		ret = gpio_direction_input(pdata->cd_gpio);
+		if (ret)
+			return ret;
+		return gpio_get_value(pdata->cd_gpio) ? 0 : 1;
+	}
+
+	return 0;
+}
+
 static int esdhc_init(struct mci_host *mci, struct device_d *dev)
 {
 	struct fsl_esdhc_host *host = to_fsl_esdhc(mci);
@@ -398,6 +425,16 @@ static int esdhc_init(struct mci_host *mci, struct device_d *dev)
 	int timeout = 1000;
 	int ret = 0;
 
+	ret = esdhc_card_detect(host);
+
+	if (ret == 0)
+		return -ENODEV;
+
+	if (ret < 0)
+		return ret;
+
+	ret = 0;
+
 	/* Enable cache snooping */
 	if (host && !host->no_snoop)
 		esdhc_write32(&regs->scr, 0x00000040);
Signature · 7 lines
1.7.7


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#3 lore raw

PATCH 3/4 mx53 loco: update sd support

In reply to Jean-Christophe PLAGNIOL-VILLARD

update to use card detect
add sd3 card support

---
 arch/arm/boards/freescale-mx53-loco/board.c |   36 ++++++++++++++++++++++++++-
 1 files changed, 35 insertions(+), 1 deletions(-)
arch/arm/boards/freescale-mx53-loco/board.c +35 -1
index 6a5ef37..aec2254 100644
@@ -72,6 +72,22 @@ static struct pad_desc loco_pads[] = {
 	MX53_PAD_SD1_DATA3__ESDHC1_DAT3,
 	/* SD1_CD */
 	MX53_PAD_EIM_DA13__GPIO3_13,
+
+	/* SD3 */
+	MX53_PAD_PATA_DATA8__ESDHC3_DAT0,
+	MX53_PAD_PATA_DATA9__ESDHC3_DAT1,
+	MX53_PAD_PATA_DATA10__ESDHC3_DAT2,
+	MX53_PAD_PATA_DATA11__ESDHC3_DAT3,
+	MX53_PAD_PATA_DATA0__ESDHC3_DAT4,
+	MX53_PAD_PATA_DATA1__ESDHC3_DAT5,
+	MX53_PAD_PATA_DATA2__ESDHC3_DAT6,
+	MX53_PAD_PATA_DATA3__ESDHC3_DAT7,
+	MX53_PAD_PATA_IORDY__ESDHC3_CLK,
+	MX53_PAD_PATA_RESET_B__ESDHC3_CMD,
+	/* SD3_CD */
+	MX53_PAD_EIM_DA11__GPIO3_11,
+	/* SD3_WP */
+	MX53_PAD_EIM_DA12__GPIO3_12,
 };
 
 static int loco_mem_init(void)
@@ -92,11 +108,29 @@ static void loco_fec_reset(void)
 	gpio_set_value(LOCO_FEC_PHY_RST, 1);
 }
 
+#define LOCO_SD3_CD			IMX_GPIO_NR(3, 11)
+#define LOCO_SD3_WP			IMX_GPIO_NR(3, 12)
+#define LOCO_SD1_CD			IMX_GPIO_NR(3, 13)
+
+static struct esdhc_platform_data loco_sd1_data = {
+	.cd_gpio = LOCO_SD1_CD,
+	.cd_type = ESDHC_CD_GPIO,
+	.wp_type = ESDHC_WP_NONE,
+};
+
+static struct esdhc_platform_data loco_sd3_data = {
+	.cd_gpio = LOCO_SD3_CD,
+	.wp_gpio = LOCO_SD3_WP,
+	.cd_type = ESDHC_CD_GPIO,
+	.wp_type = ESDHC_WP_GPIO,
+};
+
 static int loco_devices_init(void)
 {
 	imx51_iim_register_fec_ethaddr();
 	imx53_add_fec(&fec_info);
-	imx53_add_mmc0(NULL);
+	imx53_add_mmc0(&loco_sd1_data);
+	imx53_add_mmc2(&loco_sd3_data);
 
 	loco_fec_reset();
 
Signature · 7 lines
1.7.7


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#4 lore raw

PATCH 4/4 imx: add mx53 SMD board support

In reply to Jean-Christophe PLAGNIOL-VILLARD

with:

- uarts
- sd and emmc
- fec

---
 arch/arm/Makefile                                 |    1 +
 arch/arm/boards/freescale-mx53-smd/Makefile       |    2 +
 arch/arm/boards/freescale-mx53-smd/board.c        |  170 +++++++++++++++++++++
 arch/arm/boards/freescale-mx53-smd/config.h       |   24 +++
 arch/arm/boards/freescale-mx53-smd/env/config     |   51 ++++++
 arch/arm/boards/freescale-mx53-smd/flash_header.c |  101 ++++++++++++
 arch/arm/boards/freescale-mx53-smd/mx53-smd.dox   |    4 +
 arch/arm/configs/freescale_mx53_smd_defconfig     |   51 ++++++
 arch/arm/mach-imx/Kconfig                         |    5 +
 arch/arm/mach-imx/include/mach/devices-imx53.h    |    5 +
 10 files changed, 414 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boards/freescale-mx53-smd/Makefile
 create mode 100644 arch/arm/boards/freescale-mx53-smd/board.c
 create mode 100644 arch/arm/boards/freescale-mx53-smd/config.h
 create mode 100644 arch/arm/boards/freescale-mx53-smd/env/config
 create mode 100644 arch/arm/boards/freescale-mx53-smd/flash_header.c
 create mode 100644 arch/arm/boards/freescale-mx53-smd/mx53-smd.dox
 create mode 100644 arch/arm/configs/freescale_mx53_smd_defconfig
arch/arm/Makefile +1 -0
index 0c42f3d..d2e5378 100644
@@ -103,6 +103,7 @@ board-$(CONFIG_MACH_CHUMBY)			:= chumby_falconwing
 board-$(CONFIG_MACH_TX28)			:= karo-tx28
 board-$(CONFIG_MACH_FREESCALE_MX51_PDK)		:= freescale-mx51-pdk
 board-$(CONFIG_MACH_FREESCALE_MX53_LOCO)	:= freescale-mx53-loco
+board-$(CONFIG_MACH_FREESCALE_MX53_SMD)		:= freescale-mx53-smd
 board-$(CONFIG_MACH_GUF_CUPID)			:= guf-cupid
 board-$(CONFIG_MACH_MINI2440)			:= mini2440
 board-$(CONFIG_MACH_USB_A9260)			:= usb-a926x
arch/arm/boards/freescale-mx53-smd/Makefile new file +2 -0
new file mode 100644
index 0000000..b56ce7f
@@ -0,0 +1,2 @@
+obj-y += board.o
+obj-y += flash_header.o
arch/arm/boards/freescale-mx53-smd/board.c new file +170 -0

170 lines not on this page · raw message

arch/arm/boards/freescale-mx53-smd/config.h new file +24 -0
new file mode 100644
index 0000000..b7effe5
@@ -0,0 +1,24 @@
+/**
+ * @file
+ * @brief Global defintions for the ARM i.MX51 based babbage board
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#endif	/* __CONFIG_H */
arch/arm/boards/freescale-mx53-smd/env/config new file +51 -0

51 lines not on this page · raw message

arch/arm/boards/freescale-mx53-smd/flash_header.c new file +101 -0

101 lines not on this page · raw message

arch/arm/boards/freescale-mx53-smd/mx53-smd.dox new file +4 -0
new file mode 100644
index 0000000..1960508
@@ -0,0 +1,4 @@
+/** @page board_loco Freescale i.MX53 SMD Board
+
+
+*/
arch/arm/configs/freescale_mx53_smd_defconfig new file +51 -0

51 lines not on this page · raw message

arch/arm/mach-imx/Kconfig +5 -0
index 984d9dc..726920f 100644
@@ -20,6 +20,7 @@ config ARCH_TEXT_BASE
 	default 0xa7e00000 if MACH_NESO
 	default 0x97f00000 if MACH_MX51_PDK
 	default 0x7ff00000 if MACH_MX53_LOCO
+	default 0x7ff00000 if MACH_MX53_SMD
 	default 0x87f00000 if MACH_GUF_CUPID
 	default 0x93d00000 if MACH_TX25
 
@@ -40,6 +41,7 @@ config BOARDINFO
 	default "Garz+Fricke Neso" if MACH_NESO
 	default "Freescale i.MX51 PDK" if MACH_FREESCALE_MX51_PDK
 	default "Freescale i.MX53 LOCO" if MACH_FREESCALE_MX53_LOCO
+	default "Freescale i.MX53 SMD" if MACH_FREESCALE_MX53_SMD
 	default "Garz+Fricke Cupid" if MACH_GUF_CUPID
 	default "Ka-Ro tx25" if MACH_TX25
 
@@ -402,6 +404,9 @@ choice
 config MACH_FREESCALE_MX53_LOCO
 	bool "Freescale i.MX53 LOCO"
 
+config MACH_FREESCALE_MX53_SMD
+	bool "Freescale i.MX53 SMD"
+
 endchoice
 
 endif
arch/arm/mach-imx/include/mach/devices-imx53.h +5 -0
index bc01420..1fc2417 100644
@@ -31,6 +31,11 @@ static inline struct device_d *imx53_add_uart1(void)
 	return imx_add_uart((void *)MX53_UART2_BASE_ADDR, 1);
 }
 
+static inline struct device_d *imx53_add_uart2(void)
+{
+	return imx_add_uart((void *)MX53_UART3_BASE_ADDR, 2);
+}
+
 static inline struct device_d *imx53_add_fec(struct fec_platform_data *pdata)
 {
 	return imx_add_fec((void *)MX53_FEC_BASE_ADDR, pdata);
Signature · 7 lines
1.7.7


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox