Patchwork IEI Kino 780 AM2 mainboard

login
register
about
Submitter Marc Jones
Date 2010-09-10 22:51:35
Message ID <AANLkTik4eWt_025MN9Jwjwc0yx83QcuP+pEy2y6Y-RMt@mail.gmail.com>
Download mbox | patch
Permalink /patch/1913/
State Accepted
Headers show

Comments

Marc Jones - 2010-09-10 22:51:35
IEI Kino mainoard support based on Mahogany Fam10.
svn copy amd/mahogany iei/kino-780am2-fam10; then apply the patch.

Signed-off-by: Marc Jones <marcj303@gmail.com>
Peter Stuge - 2010-09-10 23:39:22
Marc Jones wrote:
> IEI Kino mainoard support based on Mahogany Fam10.
> svn copy amd/mahogany iei/kino-780am2-fam10; then apply the patch.
> 
> Signed-off-by: Marc Jones <marcj303@gmail.com>


> +++ coreboot/src/mainboard/iei/kino-780am2-fam10/mainboard.c	2010-09-10 10:14:37.000000000 -0600
..
> +/* FIXME - Need to find GPIO for PCIE slot.
> + * Kino uses GPIO ? as PCIe slot reset, GPIO? as GFX slot reset. We need to
>   * pull it up before training the slot.
>   ***/
>  void set_pcie_dereset()
>  {
..
> +	/* No PCIE slots.*/
>  }
>  
>  void set_pcie_reset()
>  {
..
> +	/* No PCIE slots.*/
>  }

Uh? Is there or is there not a PCIe slot?


> -static void mahogany_enable(device_t dev)
> +static void kino_enable(device_t dev)
>  {
> -	printk(BIOS_INFO, "Mainboard MAHOGANY Enable. dev=0x%p\n", dev);
> +	printk(BIOS_INFO, "Mainboard Kino Enable. dev=0x%p\n", dev);
>  
>  #if (CONFIG_GFXUMA == 1)
>  	msr_t msr, msr2;
> @@ -166,6 +121,6 @@
>  }
>  
>  struct chip_operations mainboard_ops = {
> -	CHIP_NAME("AMD MAHOGANY   Mainboard")
> -	.enable_dev = mahogany_enable,
> +	CHIP_NAME("IEI Kino-780AM2 Mainboard")
> +	.enable_dev = kino_enable,
>  };

Could the mainboard enable function reuse the CHIP_NAME somehow, or
maybe both should just use CONFIG_MAINBOARD_PART_NUMBER ?


Acked-by: Peter Stuge <peter@stuge.se>
Carl-Daniel Hailfinger - 2010-09-11 11:37:24
On 11.09.2010 01:39, Peter Stuge wrote:
> Marc Jones wrote:
>   
>> -static void mahogany_enable(device_t dev)
>> +static void kino_enable(device_t dev)
>>  {
>> -	printk(BIOS_INFO, "Mainboard MAHOGANY Enable. dev=0x%p\n", dev);
>> +	printk(BIOS_INFO, "Mainboard Kino Enable. dev=0x%p\n", dev);
>>  
>>  #if (CONFIG_GFXUMA == 1)
>>  	msr_t msr, msr2;
>> @@ -166,6 +121,6 @@
>>  }
>>  
>>  struct chip_operations mainboard_ops = {
>> -	CHIP_NAME("AMD MAHOGANY   Mainboard")
>> -	.enable_dev = mahogany_enable,
>> +	CHIP_NAME("IEI Kino-780AM2 Mainboard")
>> +	.enable_dev = kino_enable,
>>  };
>>     
>
> Could the mainboard enable function reuse the CHIP_NAME somehow, or
> maybe both should just use CONFIG_MAINBOARD_PART_NUMBER ?
>   

I once had such a patch, but I think it was rejected for two reasons:
- grepping is more difficult because you have to match in two stages
- building multi-mainboard images means CONFIG_MAINBOARD_PART_NUMBER is
not really meaningful.

That said, I still support the idea and would be willing to update my patch.

