~ubuntu-branches/ubuntu/maverick/uboot-imx/maverick

« back to all changes in this revision

Viewing changes to board/esd/cpci750/i2c.c

  • Committer: Bazaar Package Importer
  • Author(s): Oliver Grawert
  • Date: 2010-01-20 15:41:26 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100120154126-7bha1jeyjegu7xm5
Tags: 2009.08+really2009.01-0ubuntu1
* revert to the 2009.01 upstream version, 2009.08 has still to 
  many work in progress items in the freescale patchset (MMC and NIC
  dont work at all)
* add the latest patchset from freescale for 2009.01
* add 1002_enable_hush_shell_and_ext2.patch to enable hush shell and ext2 
* add 1003_fix_board_revision_numbers to make sure babbage 2.5 boards have 
  revision 51120 and babbage 3.0 boards have revision 51130 properly set in 
  their cpuinfo

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#include <common.h>
28
28
#include <mpc8xx.h>
29
29
#include <malloc.h>
30
 
#include <i2c.h>
31
30
#include "../../Marvell/include/mv_gen_reg.h"
32
31
#include "../../Marvell/include/core.h"
33
32
 
42
41
 
43
42
/* Assuming that there is only one master on the bus (us) */
44
43
 
45
 
void i2c_init (int speed, int slaveaddr)
 
44
static void i2c_init (int speed, int slaveaddr)
46
45
{
47
46
        unsigned int n, m, freq, margin, power;
48
47
        unsigned int actualN = 0, actualM = 0;
376
375
        return 0;               /* sucessful completion */
377
376
}
378
377
 
379
 
int
 
378
uchar
380
379
i2c_read (uchar dev_addr, unsigned int offset, int alen, uchar * data,
381
380
          int len)
382
381
{
385
384
 
386
385
        DP (puts ("i2c_read\n"));
387
386
 
388
 
        /* set the i2c frequency */
389
 
        i2c_init (i2cFreq, CONFIG_SYS_I2C_SLAVE);
 
387
        i2c_init (i2cFreq, 0);  /* set the i2c frequency */
390
388
 
391
389
        status = i2c_set_dev_offset (dev_addr, offset, 0, alen);        /* send the slave address + offset */
392
390
        if (status) {
425
423
}
426
424
 
427
425
 
428
 
int
 
426
uchar
429
427
i2c_write (uchar dev_addr, unsigned int offset, int alen, uchar * data,
430
428
           int len)
431
429
{
434
432
 
435
433
        DP (puts ("i2c_write\n"));
436
434
 
437
 
        /* set the i2c frequency */
438
 
        i2c_init (i2cFreq, CONFIG_SYS_I2C_SLAVE);
 
435
        i2c_init (i2cFreq, 0);  /* set the i2c frequency */
439
436
 
440
437
        status = i2c_set_dev_offset (dev_addr, offset, 0, alen);        /* send the slave address + offset */
441
438
        if (status) {
471
468
 
472
469
        DP (puts ("i2c_probe\n"));
473
470
 
474
 
        /* set the i2c frequency */
475
 
        i2c_init (i2cFreq, CONFIG_SYS_I2C_SLAVE);
 
471
        i2c_init (i2cFreq, 0);  /* set the i2c frequency */
476
472
 
477
473
        status = i2c_set_dev_offset (chip, 0, 0, 0);    /* send the slave address + no offset */
478
474
        if (status) {