[Armadeus-commitlog] armadeus branch, master, updated. release-3.2-124-g3326f16
Brought to you by:
sszy
|
From: Julien B a. A. <ar...@us...> - 2010-01-21 16:04:34
|
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 3326f16cdf5f0f6587339e9e554c361bd8449927 (commit)
via 4ef6d1f4535f77eb4fcfe05f00e779e0cc633c8c (commit)
from 18ae7cd946fd58bc47b19d6553f20057acae6865 (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 3326f16cdf5f0f6587339e9e554c361bd8449927
Author: Julien Boibessot <jul...@ar...>
Date: Thu Jan 21 17:03:53 2010 +0100
[LINUX] Improve support of SDIO cards on APF27
commit 4ef6d1f4535f77eb4fcfe05f00e779e0cc633c8c
Author: Julien Boibessot <jul...@ar...>
Date: Thu Jan 21 16:23:14 2010 +0100
[TEST] Add a test for WiFi (only for APW for the moment)
-----------------------------------------------------------------------
Summary of changes:
...deus-mxcmmc-improve_support_of_sdio_cards.patch | 208 ++++++++++++++++++++
target/test/test_audio.sh | 2 +-
target/test/test_helpers.sh | 44 ++++-
target/test/test_wifi.sh | 96 +++++++++
4 files changed, 347 insertions(+), 3 deletions(-)
create mode 100644 buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/274-apf27-armadeus-mxcmmc-improve_support_of_sdio_cards.patch
create mode 100755 target/test/test_wifi.sh
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/274-apf27-armadeus-mxcmmc-improve_support_of_sdio_cards.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/274-apf27-armadeus-mxcmmc-improve_support_of_sdio_cards.patch
new file mode 100644
index 0000000..508a81a
--- /dev/null
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/274-apf27-armadeus-mxcmmc-improve_support_of_sdio_cards.patch
@@ -0,0 +1,208 @@
+Add better support for SDIO cards to MX2/MX3 SDHC driver:
+* correct a bug (?) in DMA for SDIO CMD53 Multi-Blocks transfers
+* add SDIO interrupt handling
+* correct a bad initialisation, line 687
+
+To check: protect readl/writel register accesses with spin lock ?
+
+To do: split in 3 and rebase with 2.6.33 before sending upstream.
+
+Signed-off-by: Julien Boibessot <jul...@ar...>
+
+Index: linux-2.6.29.6/drivers/mmc/host/mxcmmc.c
+===================================================================
+--- linux-2.6.29.6.orig/drivers/mmc/host/mxcmmc.c 2010-01-19 18:18:20.000000000 +0100
++++ linux-2.6.29.6/drivers/mmc/host/mxcmmc.c 2010-01-21 10:56:09.000000000 +0100
+@@ -129,6 +129,7 @@
+ unsigned int dma_nents;
+ unsigned int datasize;
+ unsigned int dma_dir;
++ unsigned int blen;
+
+ u16 rev_no;
+ unsigned int cmdat;
+@@ -168,6 +169,7 @@
+ #ifdef HAS_DMA
+ struct scatterlist *sg;
+ int i;
++ unsigned int blen;
+ #endif
+ if (data->flags & MMC_DATA_STREAM)
+ nob = 0xffff;
+@@ -179,6 +181,9 @@
+ writew(blksz, host->base + MMC_REG_BLK_LEN);
+ host->datasize = datasize;
+
++ /*printk(KERN_DEBUG "transfer data(%s): size=%d (%dx%d)\n",
++ data->flags & MMC_DATA_READ ? "read" : "write",
++ datasize, nob, blksz);*/
+ #ifdef HAS_DMA
+ for_each_sg(data->sg, sg, data->sg_len, i) {
+ if (sg->offset & 3 || sg->length & 3) {
+@@ -187,6 +192,26 @@
+ }
+ }
+
++ /*
++ * When block size is smaller than buffer size (for example during
++ * Multi-Block transfers with CMD53 on some SDIO cards), SDHC seems
++ * to wipe some data out if DMA burst length == buffer size.
++ * So adapt burst length dynamically.
++ */
++ if (host->cmdat & CMD_DAT_CONT_BUS_WIDTH_4) { /* 4 bits mode */
++ blen = min(blksz, (unsigned int)64);
++ if (blen==64)
++ blen = 0; /* (64 bytes --> reg value 0) */
++ } else { /* 1 bit mode */
++ blen = min(blksz, (unsigned int)16);
++ }
++ if (blen != host->blen) {
++ imx_dma_config_burstlen(host->dma, blen);
++ host->blen = blen;
++ dev_dbg(mmc_dev(host->mmc), "changing DMA burst len to %d\n",
++ blen);
++ }
++
+ if (data->flags & MMC_DATA_READ) {
+ host->dma_dir = DMA_FROM_DEVICE;
+ host->dma_nents = dma_map_sg(mmc_dev(host->mmc), data->sg,
+@@ -214,6 +239,7 @@
+ static int mxcmci_start_cmd(struct mxcmci_host *host, struct mmc_command *cmd,
+ unsigned int cmdat)
+ {
++ u32 reg;
+ WARN_ON(host->cmd != NULL);
+ host->cmd = cmd;
+
+@@ -237,12 +263,15 @@
+ return -EINVAL;
+ }
+
+- if (mxcmci_use_dma(host))
+- writel(INT_READ_OP_EN | INT_WRITE_OP_DONE_EN |
+- INT_END_CMD_RES_EN,
+- host->base + MMC_REG_INT_CNTR);
+- else
+- writel(INT_END_CMD_RES_EN, host->base + MMC_REG_INT_CNTR);
++ reg = readl(host->base + MMC_REG_INT_CNTR);
++ reg &= ~(INT_READ_OP_EN | INT_WRITE_OP_DONE_EN | INT_END_CMD_RES_EN);
++ if (mxcmci_use_dma(host)) {
++ reg |= (INT_READ_OP_EN | INT_WRITE_OP_DONE_EN |
++ INT_END_CMD_RES_EN);
++ } else {
++ reg |= INT_END_CMD_RES_EN;
++ }
++ writel(reg, host->base + MMC_REG_INT_CNTR);
+
+ writew(cmd->opcode, host->base + MMC_REG_CMD);
+ writel(cmd->arg, host->base + MMC_REG_ARG);
+@@ -254,7 +283,11 @@
+ static void mxcmci_finish_request(struct mxcmci_host *host,
+ struct mmc_request *req)
+ {
+- writel(0, host->base + MMC_REG_INT_CNTR);
++ u32 reg;
++
++ reg = readl(host->base + MMC_REG_INT_CNTR);
++ reg &= ~(INT_READ_OP_EN | INT_WRITE_OP_DONE_EN | INT_END_CMD_RES_EN);
++ writel(reg, host->base + MMC_REG_INT_CNTR);
+
+ host->req = NULL;
+ host->cmd = NULL;
+@@ -510,7 +543,7 @@
+ static irqreturn_t mxcmci_irq(int irq, void *devid)
+ {
+ struct mxcmci_host *host = devid;
+- u32 stat;
++ u32 stat, reg;
+
+ stat = readl(host->base + MMC_REG_STATUS);
+ writel(stat, host->base + MMC_REG_STATUS);
+@@ -524,6 +557,14 @@
+ (stat & (STATUS_DATA_TRANS_DONE | STATUS_WRITE_OP_DONE)))
+ mxcmci_data_done(host, stat);
+ #endif
++
++ if (stat & STATUS_SDIO_INT_ACTIVE) {
++ reg = readl(host->base + MMC_REG_INT_CNTR);
++ if (reg & INT_SDIO_IRQ_EN) {
++ mmc_signal_sdio_irq(host->mmc);
++ }
++ }
++
+ return IRQ_HANDLED;
+ }
+
+@@ -588,6 +629,7 @@
+ static void mxcmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
+ {
+ struct mxcmci_host *host = mmc_priv(mmc);
++ u32 reg;
+ #ifdef HAS_DMA
+ unsigned int blen;
+ /*
+@@ -600,11 +642,17 @@
+ blen = 16;
+
+ imx_dma_config_burstlen(host->dma, blen);
++ host->blen = blen;
+ #endif
+- if (ios->bus_width == MMC_BUS_WIDTH_4)
++ reg = readl(host->base + MMC_REG_INT_CNTR);
++ if (ios->bus_width == MMC_BUS_WIDTH_4) {
+ host->cmdat |= CMD_DAT_CONT_BUS_WIDTH_4;
+- else
++ reg |= INT_DAT0_EN;
++ } else {
+ host->cmdat &= ~CMD_DAT_CONT_BUS_WIDTH_4;
++ reg &= ~INT_DAT0_EN;
++ }
++ writel(reg, host->base + MMC_REG_INT_CNTR);
+
+ if (host->power_mode != ios->power_mode) {
+ if (host->pdata && host->pdata->setpower)
+@@ -647,11 +695,26 @@
+ return -ENOSYS;
+ }
+
++static void mxcmci_enable_sdio_irq(struct mmc_host *mmc, int enable)
++{
++ struct mxcmci_host *host = mmc_priv(mmc);
++ u32 reg;
++
++ /* protect with spin lock ? */
++ reg = readl(host->base + MMC_REG_INT_CNTR);
++ if (enable)
++ reg |= INT_SDIO_IRQ_EN;
++ else
++ reg &= ~INT_SDIO_IRQ_EN;
++ writel(reg, host->base + MMC_REG_INT_CNTR);
++
++}
+
+ static const struct mmc_host_ops mxcmci_ops = {
+ .request = mxcmci_request,
+ .set_ios = mxcmci_set_ios,
+ .get_ro = mxcmci_get_ro,
++ .enable_sdio_irq= mxcmci_enable_sdio_irq,
+ };
+
+ static int mxcmci_probe(struct platform_device *pdev)
+@@ -679,7 +742,7 @@
+ }
+
+ mmc->ops = &mxcmci_ops;
+- mmc->caps = MMC_CAP_4_BIT_DATA;
++ mmc->caps = MMC_CAP_4_BIT_DATA | MMC_CAP_SDIO_IRQ;
+
+ /* MMC core transfer sizes tunable parameters */
+ mmc->max_hw_segs = 64;
+@@ -687,7 +750,7 @@
+ mmc->max_blk_size = 2048;
+ mmc->max_blk_count = 65535;
+ mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count;
+- mmc->max_seg_size = mmc->max_seg_size;
++ mmc->max_seg_size = mmc->max_req_size;
+
+ host = mmc_priv(mmc);
+ host->base = ioremap(r->start, resource_size(r));
diff --git a/target/test/test_audio.sh b/target/test/test_audio.sh
index 45525cf..9bfaaf5 100755
--- a/target/test/test_audio.sh
+++ b/target/test/test_audio.sh
@@ -43,7 +43,7 @@ test_audio()
exit_failed
fi
- ask_user "Please connect a earphone to the Audio Out connector (top on APF27). Then press ENTER."
+ ask_user "Please connect an earphone to the Audio Out connector (top on APF27). Then press ENTER."
aplay /usr/share/sounds/alsa/Side_Left.wav
if [ "$?" == 0 ]; then
ask_user "Did you hear something ? (y/N)"
diff --git a/target/test/test_helpers.sh b/target/test/test_helpers.sh
index f57d748..281f7b0 100644
--- a/target/test/test_helpers.sh
+++ b/target/test/test_helpers.sh
@@ -1,9 +1,9 @@
#!/bin/sh
#
-# Script to test Armadeus Software release
+# Helpers for Armadeus Software release's test scripts
#
-# Copyright (C) 2008 The Armadeus Project
+# Copyright (C) 2008-2010 The Armadeus Project
#
# 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
@@ -58,6 +58,46 @@ ask_user()
read response
}
+ask_user_banner()
+{
+ echo
+ echo -e "--- "$1
+}
+
+answer=""
+# $1: thing to ask, $* possibilities. Will fill in "answer" variable.
+ask_user_choice()
+{
+ ask_user_banner "$1"
+ shift
+ n=1
+ while [ "$1" != "" ]; do
+ echo -n " $n) "$1
+
+ if [ "$n" == 1 ]; then
+ echo " (default)"
+ else
+ echo ""
+ fi
+ eval tempvar$n=\"$1\"
+ shift
+ let n=n+1
+ done
+ read -p "> " answer
+
+ # If user didn't enter a correct value, use default (first)
+ for i in `seq $n`; do
+ if [ $i == "$answer" ]; then
+ break
+ fi
+ done
+ if [ $i -lt $n ]; then
+ eval answer="\$tempvar$answer"
+ else
+ eval answer="\$tempvar1"
+ fi
+}
+
show_test_banner()
{
echo -e "\033[1m******** Testing $1 ********\033[0m"
diff --git a/target/test/test_wifi.sh b/target/test/test_wifi.sh
new file mode 100755
index 0000000..e276746
--- /dev/null
+++ b/target/test/test_wifi.sh
@@ -0,0 +1,96 @@
+#!/bin/sh
+
+#
+# Script to test Armadeus Software release
+#
+# Copyright (C) 2010 The Armadeus Project
+#
+# 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.
+#
+
+source ./test_helpers.sh
+source ./test_env.sh
+
+TEMP_FILE=/tmp/toto.wav
+AP_LIST_FILE=/tmp/ap.list
+DEFAULT_WEP_KEY="01234567890123456789012345"
+FILE_TO_LOAD="test_wifi.bin"
+#SERVER_IP set in test_env.sh
+
+
+test_wifi()
+{
+ show_test_banner "WiFi (802.11 b/g)"
+
+ ask_user "This test assumes that you run a private WiFi network (WEP shared key security). Your Access Point (AP) should be connected to your Host. Press ENTER to continue"
+
+ ask_user "Do you have an APW wireless extension board ? (Y/n)"
+ if [ "$response" == "n" ] || [ "$response" == "no" ]; then
+ echo "Only the APW is supported by this test yet !!"
+ exit_failed
+ fi
+
+ modprobe libertas_sdio
+ if [ "$?" != 0 ]; then
+ echo "Failed to load Libertas driver !!"
+ exit_failed
+ fi
+ ifconfig eth1 up
+ #ifconfig eth0 down
+
+ # get available APs (remove hidden one)
+ echo -e "\n Scanning available APs"
+ iwlist eth1 scan | grep ESSID > $AP_LIST_FILE
+ AP_LIST=`cat $AP_LIST_FILE | grep -v \"\" | cut -d : -f 2 | sed -e 's/"//g'`
+
+ # ask which one to use
+ ask_user_choice "Which one is your AP ?" $AP_LIST
+ AP="$answer"
+ echo "Choosed: $AP"
+ ask_user "Please enter you WEP key (default=$DEFAULT_WEP_KEY)"
+ if [ "$response" == "" ]; then
+ WEP_KEY=$DEFAULT_WEP_KEY
+ else
+ WEP_KEY=$response
+ fi
+ echo "Trying to get associated with $AP (key=$WEP_KEY)"
+ iwconfig eth1 key $WEP_KEY
+ iwconfig eth1 essid $AP
+ sleep 3
+ associated=`iwconfig eth1 | grep "Access Point" | grep -c -v "Not-Associated"`
+ if [ "$associated" != 1 ]; then
+ echo "Failed to get associated with $AP"
+ exit_failed
+ fi
+ echo -e "\n Asking for an IP address"
+ udhcpc -i eth1
+ ask_user "I will now download $FILE_TO_LOAD from your TFTP server ($SERVER_IP).\nBe sure that the file and its correspondig md5sum is available. Then press ENTER."
+ echo -e "\n Pinging server:"
+ ping -c 3 $SERVER_IP
+ if [ "$?" != 0 ]; then
+ exit_failed
+ fi
+ cd /tmp/
+ echo -e "\n Downloading $FILE_TO_LOAD:"
+ time tftp -g -r $FILE_TO_LOAD $SERVER_IP
+ if [ "$?" != 0 ]; then
+ exit_failed
+ fi
+
+ echo -e "\n Downloading $FILE_TO_LOAD.md5:"
+ time tftp -g -r $FILE_TO_LOAD.md5 $SERVER_IP
+ md5sum -c $FILE_TO_LOAD.md5
+ if [ "$?" != 0 ]; then
+ echo "MD5 check KO !!"
+ exit_failed
+ fi
+
+ echo_test_ok
+ exit 0
+}
+
+test_wifi
+
hooks/post-receive
--
armadeus
|