[U-Boot] [PATCH v3] Add "cpu_config" command for PPC4xx bootstrap configuration

Matthias Fuchs matthias.fuchs at esd.eu
Sat Jul 18 11:55:27 CEST 2009


Hi Wolfgang,

Wolfgang Denk schrieb:
> Dear Matthias Fuchs,
> 
> In message <200907172157.12244.matthias.fuchs at esd.eu> you wrote:
> ...
> 
> [450+ lines of full quote deleted.]
> 
> Please quote only relevant code snippets. Thanks.
> 
>>> +	for (i = 0; i < ppc4xx_config_count; i++) {
>>> +		/*
>>> +		 * Search for configuration name/label
>>> +		 */
>>> +		if (strcmp(argv[1], ppc4xx_config_val[i].label) == 0) {
>>> +			printf("Using configuration:\n%-16s - %s\n",
>>> +			       ppc4xx_config_val[i].label,
>>> +			       ppc4xx_config_val[i].description);
>>> +
>>> +			ret = i2c_write(CONFIG_4xx_CONFIG_I2C_EEPROM_ADDR, 0, 1,
>>> +					ppc4xx_config_val[i].val,
>>> +					CONFIG_4xx_CONFIG_BLOCKSIZE);
>> I would like to see eeprom_write() here. On 405EP the strapping data is 0x20 
>> bytes but the/our EEPROM has a page size of 16 bytes so i2c_write makes 
>> problems with the 2nd half of data. Also eeprom_write handles the write 
>> protection stuff. See some esd boards or the recent sbe command implementation
>> in my last PMC405DE patch. 
> 
> I disagree here. There is no guarantee (and actually no need) that
> CONFIG_CMD_EEPROM is enabled in a configuration that want to use this
> feature.
correct.

> 
> If i2c_write() has issues on your boards that is IMO a bug that needs
> to be fixed (but that's another story).
It's not an issue on our boards! And it's not a bug with i2c_write().
When writing more bytes to an eeprom than it's actual pagesize you have
to take special care. This is done in eeprom_write(). i2c_write() to
an eeprom only works with up to pagesize bytes!

Either we use eeprom_write() or we use multiple call of i2c_write().
If we do not change this, Stefan's code does not work with 405EP cpus.
On these you have 0x20 strapping bytes and typicall EEPROMs with 8 or 16
bytes pagesize (24W01/02/04/08/16).

Matthias




More information about the U-Boot mailing list