Skip to contentSkip to conversation

Update i386 code (sc520_cdp)

PATCH New Graeme Russ 1 participant 1 message Sep 6, 2008

lore
Share & tools
lore
#0 lore raw

cover Update i386 code (sc520_cdp)

This is the first time I have submitted to an open source project, so please bear with me...

I have been trying to compile U-Boot for a custom AMD SC520 board for the last few weeks. I started on the 1.3.4 release but figured it would be for the betterment of U-Boot to get the i386 code base back in line with the master branch. As far as I can tell, the i386 / sc520 ports have not been actively developed for some time (maybe as far back as 2003/2004). If anyone else on this list has build for i386 / sc520 using a recent commit, can you please let me know.

My build environment is:
- Ubuntu 8.04 (i86_32)
- gcc (GCC) 4.2.3 (Ubuntu 4.2.3-2ubuntu7)
- GNU Make 3.81
- Eclipse Version: 3.4.0

In my efforts, I think I may have uncovered a few issues which go beyond the i386 port. These mainly relate to PCI and ATA as described below. As a result, I have had to temporarily disable support for SATA, PCI and VIDEO for the sc520_cdp board. I have added a #define GRUSS_TESTING in /inlude/configs/sc520_cdp.h which is used to conditionally undefine:
CONFIG_CMD_SATA
CFG_SATA_MAXBUS
CFG_SATA_DEVS_PER_BUS
CFG_SATA_MAX_DEVICE
CONFIG_ATA_PIIX
CONFIG_VIDEO
CONFIG_PCI
CONFIG_PCI_PNP
CONFIG_PCI_SCAN_SHOW

Some #ifdef CONFIG_PCI and #ifdef CONFIG_VIDEO have been added to /lib_i386/video_bios.c and /lib_i386/bios_setup.c to resolve several compiler and linker warnings and errors as a result of removing PCI and Video support

The detailed list of errors "sidestepped" by these 'hacks' is listed below (apologies for the formatting - I probably should have included compiler output)
file: /drivers/block/ata_piix.c
line 313
code:

	printf ("ata%u is slow to respond,plz be patient\n", port);

error:
format '%u' expects type 'unsigned int', but argument 2 has type
'struct sata_port *'
line 321
code:

	printf ("ata%u failed to respond : ", port);

error:
format '%u' expects type 'unsigned int', but argument 2 has type
'struct sata_port *'
line 366
code:

	input_data (&port[num].ioaddr, (ulong *) iobuf, ATA_SECTORWORDS);
  error:
	dereferencing type-punned pointer will break strict-aliasing rules
 lines 392 to 397
  code:
	sata_cpy (sata_dev_desc[devno].revision, iop->fw_rev,
		  sizeof (sata_dev_desc[devno].revision));
	sata_cpy (sata_dev_desc[devno].vendor, iop->model,
		  sizeof (sata_dev_desc[devno].vendor));
	sata_cpy (sata_dev_desc[devno].product, iop->serial_no,
		  sizeof (sata_dev_desc[devno].product));

error:
pointer targets in passing argument 1 of 'sata_cpy' differ in signedness

file: /drivers/block/ata_piix.h
lines 45 to 49
code:

#define ata_id_u64(id,n)        \
	(((u64) (id)[(n) + 3] << 48) | \
	((u64) (id)[(n) + 2] << 32) | \
	((u64) (id)[(n) + 1] << 16) | \
	((u64) (id)[(n) + 0]) )
  error:
	"ata_id_u64" redefined

lines 53 to 67
code:
static inline void
ata_dump_id (u16 * id)

{
	PRINTF ("49 = 0x%04x  "
		"53 = 0x%04x  "
		"63 = 0x%04x  "
		"64 = 0x%04x  "
		"75 = 0x%04x  \n", id[49], id[53], id[63], id[64], id[75]);
	PRINTF ("80 = 0x%04x  "
		"81 = 0x%04x  "
		"82 = 0x%04x  "
		"83 = 0x%04x  "
		"84 = 0x%04x  \n", id[80], id[81], id[82], id[83], id[84]);
	PRINTF ("88 = 0x%04x  " "93 = 0x%04x\n", id[88], id[93]);
}

error:
static declaration of 'ata_dump_id' follows non-static declaration

file: /include/libata.h
lines 451 - 455
code:

#define ata_id_u64(id,n)	\
	( ((u64) (id)[(n) + 3] << 48) | \
	  ((u64) (id)[(n) + 2] << 32) | \
	  ((u64) (id)[(n) + 1] << 16) | \
	  ((u64) (id)[(n) + 0]) )

error:
this is the location of the previous definition

line 666
code:
void ata_dump_id(u16 *id);
error:
previous declaration of 'ata_dump_id' was here

file: /lib_i386/video_bios.c
lines 88 to 90
code:

	if ((devbusfn = pci_find_class(PCI_CLASS_VIDEO,
				       PCI_CLASS_VIDEO_STD,
				       PCI_CLASS_VIDEO_PROG_IF_VGA, 0)) != -1) {

error:
undefined reference to `pci_find_class'