Regards,
Carl-Daniel
Peter Stuge - 2010-09-11 18:43:38
Carl-Daniel Hailfinger wrote:
> >> -	printk(BIOS_INFO, "Mainboard MAHOGANY Enable. dev=0x%p\n", dev);
> >> +	printk(BIOS_INFO, "Mainboard Kino Enable. dev=0x%p\n", dev);
..
> >>  struct chip_operations mainboard_ops = {
> >> -	CHIP_NAME("AMD MAHOGANY   Mainboard")
> >> -	.enable_dev = mahogany_enable,
> >> +	CHIP_NAME("IEI Kino-780AM2 Mainboard")
> >> +	.enable_dev = kino_enable,
> >>  };
> >
> > Could the mainboard enable function reuse the CHIP_NAME somehow, or
> > maybe both should just use CONFIG_MAINBOARD_PART_NUMBER ?
> 
> I once had such a patch, but I think it was rejected for two reasons:
> - grepping is more difficult because you have to match in two stages

Maybe make more use of __func__ then.


> - building multi-mainboard images means CONFIG_MAINBOARD_PART_NUMBER
> is not really meaningful.

Maybe it should be set by the build system per mainboard?

I think we still some time left before multiboard images, but I also
think that the current coreboot infrastructure is a really great
starting point for it.

I guess it will use the same scheme as fallback at least initially,
with some method added for determining the current board, that means
building one image per board anyway.


//Peter
Marc Jones - 2010-09-13 19:25:20
On Fri, Sep 10, 2010 at 5:39 PM, Peter Stuge <peter@stuge.se> wrote:
> Marc Jones wrote:
>> IEI Kino mainoard support based on Mahogany Fam10.
>> svn copy amd/mahogany iei/kino-780am2-fam10; then apply the patch.
>>
>> Signed-off-by: Marc Jones <marcj303@gmail.com>
>
>
>> +++ coreboot/src/mainboard/iei/kino-780am2-fam10/mainboard.c  2010-09-10 10:14:37.000000000 -0600
> ..
>> +/* FIXME - Need to find GPIO for PCIE slot.
>> + * Kino uses GPIO ? as PCIe slot reset, GPIO? as GFX slot reset. We need to
>>   * pull it up before training the slot.
>>   ***/
>>  void set_pcie_dereset()
>>  {
> ..
>> +     /* No PCIE slots.*/
>>  }
>>
>>  void set_pcie_reset()
>>  {
> ..
>> +     /* No PCIE slots.*/
>>  }
>
> Uh? Is there or is there not a PCIe slot?
>
>
>> -static void mahogany_enable(device_t dev)
>> +static void kino_enable(device_t dev)
>>  {
>> -     printk(BIOS_INFO, "Mainboard MAHOGANY Enable. dev=0x%p\n", dev);
>> +     printk(BIOS_INFO, "Mainboard Kino Enable. dev=0x%p\n", dev);
>>
>>  #if (CONFIG_GFXUMA == 1)
>>       msr_t msr, msr2;
>> @@ -166,6 +121,6 @@
>>  }
>>
>>  struct chip_operations mainboard_ops = {
>> -     CHIP_NAME("AMD MAHOGANY   Mainboard")
>> -     .enable_dev = mahogany_enable,
>> +     CHIP_NAME("IEI Kino-780AM2 Mainboard")
>> +     .enable_dev = kino_enable,
>>  };
>
> Could the mainboard enable function reuse the CHIP_NAME somehow, or
> maybe both should just use CONFIG_MAINBOARD_PART_NUMBER ?
>
>
> Acked-by: Peter Stuge <peter@stuge.se>

I updated the PCIE slot comment to "Slot not yet supported".

r5812

Thanks,
Marc

Patch

Index: coreboot/src/mainboard/iei/kino-780am2-fam10/Kconfig
===================================================================
--- coreboot.orig/src/mainboard/iei/kino-780am2-fam10/Kconfig	2010-09-10 16:33:00.000000000 -0600
+++ coreboot/src/mainboard/iei/kino-780am2-fam10/Kconfig	2010-09-10 12:58:00.000000000 -0600
@@ -1,4 +1,4 @@ 
-if BOARD_AMD_MAHOGANY_FAM10
+if BOARD_IEI_KINO_FAM10
 
 config BOARD_SPECIFIC_OPTIONS # dummy
 	def_bool y
@@ -9,7 +9,7 @@ 
 	select NORTHBRIDGE_AMD_AMDFAM10
 	select SOUTHBRIDGE_AMD_RS780
 	select SOUTHBRIDGE_AMD_SB700
