Hi Jowelle,
I2C davinci driver does support mixed read and write operation.
i2c_transfer function in i2c-core.c supports mixed read and write operation.
One need to pass corresponding "struct i2c_msg" array with read and write
option.

Regards,
Pratik Patel


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Tuesday, May 15, 2007 11:03 AM
To: [email protected]
Subject: Davinci-linux-open-source Digest, Vol 17, Issue 28

Send Davinci-linux-open-source mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Davinci-linux-open-source digest..."


Today's Topics:

   1. Re: NOR flash erase/write time (Andy Ngo)
   2. I2C Repeated Start Condition (Jowelle Pinlac)
   3. User space interrupt handler (Andy Ngo)


----------------------------------------------------------------------

Message: 1
Date: Mon, 14 May 2007 12:57:17 -0700 (PDT)
From: Andy Ngo <[EMAIL PROTECTED]>
Subject: Re: NOR flash erase/write time
To: "Patras, George" <[EMAIL PROTECTED]>,
        [email protected]
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="us-ascii"

George,

The memory controller settings (CS2 on AEMIF) for the NOR flash are not
optimal.  You will need to tweak it under u-boot to get it working optimal.
Refer to my post last month:
http://www.mail-archive.com/[email protected]/m
sg02321.html

If you want a quick test and prevent yourself from bricking the board, you
can change the settings at the u-boot prompt before booting to the Linux
kernel.

1) power up
2) interrupt u-boot
3) enter the following at the prompt to change to a more optimal setting:
             mw.l 0x01e00010 0x0030650d 1
4) continue booting to the kernel


Regards,
Andy


----- Original Message ----
From: "Patras, George" <[EMAIL PROTECTED]>
To: [email protected]
Sent: Monday, May 14, 2007 12:18:59 PM
Subject: NOR flash erase/write time

Hello,

I'm using NOR flash partitions for kernel and ramdisk fileystem. 
I'm finding very slow write times when updating these partitions.
Block size (erase size) is 64k and it takes 1.02 sec to erase and then
0.9 sec to write each block, so to write 1MB takes around 30sec.
Is this normal, does anybody have any experience to the contrary ?

Thanks,
George Patras
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source




-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://linux.omap.com/pipermail/davinci-linux-open-source/attachments/200705
14/dc1a4507/attachment-0001.htm

------------------------------

Message: 2
Date: Tue, 15 May 2007 13:56:22 +0900
From: "Jowelle Pinlac" <[EMAIL PROTECTED]>
Subject: I2C Repeated Start Condition
To: <[email protected]>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="iso-8859-1"

Hi.

Someone in this mailing list must have experienced this.

We have an i2c device which requires a combined write and
read procedure, wherein there is only a repeated start
in between the operations.

Issuing a i2c_client_write then an i2c_client read gives a stop
and a start condition in-between those operations. 

I checked the i2c-davinci driver and it seems like it only
require all read and all write operations and no mixed
write-read operation. In case I missed something,
does the davinci i2c driver supports mixed write-read
operation?

Hope for any advice on this matter.

Regards,
Jowelle

-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://linux.omap.com/pipermail/davinci-linux-open-source/attachments/200705
15/37bdff3a/attachment-0001.htm

------------------------------

Message: 3
Date: Mon, 14 May 2007 22:32:44 -0700 (PDT)
From: Andy Ngo <[EMAIL PROTECTED]>
Subject: User space interrupt handler
To: "davinci-linux-open-source @linux.davincidsp.com"
        <[email protected]>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="us-ascii"

Hi,

This is a general linux question so hopefully so you hopefully you don't
mind me posting it.  I have a trigger source that is hooked up to GPIO1; it
triggers every 8ms.  How do I write a user space interrupt handler that
"wakes" up every time the trigger occurs?  

This is how I currently implement it and I'm not sure if it's efficient; I'm
missing some interrupt triggers some time.

I wrote a kernel module that installs a falling-edge-trigger interrupt
handler to GPIO1 and communicates with the user application via a character
device (/dev/gpio1irq).  The user application opens /dev/gpio1irq and loops
blocking on a read; when the read returns, it processes some stuff, then
blocks on the read again, and so on.  In the kernel module, the read (called
from user space) blocks waiting for a semaphore.  When the interrupt occurs,
the module interrupt handler gives the semaphore,  hence unblocking the read
from the user application, allowing it to process stuff before it blocks on
the read again, waiting for the next trigger.  Can some please provide some
advice or a better way of implementing a user space interrupt handler?
Thanks.

Regards,
Andy



Here's a snippet of my code.

// kernel module

#define GPIO1IRQ_MAJOR     240
#define GPIO1IRQ_DEV_NAME  "gpio1irq"


/* ---- Private Variables ------------------------------------------------
*/

static char gBanner[] __initdata = KERN_INFO "GPIO1 IRQ Driver";

static  int         gDebugTrace = 0;
static  int         gUserIrq = DAVINCI_GPIO_IRQ(1);
static  int         gIrq = 0;

DECLARE_MUTEX(gpio1irq_sem);


/* ---- Private Function Prototypes --------------------------------------
*/
/* ---- Functions --------------------------------------------------------
*/

