[Armadeus-commitlog] armadeus branch, master, updated. release-3.2-66-gcfe393f
Brought to you by:
sszy
|
From: Julien B a. A. <ar...@us...> - 2009-12-19 18:39:29
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via cfe393fb8913d5ab2c93326cabff9c3f34994abc (commit)
via d4fbc437b5ffbaf8f9d8f85fb627de0f2dfef8fa (commit)
via b7fb09812f5fe6bb7f86face8ab3eb80dd38a4e6 (commit)
from 26a5a427520259cbccb2fbb0c719431bc2e7ad00 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit cfe393fb8913d5ab2c93326cabff9c3f34994abc
Author: Julien Boibessot <jul...@ar...>
Date: Sat Dec 19 19:38:13 2009 +0100
[LINUX] On APF27 I2C1 bus configuration is baseboard specific, so move it from apf27.c to apf27-dev.c
commit d4fbc437b5ffbaf8f9d8f85fb627de0f2dfef8fa
Author: Julien Boibessot <jul...@ar...>
Date: Fri Dec 18 17:25:40 2009 +0100
[TEST] Rename mmc_perf.sh to media_perf.sh
commit b7fb09812f5fe6bb7f86face8ab3eb80dd38a4e6
Author: Julien Boibessot <jul...@ar...>
Date: Fri Dec 18 16:41:54 2009 +0100
[TEST] Makes mmc_perf.sh usable with USB keys
-----------------------------------------------------------------------
Summary of changes:
.../2.6.29/281-apf27-armadeus-add_apf27.c.patch | 118 +++++++--------
.../2.6.29/344-apf27-spi_configuration.patch | 20 ++--
target/test/mmc/{mmc_perf.sh => media_perf.sh} | 154 ++++++++++++--------
target/test/test_release.sh | 2 +-
4 files changed, 158 insertions(+), 136 deletions(-)
rename target/test/mmc/{mmc_perf.sh => media_perf.sh} (54%)
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/281-apf27-armadeus-add_apf27.c.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/281-apf27-armadeus-add_apf27.c.patch
index 13909e1..16b3f0a 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/281-apf27-armadeus-add_apf27.c.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/281-apf27-armadeus-add_apf27.c.patch
@@ -9,8 +9,8 @@ Signed-off-by: Eric Jarrige <eri...@ar...>
Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.29.6/arch/arm/mach-mx2/apf27.c 2009-12-16 11:43:30.000000000 +0100
-@@ -0,0 +1,745 @@
++++ linux-2.6.29.6/arch/arm/mach-mx2/apf27.c 2009-12-18 17:40:22.000000000 +0100
+@@ -0,0 +1,712 @@
+ /*
+ * apf27.c
+ *
@@ -83,12 +83,6 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27.c
+extern void apf27_lcd_startup(void);
+#endif
+
-+#ifdef CONFIG_VIDEO_MX27_MODULE
-+#define CONFIG_VIDEO_MX27 1
-+#endif
-+#ifdef CONFIG_VIDEO_OV96xx_MODULE
-+#define CONFIG_VIDEO_OV96xx 1
-+#endif
+#ifdef CONFIG_ARMADEUS_PWM_DRIVER_MODULE
+#define CONFIG_PWM
+#endif
@@ -117,38 +111,15 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27.c
+#endif
+
+
-+/*
-+ * APF27 has a Micron 128MiB 1,8V NAND flash, 16 bits width
-+ */
++/* APF27 has a Micron 128MiB 1,8V NAND flash, 16 bits width */
+static struct mxc_nand_platform_data apf27_nand_board_info = {
+ .width = 2,
+ .hw_ecc = 1,
+};
+
+
++/* APF27 has an I2C EEPROM on I2C2 Bus */
+#ifdef CONFIG_I2C
-+static int mxc_i2c0_pins[] = {
-+ PD17_PF_I2C_DATA,
-+ PD18_PF_I2C_CLK
-+};
-+
-+static int apf27_i2c_0_init(struct platform_device *pdev)
-+{
-+ return mxc_gpio_setup_multiple_pins(mxc_i2c0_pins, ARRAY_SIZE(mxc_i2c0_pins), "I2C0");
-+}
-+
-+static int apf27_i2c_0_exit(struct platform_device *pdev)
-+{
-+ mxc_gpio_release_multiple_pins(mxc_i2c0_pins, ARRAY_SIZE(mxc_i2c0_pins));
-+ return 0;
-+}
-+
-+static struct imx_i2c_platform_data apf27_i2c_0_data = {
-+ .max_clk = 400000,
-+ .init = apf27_i2c_0_init,
-+ .exit = apf27_i2c_0_exit,
-+};
-+
+static int mxc_i2c1_pins[] = {
+ PC5_PF_I2C2_SDA,
+ PC6_PF_I2C2_SCL
@@ -156,7 +127,8 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27.c
+
+static int apf27_i2c_1_init(struct platform_device *pdev)
+{
-+ return mxc_gpio_setup_multiple_pins(mxc_i2c1_pins, ARRAY_SIZE(mxc_i2c1_pins), "I2C1");
++ return mxc_gpio_setup_multiple_pins(mxc_i2c1_pins, ARRAY_SIZE(mxc_i2c1_pins),
++ "I2C2");
+}
+
+static int apf27_i2c_1_exit(struct platform_device *pdev)
@@ -171,12 +143,11 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27.c
+ .exit = apf27_i2c_1_exit,
+};
+
-+/* APF27 has an I2C EEPROM */
+static struct i2c_board_info apf27_i2c_devices_bus1[] = {
+ [0] = {
+ .type = "24c02",
-+ .flags = 0, /* FIXME */
-+ .addr = 0x50, /* E0=0, E1=1, E2=0 */
++ .flags = 0,
++ .addr = 0x50,
+ .platform_data = NULL,
+ .irq = 0
+ },
@@ -184,6 +155,7 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27.c
+#endif /* CONFIG_I2C */
+
+
++/* APF27 has an RS232 debug port/console on UART1 with "on module" transceiver */
+static int mxc_uart0_pins[] = {
+ PE12_PF_UART1_TXD,
+ PE13_PF_UART1_RXD
@@ -207,6 +179,7 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27.c
+ .flags = 0,
+};
+
++/* APF27 has an "on module" transceiver for UART3 */
+static int mxc_uart2_pins[] = {
+ PE8_PF_UART3_TXD,
+ PE9_PF_UART3_RXD,
@@ -238,6 +211,7 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27.c
+#endif
+};
+
++
+/* APF27 has an onboard Ethernet PHY */
+#ifdef CONFIG_FEC_OLD
+static int mxc_fec_pins[] = {
@@ -265,11 +239,6 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27.c
+{
+ mxc_gpio_setup_multiple_pins(mxc_fec_pins, ARRAY_SIZE(mxc_fec_pins), "FEC");
+}
-+
-+/* static void gpio_fec_inactive(void)
-+{
-+ mxc_gpio_release_multiple_pins(mxc_fec_pins, ARRAY_SIZE(mxc_fec_pins));
-+} */
+#endif /* CONFIG_FEC_OLD */
+
+
@@ -688,7 +657,7 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27.c
+#ifdef CONFIG_FEC_OLD
+ gpio_fec_active();
+#endif
-+ /* UART1 and UART3 have "on module" tranceivers */
++ /* UART1 and UART3 have "on module" transceivers */
+ mxc_register_device(&mxc_uart_device0, &uart0_pdata); /* console */
+ mxc_register_device(&mxc_uart_device2, &uart2_pdata);
+
@@ -704,9 +673,7 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27.c
+ mxc_register_device(&mxc_otg, &ehci0_pdata);
+#endif
+#ifdef CONFIG_I2C
-+ mxc_register_device(&imx_i2c_device0, &apf27_i2c_0_data);
+ mxc_register_device(&imx_i2c_device1, &apf27_i2c_1_data);
-+
+ i2c_register_board_info(1, apf27_i2c_devices_bus1,
+ ARRAY_SIZE(apf27_i2c_devices_bus1));
+#endif
@@ -759,8 +726,8 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27.c
Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev.c 2009-12-16 12:07:58.000000000 +0100
-@@ -0,0 +1,1034 @@
++++ linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev.c 2009-12-18 19:29:16.000000000 +0100
+@@ -0,0 +1,1063 @@
+ /*
+ * apf27-dev.c
+ * Support for AFP27 module's development baseboard
@@ -878,7 +845,32 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev.c
+
+#ifdef CONFIG_I2C
+
-+/* I2C1 devices */
++/* APF27Dev makes I2C1 bus available */
++static int mxc_i2c0_pins[] = {
++ PD17_PF_I2C_DATA,
++ PD18_PF_I2C_CLK
++};
++
++static int apf27_i2c_0_init(struct platform_device *pdev)
++{
++ return mxc_gpio_setup_multiple_pins(mxc_i2c0_pins, ARRAY_SIZE(mxc_i2c0_pins),
++ "I2C1");
++}
++
++static int apf27_i2c_0_exit(struct platform_device *pdev)
++{
++ mxc_gpio_release_multiple_pins(mxc_i2c0_pins, ARRAY_SIZE(mxc_i2c0_pins));
++
++ return 0;
++}
++
++static struct imx_i2c_platform_data apf27_i2c_0_data = {
++ .max_clk = 400000,
++ .init = apf27_i2c_0_init,
++ .exit = apf27_i2c_0_exit,
++};
++
++/* I2C1 devices: RTC & Optionnal Camera */
+static struct i2c_board_info apf27dev_i2c_devices_bus0[] = {
+ [0] = {
+ /* APF27Dev has an RTC */
@@ -900,7 +892,7 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev.c
+};
+
+
-+/* APF27Dev contains an optionnal HDMI video output (I2C controlled) */
++/* APF27Dev has an optionnal HDMI video output (controlled with I2C2) */
+# ifdef CONFIG_VIDEO_AD9889
+#define AD9889_INT 15
+
@@ -910,12 +902,14 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev.c
+
+static int ad9889_init(void)
+{
-+ return mxc_gpio_setup_multiple_pins(ad9889_pins, ARRAY_SIZE(ad9889_pins), "AD9889");
++ return mxc_gpio_setup_multiple_pins(ad9889_pins, ARRAY_SIZE(ad9889_pins),
++ "AD9889");
+}
+
+static int ad9889_exit(void)
+{
+ mxc_gpio_release_multiple_pins(ad9889_pins, ARRAY_SIZE(ad9889_pins));
++
+ return 0;
+}
+
@@ -998,7 +992,6 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev.c
+};
+# endif /* CONFIG_VIDEO_AD9889 */
+
-+
+/* I2C2 devices */
+static struct i2c_board_info apf27dev_i2c_devices_bus1[] = {
+# ifdef CONFIG_VIDEO_AD9889
@@ -1188,7 +1181,7 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev.c
+#endif /* CONFIG_SPI */
+
+
-+/* APF27Dev has an optionnal 7 channels 10 bits ADC (SPI) */
++/* APF27Dev has an optionnal 7 channels 10 bits ADC (SPI1) */
+#ifdef CONFIG_ARMADEUS_MAX1027
+#define MAX1027_EOC_INT 15
+#define MAX1027_CNVST 14
@@ -1253,12 +1246,14 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev.c
+ /* Initialize CS high */
+ gpio_set_value(TSC2101_CS, 1);
+
-+ return mxc_gpio_setup_multiple_pins(tsc2101_pins, ARRAY_SIZE(tsc2101_pins), "TSC2101");
++ return mxc_gpio_setup_multiple_pins(tsc2101_pins, ARRAY_SIZE(tsc2101_pins),
++ "TSC2101");
+}
+
+static int tsc2101_init_fixed_gpio(void)
+{
-+ return mxc_gpio_setup_multiple_pins(tsc2101_fixed_pins, ARRAY_SIZE(tsc2101_fixed_pins), "TSC2101");
++ return mxc_gpio_setup_multiple_pins(tsc2101_fixed_pins,
++ ARRAY_SIZE(tsc2101_fixed_pins), "TSC2101");
+}
+
+static void tsc2101_release_gpio(void)
@@ -1294,7 +1289,7 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev.c
+#define MCP251X_CS (GPIO_PORTD | 20)
+
+static int mcp251x_pins[] = {
-+ (GPIO_PORTD | CAN_MCP251X_INT | GPIO_IN | GPIO_GPIO), /* configure int pin as GPIO */
++ (GPIO_PORTD | CAN_MCP251X_INT | GPIO_IN | GPIO_GPIO), /* IRQ pin as GPIO */
+ (MCP251X_CS | GPIO_OUT | GPIO_GPIO),
+};
+
@@ -1666,10 +1661,10 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev.c
+
+/* APF27Dev power management stuff */
+
-+#define APF27DEV_USER_SWITCH (GPIO_PORTF | 13)
-+#define APF27DEV_USER_SWITCH_IRQ (IRQ_GPIOF(13))
-+#define APF27DEV_USER_LED (GPIO_PORTF | 14)
-+#define APF27DEV_POWER_DOWN_NOT (GPIO_PORTF | 16)
++#define APF27DEV_USER_SWITCH (GPIO_PORTF | 13)
++#define APF27DEV_USER_SWITCH_IRQ (IRQ_GPIOF(13))
++#define APF27DEV_USER_LED (GPIO_PORTF | 14)
++#define APF27DEV_POWER_DOWN_NOT (GPIO_PORTF | 16)
+
+static int apf27dev_pwr_ctl_pins[] = {
+ (APF27DEV_POWER_DOWN_NOT | GPIO_OUT | GPIO_GPIO),
@@ -1758,6 +1753,7 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev.c
+ mxc_register_device(&mxc_ehci1, &ehci1_pdata);
+#endif
+#ifdef CONFIG_I2C
++ mxc_register_device(&imx_i2c_device0, &apf27_i2c_0_data);
+ i2c_register_board_info(0, apf27dev_i2c_devices_bus0,
+ ARRAY_SIZE(apf27dev_i2c_devices_bus0));
+ i2c_register_board_info(1, apf27dev_i2c_devices_bus1,
@@ -1798,7 +1794,7 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev.c
Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27-lcd.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.29.6/arch/arm/mach-mx2/apf27-lcd.c 2009-12-15 09:32:01.000000000 +0100
++++ linux-2.6.29.6/arch/arm/mach-mx2/apf27-lcd.c 2009-12-18 16:55:09.000000000 +0100
@@ -0,0 +1,220 @@
+/*
+ * apf27-lcd.c
@@ -2023,7 +2019,7 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27-lcd.c
Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev-ext-apw.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev-ext-apw.c 2009-12-16 12:07:45.000000000 +0100
++++ linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev-ext-apw.c 2009-12-18 16:55:09.000000000 +0100
@@ -0,0 +1,159 @@
+ /*
+ * apf27-dev-ext-apw.c
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/344-apf27-spi_configuration.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/344-apf27-spi_configuration.patch
index 34eebf0..d468ee4 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/344-apf27-spi_configuration.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/344-apf27-spi_configuration.patch
@@ -1,9 +1,9 @@
Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev.c
===================================================================
---- linux-2.6.29.6.orig/arch/arm/mach-mx2/apf27-dev.c 2009-12-16 14:43:11.000000000 +0100
-+++ linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev.c 2009-12-16 15:07:25.000000000 +0100
-@@ -316,15 +316,17 @@
- #endif /* CONFIG_SERIAL_IMX_UART5 */
+--- linux-2.6.29.6.orig/arch/arm/mach-mx2/apf27-dev.c 2009-12-18 19:33:56.000000000 +0100
++++ linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev.c 2009-12-18 19:33:57.000000000 +0100
+@@ -397,15 +397,17 @@
+ #endif /* CONFIG_SERIAL_IMX_UART6 */
-/* Both APF27 SPI ports are used on APF27Dev */
@@ -22,7 +22,7 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev.c
static int mxc_cspi1_pins[] = {
/* PD19_PF_CSPI2_SS2,
PD20_PF_CSPI2_SS1, Preferably use CS pin as GPIO
-@@ -333,11 +335,25 @@
+@@ -414,11 +416,25 @@
PD23_PF_CSPI2_MISO,
PD24_PF_CSPI2_MOSI
};
@@ -49,7 +49,7 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev.c
}
static int gpio_spi0_inactive(struct platform_device *pdev)
-@@ -345,11 +361,13 @@
+@@ -426,11 +442,13 @@
mxc_gpio_release_multiple_pins(mxc_cspi0_pins, ARRAY_SIZE(mxc_cspi0_pins));
return 0;
}
@@ -64,7 +64,7 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev.c
}
static int gpio_spi1_inactive(struct platform_device *pdev)
-@@ -357,21 +375,48 @@
+@@ -438,21 +456,48 @@
mxc_gpio_release_multiple_pins(mxc_cspi1_pins, ARRAY_SIZE(mxc_cspi1_pins));
return 0;
}
@@ -113,8 +113,8 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev.c
+
- /* APF27Dev has an optionnal 7 channels 10 bits ADC (SPI) */
-@@ -420,7 +465,6 @@
+ /* APF27Dev has an optionnal 7 channels 10 bits ADC (SPI1) */
+@@ -501,7 +546,6 @@
};
#endif /* CONFIG_ARMADEUS_MAX1027 */
@@ -122,7 +122,7 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev.c
/* APF27Dev has a SPI Touchscreen controller */
#define TSC2101_INT 17
#define TSC2101_CS (GPIO_PORTD | 21) /* SPI2_SS0 used as GPIO */
-@@ -984,10 +1028,17 @@
+@@ -1077,10 +1121,17 @@
i2c_register_board_info(1, apf27dev_i2c_devices_bus1,
ARRAY_SIZE(apf27dev_i2c_devices_bus1));
#endif
diff --git a/target/test/mmc/mmc_perf.sh b/target/test/mmc/media_perf.sh
similarity index 54%
rename from target/test/mmc/mmc_perf.sh
rename to target/test/mmc/media_perf.sh
index fc1cc38..cedcc4e 100755
--- a/target/test/mmc/mmc_perf.sh
+++ b/target/test/mmc/media_perf.sh
@@ -1,7 +1,7 @@
#!/bin/sh
#
-# Script to test Armadeus boards performances to handle MMC/SD cards
+# Script to test Armadeus boards performances to handle removable storage media
#
# Copyright (C) 2007 The Armadeus Project
#
@@ -23,11 +23,15 @@
source ./test_helpers.sh
# Script parameters
+TEMP_FILE_SIZE=16384 # kbytes (ex: 16384 24576)
+NB_ITER=10
+
MMC_MOUNT_DIR="/media/mmc"
MMC_DEVICE="/dev/mmcblk0p1"
+USB_DEVICE="/dev/sda1"
+USB_MOUNT_DIR="/media/usbdisk"
TEMP_DIR="/tmp/perf_mmc/"
TEMP_FILE="/tmp/data.bin"
-TEMP_FILE_SIZE=16384 # kbytes
WRITE_BENCH="/tmp/test_mmc.sh"
WTIME=0
@@ -43,23 +47,24 @@ debug()
get_time_in_ms_from_file()
{
- if [ -f "$1" ]; then
- TIME=`cat $1 | grep real | cut -d m -f 2 | sed 's/s//'`
- STIME=`echo $TIME | cut -d . -f 1`
- STIME=`expr $STIME \* 1000`
- MSTIME=`echo $TIME | cut -d . -f 2`
- MSTIME=`expr $MSTIME \* 10`
- NAME=`echo $1 | grep write`
- if [ "$NAME" != "" ]; then
- WTIME=`expr $STIME + $MSTIME`
- debug "WTIME: $WTIME"
- else
- RTIME=`expr $STIME + $MSTIME`
- debug "RTIME: $RTIME"
- fi
- else
- echo "File doesn't exist"
- fi
+ if [ ! -f "$1" ]; then
+ echo "File doesn't exist"
+ return 1
+ fi
+
+ TIME=`cat $1 | grep real | cut -d m -f 2 | sed 's/s//'`
+ STIME=`echo $TIME | cut -d . -f 1`
+ STIME=`expr $STIME \* 1000`
+ MSTIME=`echo $TIME | cut -d . -f 2`
+ MSTIME=`expr $MSTIME \* 10`
+ NAME=`echo $1 | grep write`
+ if [ "$NAME" != "" ]; then
+ WTIME=`expr $STIME + $MSTIME`
+ debug "WTIME: $WTIME"
+ else
+ RTIME=`expr $STIME + $MSTIME`
+ debug "RTIME: $RTIME"
+ fi
}
test_speed()
@@ -67,41 +72,42 @@ test_speed()
# Create temp bench file
create_random_file $TEMP_FILE $TEMP_FILE_SIZE
- # Create write bench script
- echo "mv $TEMP_FILE $MMC_MOUNT_DIR" > $WRITE_BENCH
- echo "sync" >> $WRITE_BENCH
- echo "exit 0" >> $WRITE_BENCH
-
- for it in 1 2 3 4 5; do
- echo "--- Test iteration n°$it ---"
- echo " Writing"
- time sh $WRITE_BENCH 2>/tmp/writetime
- umount $MMC_MOUNT_DIR && mount $MMC_DEVICE $MMC_MOUNT_DIR
- echo " Reading"
- time mv $MMC_MOUNT_DIR/data.bin /tmp/ 2>/tmp/readtime
- # Update writing mean time
- get_time_in_ms_from_file /tmp/writetime
- if [ $it == "1" ]; then
- WTOTIME=$WTIME
- else
- WTOTIME=`expr $WTIME + $WTOTIME`
- fi
- debug "Total write time: $WTOTIME ms"
- # Update reading mean time
- get_time_in_ms_from_file /tmp/readtime
- if [ $it == "1" ]; then
- RTOTIME=$RTIME
- else
- RTOTIME=`expr $RTIME + $RTOTIME`
- fi
- debug "Total read time: $RTOTIME ms"
- done
+ # Create write bench script
+ echo "mv $TEMP_FILE $MOUNT_DIR" > $WRITE_BENCH
+ echo "sync" >> $WRITE_BENCH
+ echo "exit 0" >> $WRITE_BENCH
+
+ for it in `seq $NB_ITER`; do
+ echo "--- Test iteration n°$it ---"
+ echo " Writing"
+ time sh $WRITE_BENCH 2>/tmp/writetime
+ umount $MOUNT_DIR && mount $REM_DEVICE $MOUNT_DIR
+ echo " Reading"
+ time mv $MOUNT_DIR/data.bin /tmp/ 2>/tmp/readtime
+ # Update writing mean time
+ get_time_in_ms_from_file /tmp/writetime
+ if [ $it == "1" ]; then
+ WTOTIME=$WTIME
+ else
+ WTOTIME=`expr $WTIME + $WTOTIME`
+ fi
+ debug "Total write time: $WTOTIME ms"
+ # Update reading mean time
+ get_time_in_ms_from_file /tmp/readtime
+ if [ $it == "1" ]; then
+ RTOTIME=$RTIME
+ else
+ RTOTIME=`expr $RTIME + $RTOTIME`
+ fi
+ debug "Total read time: $RTOTIME ms"
+ done
WTOTIME=`expr $WTOTIME / $it`
RTOTIME=`expr $RTOTIME / $it`
WSPEED=`expr $TEMP_FILE_SIZE \* 1000 / $WTOTIME`
RSPEED=`expr $TEMP_FILE_SIZE \* 1000 / $RTOTIME`
echo "--- Test result (mean values): read -> $RSPEED kBytes/sec write -> $WSPEED kBytes/sec"
+ umount $MOUNT_DIR
}
usage()
@@ -115,11 +121,6 @@ usage()
# Main
#
-# Check some pre-requisites
-if [ ! -d $MMC_MOUNT_DIR ]; then
- echo "Check that $MMC_MOUNT_DIR directory is existing"
- exit 1
-fi
# Process parameters
if [ "$#" == 0 ]; then
usage
@@ -131,22 +132,47 @@ if [ "$2" != "" ]; then
MMC_DEVICE="$2"
fi
-if [ ! -b $MMC_DEVICE ]; then
+if [ ! -b $MMC_DEVICE ] && [ ! -b $USB_DEVICE ]; then
echo -n "Please insert your MMC/SD/microSD/USB key"
it=0
- while [ ! -b $MMC_DEVICE ] && [ $it -le 20 ]; do
+ while [ ! -b $MMC_DEVICE ] && [ ! -b $USB_DEVICE ] && [ $it -le 20 ]; do
it=$((it+1))
sleep 2
echo -n "."
done
fi
+if [ -b $MMC_DEVICE ]; then
+ echo "Testing MMC/SD/microSD"
+ REM_DEVICE=$MMC_DEVICE
+ MOUNT_DIR=$MMC_MOUNT_DIR
+elif [ -b $USB_DEVICE ]; then
+ echo "Testing USB key"
+ REM_DEVICE=$USB_DEVICE
+ MOUNT_DIR=$USB_MOUNT_DIR
+else
+ echo "No removable device found: exiting..."
+ exit 1
+fi
+
+# Check some pre-requisites
+if [ ! -d $MOUNT_DIR ]; then
+ echo "Create $MOUNT_DIR directory ? (y/N)"
+ read answer
+ if [ "$answer" == "y" ] || [ "$answer" == "yes" ]; then
+ mkdir -p $MOUNT_DIR
+ else
+ "Exiting..."
+ exit 1
+ fi
+fi
+
# If not mounted, mount it:
-IS_MOUNTED=`mount | grep -c $MMC_MOUNT_DIR`
+IS_MOUNTED=`mount | grep -c $MOUNT_DIR`
if [ "$IS_MOUNTED" != "1" ]; then
- mount $MMC_DEVICE $MMC_MOUNT_DIR
+ mount $REM_DEVICE $MOUNT_DIR
if [ "$?" != 0 ]; then
- echo "Failed to mount device $MMC_DEVICE"
+ echo "Failed to mount device $REM_DEVICE"
exit 1
fi
fi
@@ -172,7 +198,7 @@ dd if=/dev/urandom of=$FILE bs=1024 count=1024 2>/dev/null
md5sum $FILE > $MD5
while [ $it -le $SIZE ]; do
- FILEMMC=$MMC_MOUNT_DIR/test_$it.rnd
+ FILEMMC=$MOUNT_DIR/test_$it.rnd
# MD5=$TEMP_DIR/test_$it.rnd.md5
echo -en "\r Copying: $FILEMMC"
it=$((it+1))
@@ -182,15 +208,15 @@ done
echo ""
-umount $MMC_MOUNT_DIR
-mount $MMC_DEVICE $MMC_MOUNT_DIR
+umount $MOUNT_DIR
+mount $REM_DEVICE $MOUNT_DIR
date
-FILES=`ls $MMC_MOUNT_DIR/*.rnd`
+FILES=`ls $MOUNT_DIR/*.rnd`
for file in $FILES; do
file=`basename $file`
echo -en "\r Checking MD5 for: $file"
- MD5MMC=`md5sum $MMC_MOUNT_DIR/$file | cut -d " " -f 1`
+ MD5MMC=`md5sum $MOUNT_DIR/$file | cut -d " " -f 1`
MD5ORG=`cat $MD5 | cut -d " " -f 1`
if [ "$MD5MMC" != "$MD5ORG" ]; then
echo -e "\nMD5 failed for $file: $MD5MMC $MD5ORG"
@@ -202,6 +228,6 @@ date
echo "Integrity test successful !"
rm -rf $TEMP_DIR
-rm $MMC_MOUNT_DIR/*.rnd
+rm $MOUNT_DIR/*.rnd
exit 0
diff --git a/target/test/test_release.sh b/target/test/test_release.sh
index 558af20..72e66f2 100755
--- a/target/test/test_release.sh
+++ b/target/test/test_release.sh
@@ -62,7 +62,7 @@ $THIS_DIR/test_fpga.sh
echo
$THIS_DIR/test_gpio.sh
echo
-$THIS_DIR/mmc_perf.sh speed
+$THIS_DIR/media_perf.sh speed
# Following tests needs Internet access:
ask_user "I will now try to configure Internet access. Press ENTER when ready"
$THIS_DIR/dhcp.sh
hooks/post-receive
--
armadeus
|