-	select SUPERIO_ITE_IT8718F
+	select SUPERIO_FINTEK_F71859
 	select BOARD_HAS_FADT
 	select HAVE_BUS_CONFIG
 	select HAVE_OPTION_TABLE
@@ -30,7 +30,7 @@ 
 
 config MAINBOARD_DIR
 	string
-	default amd/mahogany_fam10
+	default iei/kino-780am2-fam10
 
 config APIC_ID_OFFSET
 	hex
@@ -38,7 +38,7 @@ 
 
 config MAINBOARD_PART_NUMBER
 	string
-	default "Mahogany (Fam10)"
+	default "Kino-780AM2(Fam10)"
 
 config HW_MEM_HOLE_SIZEK
 	hex
@@ -78,7 +78,7 @@ 
 
 config AMD_UCODE_PATCH_FILE
 	string
-	default "mc_patch_01000095.h"
+	default "mc_patch_01000086.h"
 
 config RAMTOP
 	hex
@@ -94,11 +94,11 @@ 
 
 config MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID
 	hex
-	default 0x3060
+	default 0x0000
 
 config MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID
 	hex
-	default 0x1022
+	default 0x0000
 
 config RAMBASE
 	hex
@@ -108,4 +108,8 @@ 
 	hex
 	default 0
 
-endif # BOARD_AMD_MAHOGANY_FAM10
+config FALLBACK_VGA_BIOS_ID
+	string
+	default "1002,9615"
+
+endif #BOARD_IEI_KINO_FAM10
Index: coreboot/src/mainboard/iei/kino-780am2-fam10/devicetree.cb
===================================================================
--- coreboot.orig/src/mainboard/iei/kino-780am2-fam10/devicetree.cb	2010-09-10 16:33:00.000000000 -0600
+++ coreboot/src/mainboard/iei/kino-780am2-fam10/devicetree.cb	2010-09-09 17:25:20.000000000 -0600
@@ -1,4 +1,4 @@ 
-# sample config for amd/mahogany_fam10
+# Config for iei/kino-780am2-fam10
 chip northbridge/amd/amdfam10/root_complex
 	device lapic_cluster 0 on
 		chip cpu/amd/socket_AM2r2  #L1 and DDR2
@@ -46,17 +46,11 @@ 
 						chip drivers/generic/generic #dimm 0-0-1
 							device i2c 51 on end
 						end
-						chip drivers/generic/generic #dimm 0-1-0
-							device i2c 52 on end
-						end
-						chip drivers/generic/generic #dimm 0-1-1
-							device i2c 53 on end
-						end
 					end # SM
 					device pci 14.1 on end # IDE    0x439c
 					device pci 14.2 on end # HDA    0x4383
 					device pci 14.3 on # LPC	0x439d
-						chip superio/ite/it8718f
+						chip superio/fintek/f71859
 							device pnp 2e.0 off #  Floppy
 								io 0x60 = 0x3f0
 								irq 0x70 = 6
@@ -83,60 +77,17 @@ 
 							device pnp 2e.6 on #  Mouse
 								irq 0x70 = 12
 							end
-							device pnp 2e.7 off #  GPIO, must be closed for unresolved reason.
-							end
-							device pnp 2e.8 off #  MIDI
-								io 0x60 = 0x300
-								irq 0x70 = 9
-							end
-							device pnp 2e.9 off #  GAME
-								io 0x60 = 0x220
-							end
-							device pnp 2e.a off end #  CIR
-						end	#superio/ite/it8718f
+						end		#SIO
 					end		#LPC
 					device pci 14.4 on end # PCI 0x4384
 					device pci 14.5 on end # USB 2
 					register "boot_switch_sata_ide" = "0"	# 0: boot from SATA. 1: IDE
 				end	#southbridge/amd/sb700
 			end #  device pci 18.0
-
-			device pci 18.0 on end
-			device pci 18.0 on end
 			device pci 18.1 on end
 			device pci 18.2 on end
 			device pci 18.3 on end
-			device pci 18.4 on end
-#			device pci 00.5 on end
 		end
 	end #pci_domain