/***************************************************************************
*
*
*  gpio1irq_interrupt
*
****************************************************************************
/
static irqreturn_t gpio1irq_interrupt( int irq, void *dev_id, struct pt_regs
*regs )
{
    (void)irq;
    (void)dev_id;
    (void)regs;

    up(&gpio1irq_sem);

    return IRQ_HANDLED;

} // gpio1irq_interrupt


/***************************************************************************
*
*
*   gpio1irq_ioctl
*
*   Called to process ioctl requests
*
****************************************************************************
*/
int gpio1irq_ioctl( struct inode *inode, struct file *file, unsigned int
cmd,
                    unsigned long arg )
{
    (void)inode;
    (void)file;
    (void)cmd;
    (void)arg;

    return 0;
} // gpio1irq_ioctl


/***************************************************************************
*
*
*  gpio1irq_open
*
****************************************************************************
/
static int gpio1irq_open( struct inode *inode, struct file *file )
{
    DEBUG( Trace, "gpio1irq_open called, major = %d, minor = %d\n", 
           MAJOR( inode->i_rdev ),  MINOR( inode->i_rdev ));

    return 0;
} // gpio1irq_open


/***************************************************************************
*
*
*  gpio1irq_read
*
****************************************************************************
/
static ssize_t gpio1irq_read( struct file *file, char *buffer, size_t count,
                              loff_t *ppos )
{
    int rc;

    if ( gIrq == 0 )
    {
        if (( gUserIrq >= 0 ) && ( gUserIrq < NR_IRQS ))
        {
            // Register an interrupt handler for the gpio1irq
            gIrq = gUserIrq;

            if (( rc = request_irq( gIrq, (irq_handler_t)gpio1irq_interrupt,

                    IRQF_DISABLED | IRQF_TRIGGER_RISING, "gpio1irq", NULL ))
!= 0 )
            {
                return rc;
            }
        }
    }

    down(&gpio1irq_sem);

    return 1;
} // gpio1irq_read


/***************************************************************************
*
*
*  gpio1irq_write
*
****************************************************************************
/
static int gpio1irq_write(struct file *file, const char *buffer, size_t
count,
                          loff_t * ppos)
{
    (void)file;
    (void)buffer;
    (void)count;
    (void)ppos;

    return 1;
}


/***************************************************************************
*
*
*  gpio1irq_release
*
****************************************************************************
/
static int gpio1irq_release( struct inode *inode, struct file *file )
{
    DEBUG( Trace, "gpio1irq_release called\n" );

    if ( gIrq != 0 )
    {
        free_irq( gIrq, NULL );
        gIrq = 0;
    }

    return 0;
} // gpio1irq_release


/***************************************************************************
*
*
*   File Operations (these are the device driver entry points)
*
****************************************************************************
/
struct file_operations gpio1irq_fops =
{
    owner:      THIS_MODULE,
    ioctl:      gpio1irq_ioctl,
    open:       gpio1irq_open,
    release:    gpio1irq_release,
    write:      gpio1irq_write,
    read:       gpio1irq_read,
};


/***************************************************************************
*
*
*  gpio1irq_init
*
*     Called to perform module initialization when the module is loaded
*
****************************************************************************
/
static int __init gpio1irq_init( void )
{
    int result;

    DEBUG( Trace, "gpio1irq_init called\n" );

    printk( gBanner );
    /* Registering device */
    result = register_chrdev(GPIO1IRQ_MAJOR, "gpio1irq", &gpio1irq_fops);
    if (result < 0) {
        printk("<1>memory: cannot obtain major number %d\n",
GPIO1IRQ_MAJOR);
        return result;
    }
 
    return 0;
} // gpio1irq_init


/***************************************************************************
*
*
*  gpio1irq_exit
*
*       Called to perform module cleanup when the module is unloaded.
*
****************************************************************************
/
static void __exit gpio1irq_exit( void )
{
    DEBUG( Trace, "gpio1irq_exit called\n" );

    /* Freeing the major number */
    unregister_chrdev(GPIO1IRQ_MAJOR, "gpio1irq");

} // gpio1irq_exit

/***************************************************************************
*/

module_init(gpio1irq_init);
module_exit(gpio1irq_exit);




// user application code
int main( int argc, char **argv )
{
    int fd;

    if (( fd = open( "/dev/gpio1irq", O_RDONLY )) < 0 )
    {
        perror( "Unable to open /dev/gpio1irq" );
        exit( 1 );
    }

    while ( 1 )
    {
        read( fd, data, 1 );
        
        // process stuff
    }

    close( fd );
    exit( 0 );
    return 0;

} 



-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://linux.omap.com/pipermail/davinci-linux-open-source/attachments/200705
14/614d157c/attachment.htm

------------------------------

_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


End of Davinci-linux-open-source Digest, Vol 17, Issue 28
*********************************************************



- This message has been scanned for viruses, spam and dangerous content by
www.CleanMailGateway.com, and is believed to be clean.



eInfochips Business Disclaimer:
This message may contain confidential, proprietary or legally Privileged
information. In case you are not the original intended Recipient of the
message, you must not, directly or indirectly, use, Disclose, distribute,
print, or copy any part of this message and you are requested to delete it
and inform the sender. Any views expressed in this message are those of the
individual sender unless otherwise stated. Nothing contained in this message
shall be construed as an offer or acceptance of any offer by eInfochips
Limited and/or eInfochips Inc("eInfochips") unless sent with that express
intent and with due authority of eInfochips. eInfochips has taken enough
precautions to prevent the spread of viruses. However the company accepts no
liability for any damage caused by any virus transmitted by this email.

_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to