<div dir="ltr"><div><div><div><div><div><div><div><div>Everyone,<br><br></div>I tried to port I946GZ and following from 945 example on intel mainboard,<br></div><br></div>and I got error when compiling :<br><br>build/romstage/mainboard/intel/i946gz/romstage.o: In function `mainboard_romstage_entry':<br>/home/bianchi/coreboot/src/mainboard/intel/i946gz/romstage.c:214: undefined reference to `southbridge_detect_s3_resume'<br>/home/bianchi/coreboot/src/mainboard/intel/i946gz/romstage.c:217: undefined reference to `enable_smbus'<br>build/romstage/northbridge/intel/i945/raminit.o: In function `spd_read_byte':<br>/home/bianchi/coreboot/src/northbridge/intel/i945/raminit.c:62: undefined reference to `smbus_read_byte'<br>/home/bianchi/coreboot/src/northbridge/intel/i945/raminit.c:62: undefined reference to `smbus_read_byte'<br>/home/bianchi/coreboot/src/northbridge/intel/i945/raminit.c:62: undefined reference to `smbus_read_byte'<br>/home/bianchi/coreboot/src/northbridge/intel/i945/raminit.c:62: undefined reference to `smbus_read_byte'<br>/home/bianchi/coreboot/src/northbridge/intel/i945/raminit.c:62: undefined reference to `smbus_read_byte'<br>build/romstage/northbridge/intel/i945/raminit.o:/home/bianchi/coreboot/src/northbridge/intel/i945/raminit.c:62: more undefined references to `smbus_read_byte' follow<br>src/arch/x86/Makefile.inc:264: recipe for target 'build/cbfs/fallback/romstage.debug' failed<br>make: *** [build/cbfs/fallback/romstage.debug] Error 1<br><br></div>When I patch it with :<br><br>#include <southbridge/intel/i82801gx/early_lpc.c><br>#include <southbridge/intel/i82801gx/early_smbus.c><br>#include <southbridge/intel/i82801gx/lpc.c><br><br></div>the errors are gone but I got :<br>   GEN        generated/bootblock.ld<br>    CP         bootblock/arch/x86/bootblock.ld<br>    LINK       cbfs/fallback/bootblock.debug<br>    OBJCOPY    cbfs/fallback/bootblock.elf<br>    OBJCOPY    bootblock.raw.bin<br>    CC         romstage/mainboard/intel/i946gz/romstage.o<br>In file included from src/mainboard/intel/i946gz/romstage.c:44:0:<br>src/southbridge/intel/i82801gx/lpc.c: In function 'i82801gx_enable_ioapic':<br>src/southbridge/intel/i82801gx/lpc.c:52:20: error: passing argument 1 of 'pcie_write_config8' makes integer from pointer without a cast [-Werror=int-conversion]<br>  pci_write_config8(dev, ACPI_CNTL, ACPI_EN);<br>                    ^<br>In file included from src/arch/x86/include/arch/io.h:247:0,<br>                 from src/mainboard/intel/i946gz/romstage.c:20:<br>src/arch/x86/include/arch/pci_mmio_cfg.h:49:6: note: expected 'pci_devfn_t {aka unsigned int}' but argument is of type 'struct device *'<br> void pcie_write_config8(pci_devfn_t dev, unsigned int where, u8 value)<br>      ^<br>In file included from src/mainboard/intel/i946gz/romstage.c:44:0:<br>src/southbridge/intel/i82801gx/lpc.c: In function 'i82801gx_enable_serial_irqs':<br>src/southbridge/intel/i82801gx/lpc.c:66:20: error: passing argument 1 of 'pcie_write_config8' makes integer from pointer without a cast [-Werror=int-conversion]<br>  pci_write_config8(dev, SERIRQ_CNTL,<br>                    ^<br>In file included from src/arch/x86/include/arch/io.h:247:0,<br>                 from src/mainboard/intel/i946gz/romstage.c:20:<br>src/arch/x86/include/arch/pci_mmio_cfg.h:49:6: note: expected 'pci_devfn_t {aka unsigned int}' but argument is of type 'struct device *'<br> void pcie_write_config8(pci_devfn_t dev, unsigned int where, u8 value)<br>      ^<br>In file included from src/mainboard/intel/i946gz/romstage.c:44:0:<br>src/southbridge/intel/i82801gx/lpc.c: In function 'i82801gx_pirq_init':<br>src/southbridge/intel/i82801gx/lpc.c:95:24: error: invalid type argument of '->' (have 'device_t {aka unsigned int}')<br>  config_t *config = dev->chip_info;<br>                        ^<br>src/southbridge/intel/i82801gx/lpc.c:97:43: error: dereferencing pointer to incomplete type 'config_t {aka struct southbridge_intel_i82801gx_config}'<br>  pci_write_config8(dev, PIRQA_ROUT, config->pirqa_routing);<br>                                           ^<br>src/southbridge/intel/i82801gx/lpc.c:111:17: error: 'all_devices' undeclared (first use in this function)<br>  for (irq_dev = all_devices; irq_dev; irq_dev = irq_dev->next) {<br>                 ^<br>src/southbridge/intel/i82801gx/lpc.c:111:17: note: each undeclared identifier is reported only once for each function it appears in<br>src/southbridge/intel/i82801gx/lpc.c:111:56: error: invalid type argument of '->' (have 'device_t {aka unsigned int}')<br>  for (irq_dev = all_devices; irq_dev; irq_dev = irq_dev->next) {<br>                                                        ^<br>src/southbridge/intel/i82801gx/lpc.c:114:15: error: invalid type argument of '->' (have 'device_t {aka unsigned int}')<br>   if (!irq_dev->enabled || irq_dev->path.type != DEVICE_PATH_PCI)<br>               ^<br>src/southbridge/intel/i82801gx/lpc.c:114:35: error: invalid type argument of '->' (have 'device_t {aka unsigned int}')<br>   if (!irq_dev->enabled || irq_dev->path.type != DEVICE_PATH_PCI)<br>                                   ^<br>src/southbridge/intel/i82801gx/lpc.c: In function 'i82801gx_gpi_routing':<br>src/southbridge/intel/i82801gx/lpc.c:136:24: error: invalid type argument of '->' (have 'device_t {aka unsigned int}')<br>  config_t *config = dev->chip_info;<br>                        ^<br>src/southbridge/intel/i82801gx/lpc.c: In function 'i82801gx_power_options':<br>src/southbridge/intel/i82801gx/lpc.c:169:24: error: invalid type argument of '->' (have 'device_t {aka unsigned int}')<br>  config_t *config = dev->chip_info;<br>                        ^<br>src/southbridge/intel/i82801gx/lpc.c: In function 'i82801gx_rtc_init':<br>src/southbridge/intel/i82801gx/lpc.c:287:26: error: passing argument 1 of 'pcie_read_config8' makes integer from pointer without a cast [-Werror=int-conversion]<br>  reg8 = pci_read_config8(dev, GEN_PMCON_3);<br>                          ^<br>In file included from src/arch/x86/include/arch/io.h:247:0,<br>                 from src/mainboard/intel/i946gz/romstage.c:20:<br>src/arch/x86/include/arch/pci_mmio_cfg.h:25:4: note: expected 'pci_devfn_t {aka unsigned int}' but argument is of type 'struct device *'<br> u8 pcie_read_config8(pci_devfn_t dev, unsigned int where)<br>    ^<br>In file included from src/mainboard/intel/i946gz/romstage.c:44:0:<br>src/southbridge/intel/i82801gx/lpc.c:291:21: error: passing argument 1 of 'pcie_write_config8' makes integer from pointer without a cast [-Werror=int-conversion]<br>   pci_write_config8(dev, GEN_PMCON_3, reg8);<br>                     ^<br>In file included from src/arch/x86/include/arch/io.h:247:0,<br>                 from src/mainboard/intel/i946gz/romstage.c:20:<br>src/arch/x86/include/arch/pci_mmio_cfg.h:49:6: note: expected 'pci_devfn_t {aka unsigned int}' but argument is of type 'struct device *'<br> void pcie_write_config8(pci_devfn_t dev, unsigned int where, u8 value)<br>      ^<br>In file included from src/mainboard/intel/i946gz/romstage.c:44:0:<br>src/southbridge/intel/i82801gx/lpc.c: In function 'i82801gx_fixups':<br>src/southbridge/intel/i82801gx/lpc.c:402:20: error: passing argument 1 of 'pcie_write_config8' makes integer from pointer without a cast [-Werror=int-conversion]<br>  pci_write_config8(dev, 0xad, 0x3);<br>                    ^<br>In file included from src/arch/x86/include/arch/io.h:247:0,<br>                 from src/mainboard/intel/i946gz/romstage.c:20:<br>src/arch/x86/include/arch/pci_mmio_cfg.h:49:6: note: expected 'pci_devfn_t {aka unsigned int}' but argument is of type 'struct device *'<br> void pcie_write_config8(pci_devfn_t dev, unsigned int where, u8 value)<br>      ^<br>In file included from src/mainboard/intel/i946gz/romstage.c:44:0:<br>src/southbridge/intel/i82801gx/lpc.c: In function 'lpc_init':<br>src/southbridge/intel/i82801gx/lpc.c:410:21: error: passing argument 1 of 'pcie_write_config16' makes integer from pointer without a cast [-Werror=int-conversion]<br>  pci_write_config16(dev, PCI_COMMAND, 0x000f);<br>                     ^<br>In file included from src/arch/x86/include/arch/io.h:247:0,<br>                 from src/mainboard/intel/i946gz/romstage.c:20:<br>src/arch/x86/include/arch/pci_mmio_cfg.h:57:6: note: expected 'pci_devfn_t {aka unsigned int}' but argument is of type 'struct device *'<br> void pcie_write_config16(pci_devfn_t dev, unsigned int where, u16 value)<br>      ^<br>In file included from src/mainboard/intel/i946gz/romstage.c:44:0:<br>src/southbridge/intel/i82801gx/lpc.c:418:21: error: passing argument 1 of 'i82801gx_pirq_init' makes integer from pointer without a cast [-Werror=int-conversion]<br>  i82801gx_pirq_init(dev);<br>                     ^<br>src/southbridge/intel/i82801gx/lpc.c:91:13: note: expected 'device_t {aka unsigned int}' but argument is of type 'struct device *'<br> static void i82801gx_pirq_init(device_t dev)<br>             ^<br>src/southbridge/intel/i82801gx/lpc.c:421:25: error: passing argument 1 of 'i82801gx_power_options' makes integer from pointer without a cast [-Werror=int-conversion]<br>  i82801gx_power_options(dev);<br>                         ^<br>src/southbridge/intel/i82801gx/lpc.c:162:13: note: expected 'device_t {aka unsigned int}' but argument is of type 'struct device *'<br> static void i82801gx_power_options(device_t dev)<br>             ^<br>src/southbridge/intel/i82801gx/lpc.c:424:29: error: passing argument 1 of 'i82801gx_configure_cstates' makes integer from pointer without a cast [-Werror=int-conversion]<br>  i82801gx_configure_cstates(dev);<br>                             ^<br>src/southbridge/intel/i82801gx/lpc.c:266:13: note: expected 'device_t {aka unsigned int}' but argument is of type 'struct device *'<br> static void i82801gx_configure_cstates(device_t dev)<br>             ^<br>src/southbridge/intel/i82801gx/lpc.c: At top level:<br>src/southbridge/intel/i82801gx/lpc.c:484:6: error: no previous prototype for 'acpi_fill_fadt' [-Werror=missing-prototypes]<br> void acpi_fill_fadt(acpi_fadt_t * fadt)<br>      ^<br>src/southbridge/intel/i82801gx/lpc.c: In function 'acpi_fill_fadt':<br>src/southbridge/intel/i82801gx/lpc.c:486:17: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]<br>  device_t dev = dev_find_slot(0, PCI_DEVFN(0x1f,0));<br>                 ^<br>src/southbridge/intel/i82801gx/lpc.c:487:22: error: invalid type argument of '->' (have 'device_t {aka unsigned int}')<br>  config_t *chip = dev->chip_info;<br>                      ^<br>src/southbridge/intel/i82801gx/lpc.c: In function 'i82801gx_lpc_read_resources':<br>src/southbridge/intel/i82801gx/lpc.c:611:2: error: implicit declaration of function 'pci_dev_read_resources' [-Werror=implicit-function-declaration]<br>  pci_dev_read_resources(dev);<br>  ^<br>src/southbridge/intel/i82801gx/lpc.c:614:21: error: passing argument 1 of 'new_resource' makes pointer from integer without a cast [-Werror=int-conversion]<br>  res = new_resource(dev, IOINDEX_SUBTRACTIVE(io_index++, 0));<br>                     ^<br>In file included from src/include/device/device.h:14:0,<br>                 from src/arch/x86/include/arch/acpi.h:54,<br>                 from src/mainboard/intel/i946gz/romstage.c:25:<br>src/include/device/resource.h:61:25: note: expected 'struct device *' but argument is of type 'device_t {aka unsigned int}'<br> extern struct resource *new_resource(struct device * dev, unsigned index);<br>                         ^<br>In file included from src/mainboard/intel/i946gz/romstage.c:44:0:<br>src/southbridge/intel/i82801gx/lpc.c:620:21: error: passing argument 1 of 'new_resource' makes pointer from integer without a cast [-Werror=int-conversion]<br>  res = new_resource(dev, IOINDEX_SUBTRACTIVE(io_index++, 0));<br>                     ^<br>In file included from src/include/device/device.h:14:0,<br>                 from src/arch/x86/include/arch/acpi.h:54,<br>                 from src/mainboard/intel/i946gz/romstage.c:25:<br>src/include/device/resource.h:61:25: note: expected 'struct device *' but argument is of type 'device_t {aka unsigned int}'<br> extern struct resource *new_resource(struct device * dev, unsigned index);<br>                         ^<br>In file included from src/mainboard/intel/i946gz/romstage.c:44:0:<br>src/southbridge/intel/i82801gx/lpc.c:626:21: error: passing argument 1 of 'new_resource' makes pointer from integer without a cast [-Werror=int-conversion]<br>  res = new_resource(dev, 3); /* IOAPIC */<br>                     ^<br>In file included from src/include/device/device.h:14:0,<br>                 from src/arch/x86/include/arch/acpi.h:54,<br>                 from src/mainboard/intel/i946gz/romstage.c:25:<br>src/include/device/resource.h:61:25: note: expected 'struct device *' but argument is of type 'device_t {aka unsigned int}'<br> extern struct resource *new_resource(struct device * dev, unsigned index);<br>                         ^<br>In file included from src/mainboard/intel/i946gz/romstage.c:44:0:<br>src/southbridge/intel/i82801gx/lpc.c:637:23: error: passing argument 1 of 'new_resource' makes pointer from integer without a cast [-Werror=int-conversion]<br>    res = new_resource(dev, IOINDEX_SUBTRACTIVE(io_index++, 0));<br>                       ^<br>In file included from src/include/device/device.h:14:0,<br>                 from src/arch/x86/include/arch/acpi.h:54,<br>                 from src/mainboard/intel/i946gz/romstage.c:25:<br>src/include/device/resource.h:61:25: note: expected 'struct device *' but argument is of type 'device_t {aka unsigned int}'<br> extern struct resource *new_resource(struct device * dev, unsigned index);<br>                         ^<br>In file included from src/mainboard/intel/i946gz/romstage.c:44:0:<br>src/southbridge/intel/i82801gx/lpc.c: At top level:<br>src/southbridge/intel/i82801gx/lpc.c:684:15: error: variable 'pci_ops' has initializer but incomplete type<br> static struct pci_operations pci_ops = {<br>               ^<br>src/southbridge/intel/i82801gx/lpc.c:685:2: error: unknown field 'set_subsystem' specified in initializer<br>  .set_subsystem = set_subsystem,<br>  ^<br>src/southbridge/intel/i82801gx/lpc.c:685:19: error: excess elements in struct initializer [-Werror]<br>  .set_subsystem = set_subsystem,<br>                   ^<br>src/southbridge/intel/i82801gx/lpc.c:685:19: note: (near initialization for 'pci_ops')<br>src/southbridge/intel/i82801gx/lpc.c:688:15: error: variable 'device_ops' has initializer but incomplete type<br> static struct device_operations device_ops = {<br>               ^<br>src/southbridge/intel/i82801gx/lpc.c:689:2: error: unknown field 'read_resources' specified in initializer<br>  .read_resources  = i82801gx_lpc_read_resources,<br>  ^<br>src/southbridge/intel/i82801gx/lpc.c:689:21: error: excess elements in struct initializer [-Werror]<br>  .read_resources  = i82801gx_lpc_read_resources,<br>                     ^<br>src/southbridge/intel/i82801gx/lpc.c:689:21: note: (near initialization for 'device_ops')<br>src/southbridge/intel/i82801gx/lpc.c:690:2: error: unknown field 'set_resources' specified in initializer<br>  .set_resources  = pci_dev_set_resources,<br>  ^<br>src/southbridge/intel/i82801gx/lpc.c:690:20: error: 'pci_dev_set_resources' undeclared here (not in a function)<br>  .set_resources  = pci_dev_set_resources,<br>                    ^<br>src/southbridge/intel/i82801gx/lpc.c:690:20: error: excess elements in struct initializer [-Werror]<br>src/southbridge/intel/i82801gx/lpc.c:690:20: note: (near initialization for 'device_ops')<br>src/southbridge/intel/i82801gx/lpc.c:691:2: error: unknown field 'enable_resources' specified in initializer<br>  .enable_resources = pci_dev_enable_resources,<br>  ^<br>src/southbridge/intel/i82801gx/lpc.c:691:22: error: 'pci_dev_enable_resources' undeclared here (not in a function)<br>  .enable_resources = pci_dev_enable_resources,<br>                      ^<br>src/southbridge/intel/i82801gx/lpc.c:691:22: error: excess elements in struct initializer [-Werror]<br>src/southbridge/intel/i82801gx/lpc.c:691:22: note: (near initialization for 'device_ops')<br>src/southbridge/intel/i82801gx/lpc.c:692:2: error: unknown field 'acpi_inject_dsdt_generator' specified in initializer<br>  .acpi_inject_dsdt_generator = southbridge_inject_dsdt,<br>  ^<br>src/southbridge/intel/i82801gx/lpc.c:692:32: error: excess elements in struct initializer [-Werror]<br>  .acpi_inject_dsdt_generator = southbridge_inject_dsdt,<br>                                ^<br>src/southbridge/intel/i82801gx/lpc.c:692:32: note: (near initialization for 'device_ops')<br>src/southbridge/intel/i82801gx/lpc.c:693:2: error: unknown field 'write_acpi_tables' specified in initializer<br>  .write_acpi_tables      = acpi_write_hpet,<br>  ^<br>src/southbridge/intel/i82801gx/lpc.c:693:28: error: 'acpi_write_hpet' undeclared here (not in a function)<br>  .write_acpi_tables      = acpi_write_hpet,<br>                            ^<br>src/southbridge/intel/i82801gx/lpc.c:693:28: error: excess elements in struct initializer [-Werror]<br>src/southbridge/intel/i82801gx/lpc.c:693:28: note: (near initialization for 'device_ops')<br>src/southbridge/intel/i82801gx/lpc.c:694:2: error: unknown field 'init' specified in initializer<br>  .init   = lpc_init,<br>  ^<br>src/southbridge/intel/i82801gx/lpc.c:694:12: error: excess elements in struct initializer [-Werror]<br>  .init   = lpc_init,<br>            ^<br>src/southbridge/intel/i82801gx/lpc.c:694:12: note: (near initialization for 'device_ops')<br>src/southbridge/intel/i82801gx/lpc.c:695:2: error: unknown field 'scan_bus' specified in initializer<br>  .scan_bus  = scan_lpc_bus,<br>  ^<br>src/southbridge/intel/i82801gx/lpc.c:695:15: error: 'scan_lpc_bus' undeclared here (not in a function)<br>  .scan_bus  = scan_lpc_bus,<br>               ^<br>src/southbridge/intel/i82801gx/lpc.c:695:15: error: excess elements in struct initializer [-Werror]<br>src/southbridge/intel/i82801gx/lpc.c:695:15: note: (near initialization for 'device_ops')<br>src/southbridge/intel/i82801gx/lpc.c:696:2: error: unknown field 'enable' specified in initializer<br>  .enable   = i82801gx_enable,<br>  ^<br>src/southbridge/intel/i82801gx/lpc.c:696:14: error: 'i82801gx_enable' undeclared here (not in a function)<br>  .enable   = i82801gx_enable,<br>              ^<br>src/southbridge/intel/i82801gx/lpc.c:696:14: error: excess elements in struct initializer [-Werror]<br>src/southbridge/intel/i82801gx/lpc.c:696:14: note: (near initialization for 'device_ops')<br>src/southbridge/intel/i82801gx/lpc.c:697:2: error: unknown field 'ops_pci' specified in initializer<br>  .ops_pci  = &pci_ops,<br>  ^<br>src/southbridge/intel/i82801gx/lpc.c:697:14: error: excess elements in struct initializer [-Werror]<br>  .ops_pci  = &pci_ops,<br>              ^<br>src/southbridge/intel/i82801gx/lpc.c:697:14: note: (near initialization for 'device_ops')<br><br></div>Is there any way fixing it ?<br><br></div>Thanks<br></div>Rick<br><div><div><div><br><div><br></div></div></div></div></div>