-	#for node 32 to node 63
-#	device pci_domain 0 on
-#		chip northbridge/amd/amdfam10
-#			  device pci 00.0 on end#  northbridge
-#			  device pci 00.0 on end
-#			  device pci 00.0 on end
-#			  device pci 00.0 on end
-#			  device pci 00.1 on end
-#			  device pci 00.2 on end
-#			  device pci 00.3 on end
-#			  device pci 00.4 on end
-#			 device pci 00.5 on end
-#		end
-#	end #pci_domain
-
-#	  chip drivers/generic/debug
-#		 device pnp 0.0 off end # chip name
-#		  device pnp 0.1 on end # pci_regs_all
-#		  device pnp 0.2 off end # mem
-#		  device pnp 0.3 off end # cpuid
-#		  device pnp 0.4 off end # smbus_regs_all
-#		  device pnp 0.5 off end # dual core msr
-#		  device pnp 0.6 off end # cache size
-#		  device pnp 0.7 off end # tsc
-#		  device pnp 0.8 off end # hard reset
-#		  device pnp 0.9 off end # mcp55
-#		  device pnp 0.a on end # GH ext table
-#	 end
+end #root_complex
 
-end
Index: coreboot/src/mainboard/iei/kino-780am2-fam10/dsdt.asl
===================================================================
--- coreboot.orig/src/mainboard/iei/kino-780am2-fam10/dsdt.asl	2010-09-10 16:33:00.000000000 -0600
+++ coreboot/src/mainboard/iei/kino-780am2-fam10/dsdt.asl	2010-09-10 09:58:46.000000000 -0600
@@ -22,8 +22,8 @@ 
 	"DSDT.AML",           /* Output filename */
 	"DSDT",                 /* Signature */
 	0x02,		/* DSDT Revision, needs to be 2 for 64bit */
-	"AMD   ",               /* OEMID */
-	"MAHOGANY",	     /* TABLE ID */
+	"IEI   ",               /* OEMID */
+	"KINO    ",	     /* TABLE ID */
 	0x00010001	/* OEM Revision */
 	)
 {	/* Start of ASL file */
@@ -1450,7 +1450,7 @@ 
 				Name(_ADR, 0x00140006)
 			} /* end Ac97modem */
 
