[flashrom] [commit] r759 - trunk

Luc Verhaegen libv at skynet.be
Sun Dec 6 07:46:32 CET 2009


On Sun, Nov 15, 2009 at 06:13:29PM +0100, svn at flashrom.org wrote:
> Author: hailfinger
> Date: 2009-11-15 18:13:29 +0100 (Sun, 15 Nov 2009)
> New Revision: 759

>  static int enable_flash_sis630(struct pci_dev *dev, const char *name)

>  	/* First probe for Super I/O on config port 0x2e. */
> -	OUTB(0x87, 0x2e);
> -	OUTB(0x01, 0x2e);
> -	OUTB(0x55, 0x2e);
> -	OUTB(0x55, 0x2e);
> +	siobase = 0x2e;
> +	enter_conf_mode_ite(siobase);
>  
> -	if (INB(0x2f) != 0x87) {
> +	if (INB(siobase + 1) != 0x87) {
>  		/* If that failed, try config port 0x4e. */
> -		OUTB(0x87, 0x4e);
> -		OUTB(0x01, 0x4e);
> -		OUTB(0x55, 0x4e);
> -		OUTB(0xaa, 0x4e);
> -		if (INB(0x4f) != 0x87) {
> -			printf("Can not access SiS 950\n");
> +		siobase = 0x4e;
> +		enter_conf_mode_ite(siobase);
> +		if (INB(siobase + 1) != 0x87) {
> +			printf("Can not find SuperI/O.\n");
>  			return -1;
>  		}
> -		OUTB(0x24, 0x4e);
> -		b = INB(0x4f) | 0xfc;
> -		OUTB(0x24, 0x4e);
> -		OUTB(b, 0x4f);
> -		OUTB(0x02, 0x4e);
> -		OUTB(0x02, 0x4f);
>  	}
>  
> -	OUTB(0x24, 0x2e);
> -	printf_debug("2f is %#x\n", INB(0x2f));
> -	b = INB(0x2f) | 0xfc;
> -	OUTB(0x24, 0x2e);
> -	OUTB(b, 0x2f);
> +	/* Enable flash mapping. Works for most old ITE style SuperI/O. */
> +	tmp = sio_read(siobase, 0x24);
> +	tmp |= 0xfc;
> +	sio_write(siobase, 0x24, tmp);
>  
> -	OUTB(0x02, 0x2e);
> -	OUTB(0x02, 0x2f);
> +	exit_conf_mode_ite(siobase);
>  
> -	return 0;
> +	return ret;
>  }

Superio code in the chipset enable... Needs to be moved out, some VT823x 
based boards also require the same stuff.

Maybe we need a superio_enable.c, which not only sets bits like that 
(some winbonds need the same) but which also contain the gpio specific 
routines.

Luc Verhaegen.






More information about the flashrom mailing list