Author: bklaas
Date: Mon Jul 26 09:54:15 2010
New Revision: 8990
URL: http://svn.slimdevices.com/jive?rev=8990&view=rev
Log:
r40...@daddymac-520 (orig r8982): vferey | 2010-07-22 12:39:22 -0500
Merged from the 7.5.1-rtm branch to fix the MSP430 initialization sequence bug
that causes the wireless not to work.
Added:
7.6/trunk/squeezeos/poky/meta-squeezeos/packages/base-files/files/baby/rcS_init_msp430.patch
7.6/trunk/squeezeos/src/imx25/patches/logitech/msp430-init-seq.patch
Modified:
7.6/trunk/ (props changed)
7.6/trunk/squeezeos/poky/meta-squeezeos/packages/base-files/squeezeos-base-files_1.0.bb
7.6/trunk/squeezeos/src/imx25/patches/series
Propchange: 7.6/trunk/
------------------------------------------------------------------------------
--- svk:merge (original)
+++ svk:merge Mon Jul 26 09:54:15 2010
@@ -13,7 +13,7 @@
bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.4/private-branches/fab4-skin:4552
bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.4/private-branches/new-alsa:6567
bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.4/trunk:8423
-bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.5/trunk:8962
+bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.5/trunk:8982
bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/7.0:2013
bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/SN:1083
bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/scrolling:1378
Propchange: 7.6/trunk/
------------------------------------------------------------------------------
svn:mergeinfo = /7.5/branches/7.5.1-rtm:8838-8981
Added:
7.6/trunk/squeezeos/poky/meta-squeezeos/packages/base-files/files/baby/rcS_init_msp430.patch
URL:
http://svn.slimdevices.com/jive/7.6/trunk/squeezeos/poky/meta-squeezeos/packages/base-files/files/baby/rcS_init_msp430.patch?rev=8990&view=auto
==============================================================================
---
7.6/trunk/squeezeos/poky/meta-squeezeos/packages/base-files/files/baby/rcS_init_msp430.patch
(added)
+++
7.6/trunk/squeezeos/poky/meta-squeezeos/packages/base-files/files/baby/rcS_init_msp430.patch
Mon Jul 26 09:54:15 2010
@@ -1,0 +1,14 @@
+Index: files/rcS
+===================================================================
+--- files.orig/rcS 2010-07-09 17:22:31.147832667 -0700
++++ files/rcS 2010-07-09 17:23:53.796130839 -0700
+@@ -56,6 +56,9 @@
+ # Start kernel logger
+ /sbin/klogd
+
++echo "Enable MSP430"
++echo program >/sys/bus/i2c/devices/1-0010/flash
++
+ # Start watchdog
+ /usr/sbin/watchdog
+
Modified:
7.6/trunk/squeezeos/poky/meta-squeezeos/packages/base-files/squeezeos-base-files_1.0.bb
URL:
http://svn.slimdevices.com/jive/7.6/trunk/squeezeos/poky/meta-squeezeos/packages/base-files/squeezeos-base-files_1.0.bb?rev=8990&r1=8989&r2=8990&view=diff
==============================================================================
---
7.6/trunk/squeezeos/poky/meta-squeezeos/packages/base-files/squeezeos-base-files_1.0.bb
(original)
+++
7.6/trunk/squeezeos/poky/meta-squeezeos/packages/base-files/squeezeos-base-files_1.0.bb
Mon Jul 26 09:54:15 2010
@@ -58,6 +58,7 @@
file://blupdate \
file://redboot-baby-0001.bin \
file://redboot-baby-0002.bin \
+ file://rcS_init_msp430.patch;patch=1 \
"
S = "${WORKDIR}"
Added: 7.6/trunk/squeezeos/src/imx25/patches/logitech/msp430-init-seq.patch
URL:
http://svn.slimdevices.com/jive/7.6/trunk/squeezeos/src/imx25/patches/logitech/msp430-init-seq.patch?rev=8990&view=auto
==============================================================================
--- 7.6/trunk/squeezeos/src/imx25/patches/logitech/msp430-init-seq.patch (added)
+++ 7.6/trunk/squeezeos/src/imx25/patches/logitech/msp430-init-seq.patch Mon
Jul 26 09:54:15 2010
@@ -1,0 +1,180 @@
+Index: linux-2.6.26/drivers/mxc/baby/msp430/msp430_programmer.c
+===================================================================
+--- linux-2.6.26.orig/drivers/mxc/baby/msp430/msp430_programmer.c
2010-07-09 15:52:20.371826002 -0700
++++ linux-2.6.26/drivers/mxc/baby/msp430/msp430_programmer.c 2010-07-09
16:52:28.976447158 -0700
+@@ -234,10 +234,72 @@
+ return NULL;
+ }
+
++/*
++ Resets the MSP430. This means the date/time kept on MSP430 gets lost
after this call.
++*/
+
+-static void msp430_programmer_firmware(const struct firmware *fw, void
*context)
++void msp430_reset ( void )
++{
++ unsigned long flags;
++
++ msp430_request_gpio();
++ local_irq_save(flags);
++
++ msp430_start_charge_pump();
++ mxc_set_gpio_dataout (msp430_programmer_state->sbwtdio_res, 0);
++ udelay(1000);
++ mxc_set_gpio_dataout (msp430_programmer_state->sbwtdio_res, 1);
++
++ local_irq_restore(flags);
++ msp430_release_gpio();
++
++ /* allow the microcontroller time to settle */
++ msleep(MSP430_SETTLE_DELAY_MS);
++}
++
++/*
++ Returns the firmware revision that is running on MSP430 by issuing
i2c commands.
++*/
++
++int msp430_firmwar_version (struct i2c_client *client)
++{
++ int ret;
++ int version;
++ char val[3];
++
++
++ version = -1;
++ ret = i2c_smbus_read_i2c_block_data(client, I2C_ID_REGISTER, 1, val);
++ if ( ret <= 0 )
++ {
++ printk ( KERN_ERR "Failed to issue the i2c read block command
to MSP430\n" );
++ return -1;
++ }
++ if ( val[0] != I2C_ID_VALUE)
++ {
++ printk( KERN_ERR "Read invalid value from the MSP430. value
read is 0x%x, expecting 0x%x\n", val[0], I2C_ID_VALUE);
++ return -1;
++ }
++
++ if (i2c_smbus_read_i2c_block_data(client, I2C_VERSION_REGISTER, 2,
val) > 0)
++ {
++ version = (val[1] << 8) | val[0];
++ }
++ else
++ {
++ printk ( KERN_INFO "Failed to fetch the version information
from the device\n" );
++ }
++
++ return version;
++}
++
++/*
++ Programs the MSP430 firmware if needed.
++ If the version that is running on MSP430 is the same as the one we have
there is no need to program it.
++*/
++
++static void msp430_program_firmware(struct i2c_client *client, const struct
firmware *fw)
+ {
+- struct i2c_client *client = context;
+ struct msp430_i2c_data *data = i2c_get_clientdata(client);
+ struct ti_txt *txt;
+ unsigned long flags;
+@@ -258,34 +320,20 @@
+
+ /* check msp430 firmware */
+ tries = 0;
+- while (tries++ < 2) {
+- if ((i2c_smbus_read_i2c_block_data(client, I2C_ID_REGISTER, 1,
val) <= 0)
+- || val[0] != I2C_ID_VALUE) {
+- printk("Couldn't read msp ID register, resetting
mcu\n");
+- mcu_version = -1;
+-
+- msp430_request_gpio();
+- local_irq_save(flags);
+-
+- msp430_start_charge_pump();
+- mxc_set_gpio_dataout
(msp430_programmer_state->sbwtdio_res, 0);
+- udelay(1000);
+- mxc_set_gpio_dataout
(msp430_programmer_state->sbwtdio_res, 1);
+-
+- local_irq_restore(flags);
+- msp430_release_gpio();
+-
+- /* allow the microcontroller time to settle */
+- msleep(MSP430_SETTLE_DELAY_MS);
++ while (tries++ < 2)
++ {
++ /*
++ Fetch the MSP430 version information.
++ If the version information is valid then nothing to be
done.
++ If not then reset the MSP430.
++ */
+
+- continue;
++ mcu_version = msp430_firmwar_version ( client );
+
+- } else if (i2c_smbus_read_i2c_block_data(client,
I2C_VERSION_REGISTER, 2, val) > 0) {
+- mcu_version = (val[1] << 8) | val[0];
++ if ( mcu_version > 0 )
+ break;
+- } else {
+- mcu_version = -1;
+- }
++
++ msp430_reset ();
+ }
+
+ /* is an upgrade needed? */
+@@ -347,12 +395,12 @@
+ /* verify firmware is running */
+ if (!i2c_smbus_read_i2c_block_data(client, I2C_ID_REGISTER, 1, val)
+ || val[0] != I2C_ID_VALUE) {
+- printk("msp430: firmware programming failed, bad id\n");
++ printk( KERN_INFO "msp430: firmware programming failed, bad
id\n");
+ goto err;
+ }
+
+ if (!i2c_smbus_read_i2c_block_data(client, I2C_VERSION_REGISTER, 2,
val)) {
+- printk("msp430: firmware programming failed, bad version\n");
++ printk( KERN_INFO "msp430: firmware programming failed, bad
version\n");
+ goto err;
+ }
+ mcu_version = (val[1] << 8) | val[0];
+@@ -372,13 +420,21 @@
+ void msp430_programmer_upgrade(struct i2c_client *client)
+ {
+ struct msp430_i2c_data *data = i2c_get_clientdata(client);
++ const struct firmware *fw;
++ int retval;
+
+ snprintf(data->firmware, sizeof(data->firmware), "msp430-%04d.txt",
system_rev);
+- printk(KERN_INFO "Requesting msp430 firmware %s\n", data->firmware);
++ printk(KERN_INFO "Requesting msp430 firmware %s(version 0.1)\n",
data->firmware);
+
+- request_firmware_nowait(THIS_MODULE, FW_ACTION_HOTPLUG,
+- data->firmware, &client->dev,
+- client, msp430_programmer_firmware);
++
++ retval = request_firmware(&fw, data -> firmware, &client->dev);
++ if (retval) {
++ printk (KERN_ERR "%s:%d-can't get firmware\n", __FUNCTION__,
__LINE__);
++ }
++ else
++ {
++ msp430_program_firmware ( client, fw );
++ }
+ }
+
+
+Index: linux-2.6.26/drivers/mxc/baby/msp430/msp430_i2c.c
+===================================================================
+--- linux-2.6.26.orig/drivers/mxc/baby/msp430/msp430_i2c.c 2010-07-09
16:37:34.375816047 -0700
++++ linux-2.6.26/drivers/mxc/baby/msp430/msp430_i2c.c 2010-07-09
16:38:29.935972555 -0700
+@@ -492,9 +492,6 @@
+ /* initialize the programmer */
+ msp430_programmer_probe(client);
+
+- /* request firmware upgrade (if needed) */
+- msp430_programmer_upgrade(client);
+-
+ /* register power off handler */
+ pm_power_off = msp430_power_off;
+
Modified: 7.6/trunk/squeezeos/src/imx25/patches/series
URL:
http://svn.slimdevices.com/jive/7.6/trunk/squeezeos/src/imx25/patches/series?rev=8990&r1=8989&r2=8990&view=diff
==============================================================================
--- 7.6/trunk/squeezeos/src/imx25/patches/series (original)
+++ 7.6/trunk/squeezeos/src/imx25/patches/series Mon Jul 26 09:54:15 2010
@@ -1387,3 +1387,4 @@
#logitech/baby-audio-dac-pll-fix-and-i2c-init-fix.patch
logitech/baby-debounce.patch
+logitech/msp430-init-seq.patch
_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/jive-checkins