apparent error in micropatch.c

Robert P. J. Day rpjday at
Sat Sep 18 09:23:18 EST 2004

   i *believe* there's an error in arch/ppc/8xx_io/micropatch.c 
regarding how the SMC patch is applied.

   in the latest bk pull of that file, line 186:

/* SMC2/IIC/SPI Patch */
/* This is the area from 0x2000 to 0x23ff.
uint patch_2000[] = {
         ... etc ...

actually, that patch is not 1024 bytes long, but 1280 bytes, which 
means it goes to 0x24ff, not 0x23ff.  this certainly seems like it's 
going to cause problems further down, when that same file defines a 
relocation base for a couple structures starting at 0x2400:

#if defined(USE_SMC_PATCH) || defined(USE_IIC_PATCH)

         iip = (iic_t *)&commproc->cp_dparam[PROFF_IIC];
#define RPBASE 0x0400    <--  ???????
         iip->iic_rpbase = RPBASE;

         /* Put SPI above the IIC, also 32-byte aligned.
         i = (RPBASE + sizeof(iic_t) + 31) & ~31;
         spp = (spi_t *)&commproc->cp_dparam[PROFF_SPI];
         spp->spi_rpbase = i;

i'm pretty sure that trying to relocate the iic_t struct to that 
offset is going to clash badly with the tail end of the patch, no?
perhaps RPBASE could be set to 0x0500 to avoid this?

or am i misreading something?


More information about the Linuxppc-dev mailing list