All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot-Users] u-boot-1.2.0/cpu/mpc8xx/i2c.c: problem in i2c_init when defining CFG_ALLOC_DPRAM
@ 2007-11-15 18:59 DI BACCO ANTONIO - technolabs
  2007-11-17  1:31 ` Wolfgang Denk
  0 siblings, 1 reply; 2+ messages in thread
From: DI BACCO ANTONIO - technolabs @ 2007-11-15 18:59 UTC (permalink / raw)
  To: u-boot


Hi all,

looking at the following code I think that dpram is not allocated if iip->iic_rbase is not null and this happen in my case with an MPC880:

//////////////////////////////////////////////////////////////////
void i2c_init(int speed, int slaveaddr)
{
	volatile immap_t *immap = (immap_t *)CFG_IMMR ;
	volatile cpm8xx_t *cp = (cpm8xx_t *)&immap->im_cpm;
	volatile i2c8xx_t *i2c	= (i2c8xx_t *)&immap->im_i2c;
	volatile iic_t *iip = (iic_t *)&cp->cp_dparam[PROFF_IIC];
	ulong rbase, tbase;
	volatile I2C_BD *rxbd, *txbd;
	uint dpaddr;

#ifdef CFG_I2C_INIT_BOARD
	/* call board specific i2c bus reset routine before accessing the   */
	/* environment, which might be in a chip on that bus. For details   */
	/* about this problem see doc/I2C_Edge_Conditions.                  */
	i2c_init_board();
#endif

#ifdef CFG_I2C_UCODE_PATCH
	iip = (iic_t *)&cp->cp_dpmem[iip->iic_rpbase];
#else
        iip = (iic_t *)&cp->cp_dparam[PROFF_IIC];
	/* Disable relocation */
	//iip->iic_rpbase = 0;
#endif

#ifdef CFG_ALLOC_DPRAM
	dpaddr = iip->iic_rbase;
	if (dpaddr == 0) {
	    /* need to allocate dual port ram */
	    dpaddr = dpram_alloc_align(
		(NUM_RX_BDS * sizeof(I2C_BD)) + (NUM_TX_BDS * sizeof(I2C_BD)) +
		MAX_TX_SPACE, 8);
	}
#else
	dpaddr = CPM_I2C_BASE;
#endif

/////////////////////////////////////////////////////////////////////////////
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.denx.de/pipermail/u-boot/attachments/20071115/78f13e17/attachment.htm 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [U-Boot-Users] u-boot-1.2.0/cpu/mpc8xx/i2c.c: problem in i2c_init when defining CFG_ALLOC_DPRAM
  2007-11-15 18:59 [U-Boot-Users] u-boot-1.2.0/cpu/mpc8xx/i2c.c: problem in i2c_init when defining CFG_ALLOC_DPRAM DI BACCO ANTONIO - technolabs
@ 2007-11-17  1:31 ` Wolfgang Denk
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Denk @ 2007-11-17  1:31 UTC (permalink / raw)
  To: u-boot

In message <F1F6EC0C8B75034F9E3A79FC85122E8E2649F0@aquib01a> you wrote:
> 
> looking at the following code I think that dpram is not allocated if =
> iip->iic_rbase is not null and this happen in my case with an MPC880:

The exising code has probably only ever  been  used  with  the  older
members of the MPC8xx family (823, 850, 855, 860) and need fixing for
the newer ones like 880, 885 etc.

Patches are welcome (note that they must  work  with  both  types  of
preocessors, then).

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
miracle:  an  extremely  outstanding  or  unusual  event,  thing,  or
accomplishment.                                - Webster's Dictionary

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-11-17  1:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-15 18:59 [U-Boot-Users] u-boot-1.2.0/cpu/mpc8xx/i2c.c: problem in i2c_init when defining CFG_ALLOC_DPRAM DI BACCO ANTONIO - technolabs
2007-11-17  1:31 ` Wolfgang Denk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.