mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Eric Bénard" <eric@eukrea.com>
To: barebox@lists.infradead.org
Subject: [PATCH 08/16] eukrea_cpuimx25: use switch action to launch usbserial or dfu
Date: Thu, 17 May 2012 17:46:10 +0200	[thread overview]
Message-ID: <1337269578-20570-8-git-send-email-eric@eukrea.com> (raw)
In-Reply-To: <1337269578-20570-1-git-send-email-eric@eukrea.com>

Signed-off-by: Eric Bénard <eric@eukrea.com>
---
 arch/arm/boards/eukrea_cpuimx25/env/bin/init_board |   21 ++++++++++++++++++++
 arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c  |    7 ++++++
 arch/arm/configs/eukrea_cpuimx25_defconfig         |   13 +++++++----
 3 files changed, 36 insertions(+), 5 deletions(-)

diff --git a/arch/arm/boards/eukrea_cpuimx25/env/bin/init_board b/arch/arm/boards/eukrea_cpuimx25/env/bin/init_board
index 2199b88..3c4b1ea 100644
--- a/arch/arm/boards/eukrea_cpuimx25/env/bin/init_board
+++ b/arch/arm/boards/eukrea_cpuimx25/env/bin/init_board
@@ -9,6 +9,27 @@ elif [ -f /env/logo.bmp.lzo ]; then
 	fb0.enable=1
 fi
 
+gpio_get_value 82
+if [ $? -eq 0 ]; then
+	gpio_set_value 83 0
+	usbserial
+	timeout -s -a 2
+	gpio_get_value 82
+	if [ $? -eq 0 ]; then
+		usbserial -d
+		dfu -V 0x1234 -P 0x1234 /dev/nand0.barebox.bb(barebox)sr,/dev/nand0.kernel.bb(kernel)r,/dev/nand0.root.bb(root)r
+		gpio_get_value 82
+		if [ $? -eq 0 ]; then
+			usbserial
+			autoboot_timeout=60
+			exit
+		fi
+		reset
+	else
+		autoboot_timeout=28
+	fi
+fi
+
 if [ -z $eth0.ethaddr ]; then
 	while [ -z $eth0.ethaddr ]; do
 		readline "no MAC address set for eth0. please enter the one found on your board: " eth0.ethaddr
diff --git a/arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c b/arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c
index 75a99f7..07a8bc0 100644
--- a/arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c
+++ b/arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c
@@ -216,6 +216,8 @@ static struct pad_desc eukrea_cpuimx25_pads[] = {
 	MX25_PAD_SD1_DATA3__SD1_DATA3,
 	/* LED */
 	MX25_PAD_POWER_FAIL__GPIO_3_19,
+	/* SWITCH */
+	MX25_PAD_VSTBY_ACK__GPIO_3_18,
 };
 
 static int eukrea_cpuimx25_devices_init(void)
@@ -246,6 +248,9 @@ static int eukrea_cpuimx25_devices_init(void)
 	/* LED : default OFF */
 	gpio_direction_output(2 * 32 + 19, 1);
 
+	/* Switch : input */
+	gpio_direction_input(2 * 32 + 18);
+
 	imx25_add_fb(&eukrea_cpuimx25_fb_data);
 
 	imx25_add_i2c0(NULL);
@@ -255,10 +260,12 @@ static int eukrea_cpuimx25_devices_init(void)
 	imx25_usb_init();
 	add_generic_usb_ehci_device(-1, IMX_OTG_BASE + 0x400, NULL);
 #endif
+#ifdef CONFIG_USB_GADGET
 	/* Workaround ENGcm09152 */
 	writel(readl(IMX_OTG_BASE + 0x608) | (1 << 23), IMX_OTG_BASE + 0x608);
 	add_generic_device("fsl-udc", -1, NULL, IMX_OTG_BASE, 0x200,
 			   IORESOURCE_MEM, &usb_pdata);
+#endif
 
 	armlinux_set_bootparams((void *)0x80000100);
 	armlinux_set_architecture(MACH_TYPE_EUKREA_CPUIMX25SD);
diff --git a/arch/arm/configs/eukrea_cpuimx25_defconfig b/arch/arm/configs/eukrea_cpuimx25_defconfig
index b819cfa..32833f8 100644
--- a/arch/arm/configs/eukrea_cpuimx25_defconfig
+++ b/arch/arm/configs/eukrea_cpuimx25_defconfig
@@ -13,6 +13,7 @@ CONFIG_GLOB=y
 CONFIG_HUSH_FANCY_PROMPT=y
 CONFIG_CMDLINE_EDITING=y
 CONFIG_AUTO_COMPLETE=y
+CONFIG_MENU=y
 # CONFIG_CONSOLE_ACTIVATE_FIRST is not set
 CONFIG_CONSOLE_ACTIVATE_ALL=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