-			/* ITE8718 Support */
+			/* SIO Support */
 			OperationRegion (IOID, SystemIO, 0x2E, 0x02)	/* sometimes it is 0x4E */
 				Field (IOID, ByteAcc, NoLock, Preserve)
 				{
Index: coreboot/src/mainboard/iei/kino-780am2-fam10/mainboard.c
===================================================================
--- coreboot.orig/src/mainboard/iei/kino-780am2-fam10/mainboard.c	2010-09-10 16:33:01.000000000 -0600
+++ coreboot/src/mainboard/iei/kino-780am2-fam10/mainboard.c	2010-09-10 10:14:37.000000000 -0600
@@ -35,77 +35,32 @@ 
 void set_pcie_dereset(void);
 void set_pcie_reset(void);
 u8 is_dev3_present(void);
-/*
- * Mahogany uses GPIO 6 as PCIe slot reset, GPIO4 as GFX slot reset. We need to
+/* FIXME - Need to find GPIO for PCIE slot.
+ * Kino uses GPIO ? as PCIe slot reset, GPIO? as GFX slot reset. We need to
  * pull it up before training the slot.
  ***/
 void set_pcie_dereset()
 {
-	u16 word;
-	device_t sm_dev;
-	/* GPIO 6 reset PCIe slot, GPIO 4 reset GFX PCIe */
-	sm_dev = dev_find_slot(0, PCI_DEVFN(0x14, 0));
-
-	word = pci_read_config16(sm_dev, 0xA8);
-	word |= (1 << 0) | (1 << 2);	/* Set Gpio6,4 as output */
-	word &= ~((1 << 8) | (1 << 10));
-	pci_write_config16(sm_dev, 0xA8, word);
+	/* No PCIE slots.*/
 }
 
 void set_pcie_reset()
 {
-	u16 word;
-	device_t sm_dev;
-	/* GPIO 6 reset PCIe slot, GPIO 4 reset GFX PCIe */
-	sm_dev = dev_find_slot(0, PCI_DEVFN(0x14, 0));
-
-	word = pci_read_config16(sm_dev, 0xA8);
-	word &= ~((1 << 0) | (1 << 2));	/* Set Gpio6,4 as output */
-	word &= ~((1 << 8) | (1 << 10));
-	pci_write_config16(sm_dev, 0xA8, word);
+	/* No PCIE slots.*/
 }
 
-#if 0	     /* not tested yet. */
-/********************************************************
-* mahogany uses SB700 GPIO9 to detect IDE_DMA66.
-* IDE_DMA66 is routed to GPIO 9. So we read Gpio 9 to
-* get the cable type, 40 pin or 80 pin?
-********************************************************/
-static void get_ide_dma66(void)
-{
-	u8 byte;
-	/*u32 sm_dev, ide_dev; */
-	device_t sm_dev, ide_dev;
-
-	sm_dev = dev_find_slot(0, PCI_DEVFN(0x14, 0));
-
-	byte = pci_read_config8(sm_dev, 0xA9);
-	byte |= (1 << 5);	/* Set Gpio9 as input */
-	pci_write_config8(sm_dev, 0xA9, byte);
-
-	ide_dev = dev_find_slot(0, PCI_DEVFN(0x14, 1));
-	byte = pci_read_config8(ide_dev, 0x56);
-	byte &= ~(7 << 0);
-	if ((1 << 5) & pci_read_config8(sm_dev, 0xAA))
-		byte |= 2 << 0;	/* mode 2 */
-	else
-		byte |= 5 << 0;	/* mode 5 */
-	pci_write_config8(ide_dev, 0x56, byte);
-}
-#endif	/* get_ide_dma66() */
-
 u8 is_dev3_present(void)
 {
 	return 0;
 }
 
 /*************************************************
-* enable the dedicated function in mahogany board.
+* enable the dedicated function in kino board.
 * This function called early than rs780_enable.
 *************************************************/
-static void mahogany_enable(device_t dev)
+static void kino_enable(device_t dev)
 {
-	printk(BIOS_INFO, "Mainboard MAHOGANY Enable. dev=0x%p\n", dev);
+	printk(BIOS_INFO, "Mainboard Kino Enable. dev=0x%p\n", dev);
 
 #if (CONFIG_GFXUMA == 1)
 	msr_t msr, msr2;
@@ -166,6 +121,6 @@ 
 }
 
 struct chip_operations mainboard_ops = {
-	CHIP_NAME("AMD MAHOGANY   Mainboard")
-	.enable_dev = mahogany_enable,
+	CHIP_NAME("IEI Kino-780AM2 Mainboard")
+	.enable_dev = kino_enable,
 };
Index: coreboot/src/mainboard/iei/kino-780am2-fam10/mptable.c
===================================================================
--- coreboot.orig/src/mainboard/iei/kino-780am2-fam10/mptable.c	2010-09-10 16:33:01.000000000 -0600
+++ coreboot/src/mainboard/iei/kino-780am2-fam10/mptable.c	2010-08-20 16:44:46.000000000 -0600
@@ -43,7 +43,7 @@ 
 {
 	static const char sig[4] = "PCMP";
 	static const char oem[8] = "COREBOOT";
-	static const char productid[12] = "MAHOGANY    ";
+	static const char productid[12] = "KINO        ";
 	struct mp_config_table *mc;
 	int j;
 
Index: coreboot/src/mainboard/iei/kino-780am2-fam10/romstage.c
===================================================================
--- coreboot.orig/src/mainboard/iei/kino-780am2-fam10/romstage.c	2010-09-10 16:33:01.000000000 -0600
+++ coreboot/src/mainboard/iei/kino-780am2-fam10/romstage.c	2010-09-10 10:01:18.000000000 -0600
@@ -37,6 +37,9 @@ 
 #define SET_FIDVID 1
 #define SET_FIDVID_CORE_RANGE 0
 
+/* UART address and device number */
+#define SERIAL_DEV PNP_DEV(0x2e, F71859_SP1)
+
 #include <stdint.h>
 #include <string.h>
 #include <device/pci_def.h>
@@ -59,7 +62,7 @@ 
 
 static int smbus_read_byte(u32 device, u32 address);
 
-#include "superio/ite/it8718f/it8718f_early_serial.c"
+#include "superio/fintek/f71859/f71859_early_serial.c"
 #include "cpu/x86/mtrr/earlymtrr.c"
 #include <cpu/amd/mtrr.h>
 #include "northbridge/amd/amdfam10/setup_resource_map.c"
@@ -136,7 +139,7 @@ 
 	enable_rs780_dev8();
 	sb700_lpc_init();
 
-	it8718f_enable_serial(0, CONFIG_TTYS0_BASE);
+	f71859_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE);
 	uart_init();
 	console_init();
 	printk(BIOS_DEBUG, "\n");