@@ -23,11 +24,13 @@ CONFIG_CMD_SAVEENV=y
 CONFIG_CMD_EXPORT=y
 CONFIG_CMD_PRINTENV=y
 CONFIG_CMD_READLINE=y
+CONFIG_CMD_MENU=y
+CONFIG_CMD_MENU_MANAGEMENT=y
+CONFIG_CMD_AUTOMOUNT=y
 CONFIG_CMD_ECHO_E=y
 CONFIG_CMD_LOADB=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_IOMEM=y
-CONFIG_CMD_MD5SUM=y
 CONFIG_CMD_MTEST=y
 CONFIG_CMD_FLASH=y
 CONFIG_CMD_BOOTM_SHOW_TYPE=y
@@ -47,10 +50,8 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_UNCOMPRESS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_LED=y
-CONFIG_CMD_LED_TRIGGER=y
 CONFIG_NET=y
 CONFIG_NET_DHCP=y
-CONFIG_NET_NFS=y
 CONFIG_NET_PING=y
 CONFIG_NET_TFTP=y
 CONFIG_NET_TFTP_PUSH=y
@@ -61,7 +62,11 @@ CONFIG_DRIVER_NET_FEC_IMX=y
 CONFIG_I2C=y
 CONFIG_I2C_IMX=y
 CONFIG_MTD=y
+CONFIG_MTD_RAW_DEVICE=y
 CONFIG_NAND=y
+# CONFIG_NAND_ECC_SOFT is not set
+# CONFIG_NAND_ECC_HW_SYNDROME is not set
+# CONFIG_NAND_ECC_HW_NONE is not set
 CONFIG_NAND_IMX=y
 CONFIG_USB=y
 CONFIG_USB_EHCI=y
@@ -75,8 +80,6 @@ CONFIG_MCI=y
 CONFIG_MCI_IMX_ESDHC=y
 CONFIG_LED=y
 CONFIG_LED_GPIO=y
-CONFIG_LED_TRIGGERS=y
-CONFIG_FS_TFTP=y
 CONFIG_FS_FAT=y
 CONFIG_FS_FAT_WRITE=y
 CONFIG_FS_FAT_LFN=y
-- 
1.7.7.6


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2012-05-17 15:46 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-17 15:46 [PATCH 01/16] eukrea_cpuimx25: workaround ENGcm09152 Eric Bénard
2012-05-17 15:46 ` [PATCH 02/16] eukrea_cpuimx25: add display choice in environment Eric Bénard
2012-05-17 15:46 ` [PATCH 03/16] eukrea_cpuimx25: update defconfig Eric Bénard
2012-05-17 15:46 ` [PATCH 04/16] eukrea_cpuimx35: add display choice in environment Eric Bénard
2012-05-17 15:46 ` [PATCH 05/16] eukrea_cpuimx35: update defconfig Eric Bénard
2012-05-17 15:46 ` [PATCH 06/16] eukrea_cpuimx51: updated env Eric Bénard
2012-05-17 15:46 ` [PATCH 07/16] eukrea_cpuimx51: update defconfig Eric Bénard
2012-05-17 15:46 ` Eric Bénard [this message]
2012-05-17 15:46 ` [PATCH 09/16] eukrea_cpuimx35: use switch action to launch usbserial or dfu Eric Bénard
2012-05-17 15:46 ` [PATCH 10/16] fs/tftp: depend on NET_TFTP Eric Bénard
2012-05-17 17:54   ` Sascha Hauer
2012-05-26  9:43   ` Jean-Christophe PLAGNIOL-VILLARD
2012-05-31 18:24     ` Sascha Hauer
2012-05-17 15:46 ` [PATCH 11/16] iim: don't try to set ethaddr when NET is not selected Eric Bénard
2012-05-17 17:40   ` Sascha Hauer
2012-05-17 15:46 ` [PATCH 12/16] fec_imx: restart aneg at open and not at init Eric Bénard
2012-05-17 17:36   ` Sascha Hauer
2012-05-17 19:32     ` Eric Bénard
2012-05-18  8:40       ` Sascha Hauer
2012-05-17 15:46 ` [PATCH 13/16] eukrea_cpuimx25: fix PHY address Eric Bénard
2012-05-17 15:46 ` [PATCH 14/16] eukrea_cpuimx35: " Eric Bénard
2012-05-17 17:42   ` Sascha Hauer
2012-05-17 19:33     ` Eric Bénard
2012-05-17 15:46 ` [PATCH 15/16] eukrea_cpuimx25&35: update init_board Eric Bénard
2012-05-17 15:46 ` [PATCH 16/16] eukrea_cpuimx25&35: update defconfig Eric Bénard
2012-05-17 17:45   ` Sascha Hauer
2012-05-17 19:34     ` Eric Bénard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1337269578-20570-8-git-send-email-eric@eukrea.com \
    --to=eric@eukrea.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox