From c-d.hailfinger.devel.2006 at gmx.net Tue Jul 1 01:42:51 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Tue, 01 Jul 2008 01:42:51 +0200 Subject: [coreboot] [PATCH 2/3] Add support for 4 bytes rdid In-Reply-To: <20080630211926.32210.qmail@stuge.se> References: <4869465B.6090301@assembler.cz> <20080630211926.32210.qmail@stuge.se> Message-ID: <48696F7B.8000404@gmx.net> On 30.06.2008 23:19, Peter Stuge wrote: > On Mon, Jun 30, 2008 at 10:47:23PM +0200, Rudolf Marek wrote: > >> @@ -97,7 +97,8 @@ >> if (!oddparity(readarr[1])) >> printf_debug("RDID byte 1 parity violation.\n"); >> manuf_id = (readarr[0] << 8) | readarr[1]; >> - model_id = readarr[2]; >> + model_id = (bytes == 3) ? readarr[2] : >> + ((readarr[2] << 8) | readarr[3]); >> > > Please improve this a bit, I suggest: > > model_id=readarr[2]; > if(bytes>3) { /* or 4==bytes */ > model_id<<=8; > model_id|=readarr[3]; > } > > With a fix (not neccessarily mine) for the above, this is: > Technically, both variants will fail for some chips. There are at least the following RDID responses: 1 byte manuf, 2 bytes model 2 bytes manuf, 1 byte model 2 bytes manuf, 2 bytes model and all of the above with additional data appended. The existing code handles the first two cases, but not the third. The new code handles the first and third case, but not the second. > Acked-by: Peter Stuge > I know of some SPI chips which return 16 bytes for RDID. How about reading 16 bytes, cropping the result as needed? Regards, Carl-Daniel -- http://www.hailfinger.org/ From svn at coreboot.org Tue Jul 1 01:45:23 2008 From: svn at coreboot.org (svn at coreboot.org) Date: Tue, 1 Jul 2008 01:45:23 +0200 Subject: [coreboot] r3401 - trunk/util/flashrom Message-ID: Author: stepan Date: 2008-07-01 01:45:22 +0200 (Tue, 01 Jul 2008) New Revision: 3401 Modified: trunk/util/flashrom/chipset_enable.c trunk/util/flashrom/flash.h trunk/util/flashrom/ichspi.c trunk/util/flashrom/it87spi.c trunk/util/flashrom/spi.c Log: First attempt to clean up SPI probing and create a common construct: the flash bus. At some point the flash bus will be part of struct flashchip. Pardon me for pushing this in, but I think it is important to beware of further decay and it will improve things for other developers in the short run. Carl-Daniel, I will consider your suggestions in another patch. I want to keep things from getting too much for now. The patch includes Rudolf's VIA SPI changes though. Signed-off-by: Stefan Reinauer Acked-by: Carl-Daniel Hailfinger Modified: trunk/util/flashrom/chipset_enable.c =================================================================== --- trunk/util/flashrom/chipset_enable.c 2008-06-30 21:48:54 UTC (rev 3400) +++ trunk/util/flashrom/chipset_enable.c 2008-06-30 23:45:22 UTC (rev 3401) @@ -35,6 +35,17 @@ #include #include "flash.h" +/** + * flashrom defaults to LPC flash devices. If a known SPI controller is found + * and the SPI strappings are set, this will be overwritten by the probing code. + * + * Eventually, this will become an array when multiple flash support works. + */ + +flashbus_t flashbus = BUS_TYPE_LPC; +void *spibar = NULL; + + static int enable_flash_ali_m1533(struct pci_dev *dev, const char *name) { uint8_t tmp; @@ -124,7 +135,7 @@ * Note: Accesses to FFFF0000-FFFFFFFF are always forwarded to ISA. * Set bit 2: BIOSCS# Write Enable (1=enable, 0=disable). */ - new = old | 0x2c4; + new = old | 0x02c4; if (new == old) return 0; @@ -185,88 +196,131 @@ return enable_flash_ich(dev, name, 0xdc); } -void *ich_spibar = NULL; +#define ICH_STRAP_RSVD 0x00 +#define ICH_STRAP_SPI 0x01 +#define ICH_STRAP_PCI 0x02 +#define ICH_STRAP_LPC 0x03 static int enable_flash_vt8237s_spi(struct pci_dev *dev, const char *name) { uint32_t mmio_base; mmio_base = (pci_read_long(dev, 0xbc)) << 8; printf_debug("MMIO base at = 0x%x\n", mmio_base); - ich_spibar = mmap(NULL, 0x70, PROT_READ | PROT_WRITE, MAP_SHARED, + spibar = mmap(NULL, 0x70, PROT_READ | PROT_WRITE, MAP_SHARED, fd_mem, mmio_base); - if (ich_spibar == MAP_FAILED) { + if (spibar == MAP_FAILED) { perror("Can't mmap memory using " MEM_DEV); exit(1); } - printf_debug("0x6c: 0x%04x (CLOCK/DEBUG)\n", *(uint16_t *)(ich_spibar + 0x6c)); - viaspi_detected = 1; + printf_debug("0x6c: 0x%04x (CLOCK/DEBUG)\n", *(uint16_t *)(spibar + 0x6c)); + + flashbus = BUS_TYPE_VIA_SPI; + return 0; } -static int enable_flash_ich_dc_spi(struct pci_dev *dev, const char *name, unsigned long spibar) +static int enable_flash_ich_dc_spi(struct pci_dev *dev, const char *name, int ich_generation) { + int ret, i; uint8_t old, new, bbs, buc; + uint16_t spibar_offset; uint32_t tmp, gcs; void *rcrb; + static const char *straps_names[] = { "reserved", "SPI", "PCI", "LPC" }; + + /* Enable Flash Writes */ + ret = enable_flash_ich_dc(dev, name); - /* Read the Root Complex Base Address Register (RCBA) */ - tmp = pci_read_long(dev, 0xf0); + /* Get physical address of Root Complex Register Block */ + tmp = pci_read_long(dev, 0xf0) & 0xffffc000; + printf_debug("\nRoot Complex Register Block address = 0x%x\n", tmp); - /* Calculate the Root Complex Register Block address */ - tmp &= 0xffffc000; - printf_debug("\nRoot Complex Register Block address = 0x%x\n", tmp); + /* Map RCBA to virtual memory */ rcrb = mmap(0, 0x4000, PROT_READ | PROT_WRITE, MAP_SHARED, fd_mem, (off_t)tmp); if (rcrb == MAP_FAILED) { perror("Can't mmap memory using " MEM_DEV); exit(1); } - printf_debug("GCS address = 0x%x\n", tmp + 0x3410); + gcs = *(volatile uint32_t *)(rcrb + 0x3410); printf_debug("GCS = 0x%x: ", gcs); printf_debug("BIOS Interface Lock-Down: %sabled, ", (gcs & 0x1) ? "en" : "dis"); bbs = (gcs >> 10) & 0x3; - printf_debug("BOOT BIOS Straps: 0x%x (%s)\n", bbs, - (bbs == 0x3) ? "LPC" : ((bbs == 0x2) ? "PCI" : "SPI")); - if (bbs >= 2) - ich7_detected = 0; + printf_debug("BOOT BIOS Straps: 0x%x (%s)\n", bbs, straps_names[bbs]); buc = *(volatile uint8_t *)(rcrb + 0x3414); printf_debug("Top Swap : %s\n", (buc & 1)?"enabled (A16 inverted)":"not enabled"); + /* It seems the ICH7 does not support SPI and LPC chips at the same + * time. At least not with our current code. So we prevent searching + * on ICH7 when the southbridge is strapped to LPC + */ + + if (ich_generation == 7 && bbs == ICH_STRAP_LPC) { + /* No further SPI initialization required */ + return ret; + } + + switch (ich_generation) { + case 7: + flashbus = BUS_TYPE_ICH7_SPI; + spibar_offset = 0x3020; + break; + case 8: + flashbus = BUS_TYPE_ICH9_SPI; + spibar_offset = 0x3020; + break; + case 9: + default: /* Future version might behave the same */ + flashbus = BUS_TYPE_ICH9_SPI; + spibar_offset = 0x3800; + break; + } + /* SPIBAR is at RCRB+0x3020 for ICH[78] and RCRB+0x3800 for ICH9. */ - printf_debug("SPIBAR = 0x%x + 0x%04x\n", tmp, (uint16_t)spibar); + printf_debug("SPIBAR = 0x%x + 0x%04x\n", tmp, spibar_offset); - // Assign Virtual Address - ich_spibar = rcrb + spibar; + /* Assign Virtual Address */ + spibar = rcrb + spibar_offset; - if (ich7_detected) { - int i; - printf_debug("0x00: 0x%04x (SPIS)\n", *(uint16_t *)(ich_spibar + 0)); - printf_debug("0x02: 0x%04x (SPIC)\n", *(uint16_t *)(ich_spibar + 2)); - printf_debug("0x04: 0x%08x (SPIA)\n", *(uint32_t *)(ich_spibar + 4)); + switch (flashbus) { + case BUS_TYPE_ICH7_SPI: + printf_debug("0x00: 0x%04x (SPIS)\n", *(uint16_t *)(spibar + 0)); + printf_debug("0x02: 0x%04x (SPIC)\n", *(uint16_t *)(spibar + 2)); + printf_debug("0x04: 0x%08x (SPIA)\n", *(uint32_t *)(spibar + 4)); for (i=0; i < 8; i++) { int offs; offs = 8 + (i * 8); - printf_debug("0x%02x: 0x%08x (SPID%d)\n", offs, *(uint32_t *)(ich_spibar + offs), i); - printf_debug("0x%02x: 0x%08x (SPID%d+4)\n", offs+4, *(uint32_t *)(ich_spibar + offs +4), i); + printf_debug("0x%02x: 0x%08x (SPID%d)\n", offs, *(uint32_t *)(spibar + offs), i); + printf_debug("0x%02x: 0x%08x (SPID%d+4)\n", offs+4, *(uint32_t *)(spibar + offs +4), i); } - printf_debug("0x50: 0x%08x (BBAR)\n", *(uint32_t *)(ich_spibar + 0x50)); - printf_debug("0x54: 0x%04x (PREOP)\n", *(uint16_t *)(ich_spibar + 0x54)); - printf_debug("0x56: 0x%04x (OPTYPE)\n", *(uint16_t *)(ich_spibar + 0x56)); - printf_debug("0x58: 0x%08x (OPMENU)\n", *(uint32_t *)(ich_spibar + 0x58)); - printf_debug("0x5c: 0x%08x (OPMENU+4)\n", *(uint32_t *)(ich_spibar + 0x5c)); + printf_debug("0x50: 0x%08x (BBAR)\n", *(uint32_t *)(spibar + 0x50)); + printf_debug("0x54: 0x%04x (PREOP)\n", *(uint16_t *)(spibar + 0x54)); + printf_debug("0x56: 0x%04x (OPTYPE)\n", *(uint16_t *)(spibar + 0x56)); + printf_debug("0x58: 0x%08x (OPMENU)\n", *(uint32_t *)(spibar + 0x58)); + printf_debug("0x5c: 0x%08x (OPMENU+4)\n", *(uint32_t *)(spibar + 0x5c)); for (i=0; i < 4; i++) { int offs; offs = 0x60 + (i * 4); - printf_debug("0x%02x: 0x%08x (PBR%d)\n", offs, *(uint32_t *)(ich_spibar + offs), i); + printf_debug("0x%02x: 0x%08x (PBR%d)\n", offs, *(uint32_t *)(spibar + offs), i); } printf_debug("\n"); - if ( (*(uint16_t *)ich_spibar) & (1 << 15)) { + if ( (*(uint16_t *)spibar) & (1 << 15)) { printf("WARNING: SPI Configuration Lockdown activated.\n"); } + break; + case BUS_TYPE_ICH9_SPI: + /* TODO: Add dumping function for ICH8/ICH9, or drop the + * whole SPIBAR dumping from chipset_enable.c - There's + * inteltool for this task already. + */ + break; + default: + /* Nothing */ + break; } old = pci_read_byte(dev, 0xdc); @@ -277,38 +331,30 @@ case 1: case 2: printf_debug("prefetching %sabled, caching %sabled, ", - (new & 0x2) ? "en" : "dis", (new & 0x1) ? "dis" : "en"); + (new & 0x2) ? "en" : "dis", + (new & 0x1) ? "dis" : "en"); break; default: printf_debug("invalid prefetching/caching settings, "); break; } - return enable_flash_ich_dc(dev, name); + + return ret; } -/* Flag for ICH7 SPI register block */ -int ich7_detected = 0; -int viaspi_detected = 0; - static int enable_flash_ich7(struct pci_dev *dev, const char *name) { - ich7_detected = 1; - return enable_flash_ich_dc_spi(dev, name, 0x3020); + return enable_flash_ich_dc_spi(dev, name, 7); } -/* Flag for ICH8/ICH9 SPI register block */ -int ich9_detected = 0; - static int enable_flash_ich8(struct pci_dev *dev, const char *name) { - ich9_detected = 1; - return enable_flash_ich_dc_spi(dev, name, 0x3020); + return enable_flash_ich_dc_spi(dev, name, 8); } static int enable_flash_ich9(struct pci_dev *dev, const char *name) { - ich9_detected = 1; - return enable_flash_ich_dc_spi(dev, name, 0x3800); + return enable_flash_ich_dc_spi(dev, name, 9); } static int enable_flash_vt823x(struct pci_dev *dev, const char *name) Modified: trunk/util/flashrom/flash.h =================================================================== --- trunk/util/flashrom/flash.h 2008-06-30 21:48:54 UTC (rev 3400) +++ trunk/util/flashrom/flash.h 2008-06-30 23:45:22 UTC (rev 3401) @@ -370,11 +370,18 @@ /* chipset_enable.c */ int chipset_flash_enable(void); void print_supported_chipsets(void); -extern int ich7_detected; -extern int viaspi_detected; -extern int ich9_detected; -extern void *ich_spibar; +typedef enum { + BUS_TYPE_LPC, + BUS_TYPE_ICH7_SPI, + BUS_TYPE_ICH9_SPI, + BUS_TYPE_IT87XX_SPI, + BUS_TYPE_VIA_SPI +} flashbus_t; + +extern flashbus_t flashbus; +extern void *spibar; + /* Physical memory mapping device */ #if defined (__sun) && (defined(__i386) || defined(__amd64)) # define MEM_DEV "/dev/xsvc" Modified: trunk/util/flashrom/ichspi.c =================================================================== --- trunk/util/flashrom/ichspi.c 2008-06-30 21:48:54 UTC (rev 3400) +++ trunk/util/flashrom/ichspi.c 2008-06-30 23:45:22 UTC (rev 3401) @@ -131,20 +131,20 @@ static inline uint32_t REGREAD32(int X) { volatile uint32_t regval; - regval = *(volatile uint32_t *) ((uint8_t *) ich_spibar + X); + regval = *(volatile uint32_t *) ((uint8_t *) spibar + X); return regval; } static inline uint16_t REGREAD16(int X) { volatile uint16_t regval; - regval = *(volatile uint16_t *) ((uint8_t *) ich_spibar + X); + regval = *(volatile uint16_t *) ((uint8_t *) spibar + X); return regval; } -#define REGWRITE32(X,Y) (*(uint32_t *)((uint8_t *)ich_spibar+X)=Y) -#define REGWRITE16(X,Y) (*(uint16_t *)((uint8_t *)ich_spibar+X)=Y) -#define REGWRITE8(X,Y) (*(uint8_t *)((uint8_t *)ich_spibar+X)=Y) +#define REGWRITE32(X,Y) (*(uint32_t *)((uint8_t *)spibar+X)=Y) +#define REGWRITE16(X,Y) (*(uint16_t *)((uint8_t *)spibar+X)=Y) +#define REGWRITE8(X,Y) (*(uint8_t *)((uint8_t *)spibar+X)=Y) /* Common SPI functions */ static int program_opcodes(OPCODES * op); @@ -175,58 +175,51 @@ int program_opcodes(OPCODES * op) { uint8_t a; - uint16_t temp16; - uint32_t temp32; + uint16_t preop, optype; + uint32_t opmenu[2]; /* Program Prefix Opcodes */ - temp16 = 0; + preop = 0; /* 0:7 Prefix Opcode 1 */ - temp16 = (op->preop[0]); + preop = (op->preop[0]); /* 8:16 Prefix Opcode 2 */ - temp16 |= ((uint16_t) op->preop[1]) << 8; - if ((ich7_detected) || (viaspi_detected)) { - REGWRITE16(ICH7_REG_PREOP, temp16); - } else if (ich9_detected) { - REGWRITE16(ICH9_REG_PREOP, temp16); - } - + preop |= ((uint16_t) op->preop[1]) << 8; + /* Program Opcode Types 0 - 7 */ - temp16 = 0; + optype = 0; for (a = 0; a < 8; a++) { - temp16 |= ((uint16_t) op->opcode[a].spi_type) << (a * 2); + optype |= ((uint16_t) op->opcode[a].spi_type) << (a * 2); } - - if ((ich7_detected) || (viaspi_detected)) { - REGWRITE16(ICH7_REG_OPTYPE, temp16); - } else if (ich9_detected) { - REGWRITE16(ICH9_REG_OPTYPE, temp16); - } - - + /* Program Allowable Opcodes 0 - 3 */ - temp32 = 0; + opmenu[0] = 0; for (a = 0; a < 4; a++) { - temp32 |= ((uint32_t) op->opcode[a].opcode) << (a * 8); + opmenu[0] |= ((uint32_t) op->opcode[a].opcode) << (a * 8); } - if ((ich7_detected) || (viaspi_detected)) { - REGWRITE32(ICH7_REG_OPMENU, temp32); - } else if (ich9_detected) { - REGWRITE32(ICH9_REG_OPMENU, temp32); - } - - /*Program Allowable Opcodes 4 - 7 */ - temp32 = 0; + opmenu[1] = 0; for (a = 4; a < 8; a++) { - temp32 |= - ((uint32_t) op->opcode[a].opcode) << ((a - 4) * 8); + opmenu[1] |= ((uint32_t) op->opcode[a].opcode) << ((a - 4) * 8); } - if ((ich7_detected) || (viaspi_detected)) { - REGWRITE32(ICH7_REG_OPMENU + 4, temp32); - } else if (ich9_detected) { - REGWRITE32(ICH9_REG_OPMENU + 4, temp32); + switch (flashbus) { + case BUS_TYPE_ICH7_SPI: + case BUS_TYPE_VIA_SPI: + REGWRITE16(ICH7_REG_PREOP, preop); + REGWRITE16(ICH7_REG_OPTYPE, optype); + REGWRITE32(ICH7_REG_OPMENU, opmenu[0]); + REGWRITE32(ICH7_REG_OPMENU + 4, opmenu[1]); + break; + case BUS_TYPE_ICH9_SPI: + REGWRITE16(ICH9_REG_PREOP, preop); + REGWRITE16(ICH9_REG_OPTYPE, optype); + REGWRITE32(ICH9_REG_OPMENU, opmenu[0]); + REGWRITE32(ICH9_REG_OPMENU + 4, opmenu[1]); + break; + default: + printf_debug("%s: unsupported chipset\n", __FUNCTION__); + return -1; } return 0; @@ -340,6 +333,7 @@ uint8_t datalength, uint8_t * data) { int write_cmd = 0; + int timeout; uint32_t temp32; uint32_t a; @@ -410,10 +404,13 @@ REGWRITE32(ICH9_REG_SSFS, temp32); /*wait for cycle complete */ - while ((REGREAD32(ICH9_REG_SSFS) & SSFS_CDS) == 0) { - /*TODO; Do something that this can't lead into an endless loop. but some - * commands may cause this to be last more than 30 seconds */ + timeout = 1000 * 60; // 60s is a looong timeout. + while (((REGREAD32(ICH9_REG_SSFS) & SSFS_CDS) == 0) && --timeout) { + myusec_delay(1000); } + if (!timeout) { + printf_debug("timeout\n"); + } if ((REGREAD32(ICH9_REG_SSFS) & SSFS_FCERR) != 0) { printf_debug("Transaction error!\n"); @@ -438,12 +435,16 @@ static int run_opcode(uint8_t nr, OPCODE op, uint32_t offset, uint8_t datalength, uint8_t * data) { - if (ich7_detected) + switch (flashbus) { + case BUS_TYPE_VIA_SPI: + return ich7_run_opcode(nr, op, offset, datalength, data, 16); + case BUS_TYPE_ICH7_SPI: return ich7_run_opcode(nr, op, offset, datalength, data, 64); - else if (viaspi_detected) - return ich7_run_opcode(nr, op, offset, datalength, data, 16); - else if (ich9_detected) + case BUS_TYPE_ICH9_SPI: return ich9_run_opcode(nr, op, offset, datalength, data); + default: + printf_debug("%s: unsupported chipset\n", __FUNCTION__); + } /* If we ever get here, something really weird happened */ return -1; @@ -541,7 +542,7 @@ int page_size = flash->page_size; int maxdata = 64; - if (viaspi_detected) { + if (flashbus == BUS_TYPE_VIA_SPI) { maxdata = 16; } @@ -572,7 +573,7 @@ break; } - if (viaspi_detected) { + if (flashbus == BUS_TYPE_VIA_SPI) { maxdata = 16; } for (j = 0; j < erase_size / page_size; j++) { Modified: trunk/util/flashrom/it87spi.c =================================================================== --- trunk/util/flashrom/it87spi.c 2008-06-30 21:48:54 UTC (rev 3400) +++ trunk/util/flashrom/it87spi.c 2008-06-30 23:45:22 UTC (rev 3401) @@ -3,6 +3,7 @@ * * Copyright (C) 2007, 2008 Carl-Daniel Hailfinger * Copyright (C) 2008 Ronald Hoogenboom + * Copyright (C) 2008 coresystems GmbH * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -112,8 +113,13 @@ int it87xx_probe_spi_flash(const char *name) { it8716f_flashport = find_ite_spi_flash_port(ITE_SUPERIO_PORT1); + if (!it8716f_flashport) it8716f_flashport = find_ite_spi_flash_port(ITE_SUPERIO_PORT2); + + if (it8716f_flashport) + flashbus = BUS_TYPE_IT87XX_SPI; + return (!it8716f_flashport); } Modified: trunk/util/flashrom/spi.c =================================================================== --- trunk/util/flashrom/spi.c 2008-06-30 21:48:54 UTC (rev 3400) +++ trunk/util/flashrom/spi.c 2008-06-30 23:45:22 UTC (rev 3401) @@ -34,13 +34,16 @@ int spi_command(unsigned int writecnt, unsigned int readcnt, const unsigned char *writearr, unsigned char *readarr) { - if (it8716f_flashport) + switch (flashbus) { + case BUS_TYPE_IT87XX_SPI: return it8716f_spi_command(writecnt, readcnt, writearr, readarr); - else if ((ich7_detected) || (viaspi_detected)) - return ich_spi_command(writecnt, readcnt, writearr, readarr); - else if (ich9_detected) - return ich_spi_command(writecnt, readcnt, writearr, readarr); - printf_debug("%s called, but no SPI chipset detected\n", __FUNCTION__); + case BUS_TYPE_ICH7_SPI: + case BUS_TYPE_ICH9_SPI: + case BUS_TYPE_VIA_SPI: + return ich_spi_command(writecnt, readcnt, writearr, readarr); + default: + printf_debug("%s called, but no SPI chipset/strapping detected\n", __FUNCTION__); + } return 1; } @@ -135,9 +138,16 @@ int probe_spi_rdid4(struct flashchip *flash) { /* only some SPI chipsets support 4 bytes commands */ - if (!((ich7_detected) || (ich9_detected) || (viaspi_detected))) - return 0; - return probe_spi_rdid_generic(flash, 4); + switch (flashbus) { + case BUS_TYPE_ICH7_SPI: + case BUS_TYPE_ICH9_SPI: + case BUS_TYPE_VIA_SPI: + return probe_spi_rdid_generic(flash, 4); + default: + printf_debug("4b ID not supported on this SPI controller\n"); + } + + return 0; } int probe_spi_res(struct flashchip *flash) @@ -316,11 +326,17 @@ void spi_page_program(int block, uint8_t *buf, uint8_t *bios) { - if (it8716f_flashport) { + switch (flashbus) { + case BUS_TYPE_IT87XX_SPI: it8716f_spi_page_program(block, buf, bios); - return; + break; + case BUS_TYPE_ICH7_SPI: + case BUS_TYPE_ICH9_SPI: + printf_debug("%s called, but not implemented for ICH\n", __FUNCTION__); + break; + default: + printf_debug("%s called, but no SPI chipset/strapping detected\n", __FUNCTION__); } - printf_debug("%s called, but no SPI chipset detected\n", __FUNCTION__); } /* @@ -375,25 +391,34 @@ int spi_chip_read(struct flashchip *flash, uint8_t *buf) { - if (it8716f_flashport) + + switch (flashbus) { + case BUS_TYPE_IT87XX_SPI: return it8716f_spi_chip_read(flash, buf); - else if ((ich7_detected) || (viaspi_detected)) + case BUS_TYPE_ICH7_SPI: + case BUS_TYPE_ICH9_SPI: + case BUS_TYPE_VIA_SPI: return ich_spi_read(flash, buf); - else if (ich9_detected) - return ich_spi_read(flash, buf); - printf_debug("%s called, but no SPI chipset detected\n", __FUNCTION__); + default: + printf_debug("%s called, but no SPI chipset/strapping detected\n", __FUNCTION__); + } + return 1; } int spi_chip_write(struct flashchip *flash, uint8_t *buf) { - if (it8716f_flashport) + switch (flashbus) { + case BUS_TYPE_IT87XX_SPI: return it8716f_spi_chip_write(flash, buf); - else if ((ich7_detected) || (viaspi_detected)) + case BUS_TYPE_ICH7_SPI: + case BUS_TYPE_ICH9_SPI: + case BUS_TYPE_VIA_SPI: return ich_spi_write(flash, buf); - else if (ich9_detected) - return ich_spi_write(flash, buf); - printf_debug("%s called, but no SPI chipset detected\n", __FUNCTION__); + default: + printf_debug("%s called, but no SPI chipset/strapping detected\n", __FUNCTION__); + } + return 1; } From c-d.hailfinger.devel.2006 at gmx.net Tue Jul 1 01:46:23 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Tue, 01 Jul 2008 01:46:23 +0200 Subject: [coreboot] r3399 - trunk/util/flashrom In-Reply-To: <20080630214551.19340gmx1@mx090.gmx.net> References: <20080630214551.19340gmx1@mx090.gmx.net> Message-ID: <4869704F.20104@gmx.net> On 30.06.2008 23:45, svn at coreboot.org wrote: > Author: ruik > Date: 2008-06-30 23:45:17 +0200 (Mon, 30 Jun 2008) > New Revision: 3399 > > Modified: > trunk/util/flashrom/flash.h > trunk/util/flashrom/spi.c > Log: > Mine AMIC flash chip needs 4 bytes RDID. Following patch adds support for that. > > Signed-off-by: Rudolf Marek > Acked-by: Peter Stuge > Very nice work! AFAICS it will work with all problematic cases I know. Regards, Carl-Daniel -- http://www.hailfinger.org/ From stepan at coresystems.de Tue Jul 1 01:49:27 2008 From: stepan at coresystems.de (Stefan Reinauer) Date: Tue, 01 Jul 2008 01:49:27 +0200 Subject: [coreboot] [PATCH 2/3] Add support for 4 bytes rdid In-Reply-To: <48696F7B.8000404@gmx.net> References: <4869465B.6090301@assembler.cz> <20080630211926.32210.qmail@stuge.se> <48696F7B.8000404@gmx.net> Message-ID: <48697107.8010900@coresystems.de> Carl-Daniel Hailfinger wrote: > On 30.06.2008 23:19, Peter Stuge wrote: > >> On Mon, Jun 30, 2008 at 10:47:23PM +0200, Rudolf Marek wrote: >> >> >>> @@ -97,7 +97,8 @@ >>> if (!oddparity(readarr[1])) >>> printf_debug("RDID byte 1 parity violation.\n"); >>> manuf_id = (readarr[0] << 8) | readarr[1]; >>> - model_id = readarr[2]; >>> + model_id = (bytes == 3) ? readarr[2] : >>> + ((readarr[2] << 8) | readarr[3]); >>> >>> >> Please improve this a bit, I suggest: >> >> model_id=readarr[2]; >> if(bytes>3) { /* or 4==bytes */ >> model_id<<=8; >> model_id|=readarr[3]; >> } >> >> With a fix (not neccessarily mine) for the above, this is: >> >> > > Technically, both variants will fail for some chips. There are at least > the following RDID responses: > 1 byte manuf, 2 bytes model > 2 bytes manuf, 1 byte model > 2 bytes manuf, 2 bytes model > and all of the above with additional data appended. > > The existing code handles the first two cases, but not the third. The > new code handles the first and third case, but not the second. > What chips are there that send the second case? > I know of some SPI chips which return 16 bytes for RDID. How about > reading 16 bytes, cropping the result as needed? > Yes the numonyx do that, but what you read is a customer specific serial number, not part of the identification process. Reading that might allow for some nice use cases though. (Does it?) Stefan -- coresystems GmbH ? Brahmsstr. 16 ? D-79104 Freiburg i. Br. Tel.: +49 761 7668825 ? Fax: +49 761 7664613 Email: info at coresystems.de ? http://www.coresystems.de/ Registergericht: Amtsgericht Freiburg ? HRB 7656 Gesch?ftsf?hrer: Stefan Reinauer ? Ust-IdNr.: DE245674866 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 249 bytes Desc: OpenPGP digital signature URL: From kevin at koconnor.net Tue Jul 1 01:53:54 2008 From: kevin at koconnor.net (Kevin O'Connor) Date: Mon, 30 Jun 2008 19:53:54 -0400 Subject: [coreboot] help with win-xp and legacybios/coreboot In-Reply-To: <48679925.808@gmx.net> References: <20080628174539.GB11061@morn.localdomain> <48679925.808@gmx.net> Message-ID: <20080630235354.GA17797@morn.localdomain> Hi, On Sun, Jun 29, 2008 at 04:16:05PM +0200, Carl-Daniel Hailfinger wrote: > On 28.06.2008 19:45, Kevin O'Connor wrote: > > Unfortunately, when I try to install or boot > > win-xp with coreboot-v2 and legacybios on my via epia-m the system > > hangs. > > > > Hm. Off the top of my head, I see a few things you could try in order of > increasing difficulty: [...] Wow - great list. I did try a number of these things, but you have some useful additions. I'll continue to play with it. However, if someone can try on a known working board that would also help a lot. Thanks for the help. -Kevin From c-d.hailfinger.devel.2006 at gmx.net Tue Jul 1 01:55:24 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Tue, 01 Jul 2008 01:55:24 +0200 Subject: [coreboot] [PATCH 2/3] Add support for 4 bytes rdid In-Reply-To: <48697107.8010900@coresystems.de> References: <4869465B.6090301@assembler.cz> <20080630211926.32210.qmail@stuge.se> <48696F7B.8000404@gmx.net> <48697107.8010900@coresystems.de> Message-ID: <4869726C.4020800@gmx.net> On 01.07.2008 01:49, Stefan Reinauer wrote: > Carl-Daniel Hailfinger wrote: >> On 30.06.2008 23:19, Peter Stuge wrote: >> >>> On Mon, Jun 30, 2008 at 10:47:23PM +0200, Rudolf Marek wrote: >>> >>>> @@ -97,7 +97,8 @@ >>>> if (!oddparity(readarr[1])) >>>> printf_debug("RDID byte 1 parity violation.\n"); >>>> manuf_id = (readarr[0] << 8) | readarr[1]; >>>> - model_id = readarr[2]; >>>> + model_id = (bytes == 3) ? readarr[2] : >>>> + ((readarr[2] << 8) | readarr[3]); >>>> >>> Please improve this a bit, I suggest: >>> >>> model_id=readarr[2]; >>> if(bytes>3) { /* or 4==bytes */ >>> model_id<<=8; >>> model_id|=readarr[3]; >>> } >>> >>> With a fix (not neccessarily mine) for the above, this is: >>> >> >> Technically, both variants will fail for some chips. There are at least >> the following RDID responses: >> 1 byte manuf, 2 bytes model >> 2 bytes manuf, 1 byte model >> 2 bytes manuf, 2 bytes model >> and all of the above with additional data appended. >> >> The existing code handles the first two cases, but not the third. The >> new code handles the first and third case, but not the second. >> > What chips are there that send the second case? #define PMC_25LV512 0x7B #define PMC_25LV010 0x7C #define PMC_25LV020 0x7D #define PMC_25LV040 0x7E #define PMC_25LV080B 0x13 #define PMC_25LV016B 0x14 >> I know of some SPI chips which return 16 bytes for RDID. How about >> reading 16 bytes, cropping the result as needed? >> > Yes the numonyx do that, but what you read is a customer specific > serial number, not part of the identification process. Well, I have seen other chips which return a flash descriptor with eraseblock info etc. No idea which vendor that was, though. > Reading that might allow for some nice use cases though. (Does it?) The flash descriptor would certainly be useful. Serial number would be interesting, but only for inventory. Regards, Carl-Daniel -- http://www.hailfinger.org/ From c-d.hailfinger.devel.2006 at gmx.net Tue Jul 1 01:58:02 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Tue, 01 Jul 2008 01:58:02 +0200 Subject: [coreboot] r3401 - trunk/util/flashrom In-Reply-To: <20080630234556.18430gmx1@mx027.gmx.net> References: <20080630234556.18430gmx1@mx027.gmx.net> Message-ID: <4869730A.3020207@gmx.net> On 01.07.2008 01:45, svn at coreboot.org wrote: > Author: stepan > Date: 2008-07-01 01:45:22 +0200 (Tue, 01 Jul 2008) > New Revision: 3401 > > Modified: > trunk/util/flashrom/chipset_enable.c > trunk/util/flashrom/flash.h > trunk/util/flashrom/ichspi.c > trunk/util/flashrom/it87spi.c > trunk/util/flashrom/spi.c > Log: > First attempt to clean up SPI probing and create a common > construct: the flash bus. > > At some point the flash bus will be part of struct flashchip. > > Pardon me for pushing this in, but I think it is important to beware of further > decay and it will improve things for other developers in the short run. > > Carl-Daniel, I will consider your suggestions in another patch. I want to keep > things from getting too much for now. The patch includes Rudolf's VIA SPI > changes though. > OK with me. I assume you have tested the code. > Signed-off-by: Stefan Reinauer > Acked-by: Carl-Daniel Hailfinger > Regards, Carl-Daniel -- http://www.hailfinger.org/ From minxinjianxin at gmail.com Tue Jul 1 02:00:15 2008 From: minxinjianxin at gmail.com (Star Liu) Date: Tue, 1 Jul 2008 08:00:15 +0800 Subject: [coreboot] Intel rumers spreading?? In-Reply-To: <8b1deb52d791346e11f17fd59d303b65@imap.1and1.com> References: <8b1deb52d791346e11f17fd59d303b65@imap.1and1.com> Message-ID: <407c36770806301700v568041dfgec935504fc7f4a41@mail.gmail.com> Is the rumor me? If it's me, I'd like the tell what the inside is. I'm a newbie in free software development, and I'd like to start my free software development from the coreboot project. In China, so many people(more than a half) use intel cpus, and most of them are above P4, including me. So when i found coreboot only support intel cpu up to PIII, I'm very curious, and willing to make it support intel cpus above P4. That's why I asked so many questions about intel cpu. I don't think lack of support to something of coreboot will discourage people involve in, for me, I just want to make practice, I don't mind how perfect it is now, I really hope coreboot supported nothing, then I could develop it from zero. :) On Mon, Jun 30, 2008 at 10:18 PM, Joseph Smith wrote: > > Maybe it is just me, but it seems like lately there have been a lot of > posts to the mailing list about, coreboot not supporting ANY Intel > chipsets/cpu's. Is there rumors spreading around the mill??? If so we need > to nip this in the bud, this is probably discouraging people that want to > get involved with coreboot. > > -- > Thanks, > Joseph Smith > Set-Top-Linux > www.settoplinux.org > > > -- > coreboot mailing list > coreboot at coreboot.org > http://www.coreboot.org/mailman/listinfo/coreboot > -- --------------------------------------------------------------------------------------------------------------------------------------------- Homepage: http://starliu.9966.org, about Buddha, x86_64 CPU, Debian GNU/Linux Lenny AMD64, UEFI/BIOS --------------------------------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From peter at stuge.se Tue Jul 1 02:11:50 2008 From: peter at stuge.se (Peter Stuge) Date: Tue, 1 Jul 2008 02:11:50 +0200 Subject: [coreboot] r3401 - trunk/util/flashrom Message-ID: <20080701001150.24494.qmail@stuge.se> On Tue, Jul 01, 2008 at 01:45:23AM +0200, svn at coreboot.org wrote: > New Revision: 3401 .. > Pardon me for pushing this in Mostly good cleanups (thanks for removing temp16 et al) but it87xx_probe_spi_flash() got a lot worse IMO. Patch attached. The name is also rather unfortunate, since it is used for board enable rather than chip probing, but that is for later. //Peter -------------- next part -------------- A non-text attachment was scrubbed... Name: fr.it87spi.clean.patch Type: text/x-diff Size: 769 bytes Desc: not available URL: From minxinjianxin at gmail.com Tue Jul 1 02:18:19 2008 From: minxinjianxin at gmail.com (Star Liu) Date: Tue, 1 Jul 2008 08:18:19 +0800 Subject: [coreboot] Intel rumers spreading?? In-Reply-To: <20080630211440.GA17813@cosmic.amd.com> References: <8b1deb52d791346e11f17fd59d303b65@imap.1and1.com> <20080630162837.GA18899@localdomain> <229b33b6ec310ff246964830c2a3b14b@imap.1and1.com> <20080630211440.GA17813@cosmic.amd.com> Message-ID: <407c36770806301718p61e52f91k8c7d68603c5ed71b@mail.gmail.com> I agree with you very much. On Tue, Jul 1, 2008 at 5:14 AM, Jordan Crouse wrote: > On 30/06/08 13:18 -0400, Joseph Smith wrote: > > > > > > > > On Mon, 30 Jun 2008 18:28:37 +0200, Ward Vandewege wrote: > > > On Mon, Jun 30, 2008 at 10:18:47AM -0400, Joseph Smith wrote: > > >> > > >> Maybe it is just me, but it seems like lately there have been a lot of > > >> posts to the mailing list about, coreboot not supporting ANY Intel > > >> chipsets/cpu's. Is there rumors spreading around the mill??? If so we > > > need > > >> to nip this in the bud, this is probably discouraging people that want > > > to > > >> get involved with coreboot. > > > > > > Well - look at it from the other perspective. Intel's being difficult. > > The > > > more obvious that becomes, the more they will be encouraged to change > > > their > > > ways and become more friendly and open. > > > > > I don't think spreading the word that coreboot does not support anything > > Intel is a positive way to accomplish anything. It just frustrates and > > discourages people willing to get involved. We have to face the facts > here, > > Intel may never get involved with coreboot, so the next best thing is to > > get as many developers involved willing to take the time to fill in the > > missing pieces of code. Thinking ouside of the box. This is what I did > for > > the i830, It might have taken me a little longer, but in the long run I > did > > it without any help from Intel (except for one public datasheet). > > Honesty is the best (and only) practice here. Firmware development > is hard - exceedingly hard, and thats with copious amounts of > documentation. Without documentation, it becomes nearly impossible. > Somebody look at the Barcelona memory initialization code and tell > me they could have figured it out on their own. I'm thinking not. > > So we have to be blatantly obvious about what our shortcomings are. > You can believe all you want in the power of open source, but the > truth of the matter is that 90% of all the people who come on this list > to ask for a particular port are not interested in doing the work > themselves, and the precious few that are willing to do the work need to > be told right up front what they are facing. They need to know what > NDAs they need to secure, what code distribution rights they need to > ask for, and just how difficult this work really is, especially in the > cpu/* and northbridge/* directories. > > Thats not to say that people shouldn't be encouraged to ask the right > questions - if enough people ask a vendor for datasheets, it might > have a positive effect. But acting as though we are not developing > from behind the eight ball is going to give everybody the wrong impression, > and it will result in even more upset feelings then if we just told them > right off the bat that they are asking for something that probably isn't > going to happen. > > And just in case this sounds like I'm bashing the competition, know that > my own company is in the same boat. We have yet to release the datasheet > for the SB600, and until we do, I'm going to be the first to tell the > honest truth if somebody asks for it. > > Jordan > > > -- > coreboot mailing list > coreboot at coreboot.org > http://www.coreboot.org/mailman/listinfo/coreboot > -- --------------------------------------------------------------------------------------------------------------------------------------------- Homepage: http://starliu.9966.org, about Buddha, x86_64 CPU, Debian GNU/Linux Lenny AMD64, UEFI/BIOS --------------------------------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From kevin at koconnor.net Tue Jul 1 02:20:24 2008 From: kevin at koconnor.net (Kevin O'Connor) Date: Mon, 30 Jun 2008 20:20:24 -0400 Subject: [coreboot] legacybios names In-Reply-To: <009101c8c24b$0f8d66c0$0023040a@chimp> References: <009101c8c24b$0f8d66c0$0023040a@chimp> Message-ID: <20080701002024.GB17855@morn.localdomain> Hi, On Fri, May 30, 2008 at 05:48:20AM -0600, Myles Watson wrote: > Kevin, > > Here are some other suggestions: > > gccBIOS > > C-BIOS > > pcBIOS > > BochsBIOS Thanks for the suggestions Myles. Quynh also suggested See-BIOS some time back. I think I'm going to use "SeaBIOS". -Kevin From peter at stuge.se Tue Jul 1 02:46:48 2008 From: peter at stuge.se (Peter Stuge) Date: Tue, 1 Jul 2008 02:46:48 +0200 Subject: [coreboot] Intel rumers spreading?? In-Reply-To: <407c36770806301700v568041dfgec935504fc7f4a41@mail.gmail.com> References: <8b1deb52d791346e11f17fd59d303b65@imap.1and1.com> <407c36770806301700v568041dfgec935504fc7f4a41@mail.gmail.com> Message-ID: <20080701004648.19358.qmail@stuge.se> Hello, On Tue, Jul 01, 2008 at 08:00:15AM +0800, Star Liu wrote: > Is the rumor me? No. But because there have been many inquiries about support for recent Intel hardware in a short time, maybe your message was interpreted as indication of a starting trend. > If it's me, I'd like the tell what the inside is. > I'm a newbie in free software development, and I'd like to start my > free software development from the coreboot project. Great! You are very welcome. I hope you will like it as much as we do. :) It is a lot of fun! > In China, so many people(more than a half) use intel cpus, and most > of them are above P4, including me. I don't know the statistics for Sweden where I am, but Intel systems are popular here too. > So when i found coreboot only support intel cpu up to PIII, I'm > very curious, and willing to make it support intel cpus above P4. > That's why I asked so many questions about intel cpu. I believe curiosity and desire to improve is the true spirit of open source! But as Jordan wrote, it is far from trivial to add support for new CPUs and chipsets, even when the documentation is available. You asked how come Linux works on Intel CPUs without documentation and the answer is that Linux doesn't need it. At least not the same documentation. Linux relies heavily on the boot firmware (BIOS or coreboot or something else) to do many tasks in order to make the system run in a stable way, and because the firmware must take care of this setup, Linux does not need the documentation. The major tasks are: * Start and tune the RAM controller * Start and tune all buses in the system These two high-level tasks may seem simple, but they quickly branch into many things that must be taken into consideration in the code. > I don't think lack of support to something of coreboot will > discourage people involve in, for me, I just want to make practice, Please do not feel discouraged. We only want to share our experience from previous work, because it is difficult to estimate the effort that is required for extending coreboot. In general, it has not been easy to get information from Intel for their recent CPUs and chipsets. As others have confirmed, it is certainly not impossible to get good info from Intel if the circumstances are right, but I think the project and it's individual contributors are still far away from that situation. AMD on the other hand are being very helpful, and as a result there is much better support for their products in coreboot. Also, more time is spent working on improvements related to AMD CPUs and chipsets. Best regards //Peter From c-d.hailfinger.devel.2006 at gmx.net Tue Jul 1 02:59:25 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Tue, 01 Jul 2008 02:59:25 +0200 Subject: [coreboot] help with win-xp and legacybios/coreboot In-Reply-To: <20080630235354.GA17797@morn.localdomain> References: <20080628174539.GB11061@morn.localdomain> <48679925.808@gmx.net> <20080630235354.GA17797@morn.localdomain> Message-ID: <4869816D.9030104@gmx.net> On 01.07.2008 01:53, Kevin O'Connor wrote: > Hi, > > On Sun, Jun 29, 2008 at 04:16:05PM +0200, Carl-Daniel Hailfinger wrote: > >> On 28.06.2008 19:45, Kevin O'Connor wrote: >> >>> Unfortunately, when I try to install or boot >>> win-xp with coreboot-v2 and legacybios on my via epia-m the system >>> hangs. >>> >>> >> Hm. Off the top of my head, I see a few things you could try in order of >> increasing difficulty: >> > [...] > > Wow - great list. I did try a number of these things, but you have > some useful additions. > Glad to help. > I'll continue to play with it. However, if someone can try on a known > working board that would also help a lot. > Wait a second. I thought installing XP with factory BIOS on your machine does work. I'd try installing XP, but my only machine with enough space for XP hangs during installation because of a broken BIOS. > Thanks for the help. > You're welcome. Regards, Carl-Daniel -- http://www.hailfinger.org/ From minxinjianxin at gmail.com Tue Jul 1 03:07:23 2008 From: minxinjianxin at gmail.com (Star Liu) Date: Tue, 1 Jul 2008 09:07:23 +0800 Subject: [coreboot] Intel rumers spreading?? In-Reply-To: <20080701004648.19358.qmail@stuge.se> References: <8b1deb52d791346e11f17fd59d303b65@imap.1and1.com> <407c36770806301700v568041dfgec935504fc7f4a41@mail.gmail.com> <20080701004648.19358.qmail@stuge.se> Message-ID: <407c36770806301807s686c0158jed8aa25994a1225d@mail.gmail.com> Thank you very much! I got very clear concepts on coreboot, old bios and linux from you, it's very helpful. I think coreboot is doing the right thing, providing more and better support for AMD shall be a pressure on intel and other cpu and chipset vendors, I think. I'm reading the source code of flashrom now, hope i can figure out it. :) On Tue, Jul 1, 2008 at 8:46 AM, Peter Stuge wrote: > Hello, > > On Tue, Jul 01, 2008 at 08:00:15AM +0800, Star Liu wrote: > > Is the rumor me? > > No. But because there have been many inquiries about support for > recent Intel hardware in a short time, maybe your message was > interpreted as indication of a starting trend. > > > > If it's me, I'd like the tell what the inside is. > > I'm a newbie in free software development, and I'd like to start my > > free software development from the coreboot project. > > Great! You are very welcome. I hope you will like it as much as we > do. :) It is a lot of fun! > > > > In China, so many people(more than a half) use intel cpus, and most > > of them are above P4, including me. > > I don't know the statistics for Sweden where I am, but Intel systems > are popular here too. > > > > So when i found coreboot only support intel cpu up to PIII, I'm > > very curious, and willing to make it support intel cpus above P4. > > That's why I asked so many questions about intel cpu. > > I believe curiosity and desire to improve is the true spirit of open > source! But as Jordan wrote, it is far from trivial to add support > for new CPUs and chipsets, even when the documentation is available. > > You asked how come Linux works on Intel CPUs without documentation > and the answer is that Linux doesn't need it. At least not the same > documentation. Linux relies heavily on the boot firmware (BIOS or > coreboot or something else) to do many tasks in order to make the > system run in a stable way, and because the firmware must take care > of this setup, Linux does not need the documentation. > > The major tasks are: > > * Start and tune the RAM controller > * Start and tune all buses in the system > > These two high-level tasks may seem simple, but they quickly branch > into many things that must be taken into consideration in the code. > > > > I don't think lack of support to something of coreboot will > > discourage people involve in, for me, I just want to make practice, > > Please do not feel discouraged. We only want to share our experience > from previous work, because it is difficult to estimate the effort > that is required for extending coreboot. In general, it has not been > easy to get information from Intel for their recent CPUs and > chipsets. As others have confirmed, it is certainly not impossible to > get good info from Intel if the circumstances are right, but I think > the project and it's individual contributors are still far away from > that situation. > > AMD on the other hand are being very helpful, and as a result there > is much better support for their products in coreboot. Also, more > time is spent working on improvements related to AMD CPUs and > chipsets. > > > Best regards > > //Peter > > -- > coreboot mailing list > coreboot at coreboot.org > http://www.coreboot.org/mailman/listinfo/coreboot > -- --------------------------------------------------------------------------------------------------------------------------------------------- Homepage: http://starliu.9966.org, about Buddha, x86_64 CPU, Debian GNU/Linux Lenny AMD64, UEFI/BIOS --------------------------------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From kevin at koconnor.net Tue Jul 1 03:18:56 2008 From: kevin at koconnor.net (Kevin O'Connor) Date: Mon, 30 Jun 2008 21:18:56 -0400 Subject: [coreboot] help with win-xp and legacybios/coreboot In-Reply-To: <4869816D.9030104@gmx.net> References: <20080628174539.GB11061@morn.localdomain> <48679925.808@gmx.net> <20080630235354.GA17797@morn.localdomain> <4869816D.9030104@gmx.net> Message-ID: <20080701011856.GA18652@morn.localdomain> On Tue, Jul 01, 2008 at 02:59:25AM +0200, Carl-Daniel Hailfinger wrote: > On 01.07.2008 01:53, Kevin O'Connor wrote: > > I'll continue to play with it. However, if someone can try on a known > > working board that would also help a lot. > > > > Wait a second. I thought installing XP with factory BIOS on your machine > does work. Yes, booting xp on my epia-m works fine with the original bios. My epia-m can be a bit flaky with irqs when booting with coreboot. So, if someone can try legacybios+coreboot on a machine where coreboot is known to work well it would be a great help. -Kevin From joe at settoplinux.org Tue Jul 1 03:51:33 2008 From: joe at settoplinux.org (Joseph Smith) Date: Mon, 30 Jun 2008 21:51:33 -0400 Subject: [coreboot] =?utf-8?q?Intel_rumers_spreading=3F=3F?= In-Reply-To: <20080630211440.GA17813@cosmic.amd.com> References: <8b1deb52d791346e11f17fd59d303b65@imap.1and1.com> <20080630162837.GA18899@localdomain> <229b33b6ec310ff246964830c2a3b14b@imap.1and1.com> <20080630211440.GA17813@cosmic.amd.com> Message-ID: On Mon, 30 Jun 2008 15:14:40 -0600, Jordan Crouse wrote: > On 30/06/08 13:18 -0400, Joseph Smith wrote: >> >> >> >> On Mon, 30 Jun 2008 18:28:37 +0200, Ward Vandewege wrote: >> > On Mon, Jun 30, 2008 at 10:18:47AM -0400, Joseph Smith wrote: >> >> >> >> Maybe it is just me, but it seems like lately there have been a lot > of >> >> posts to the mailing list about, coreboot not supporting ANY Intel >> >> chipsets/cpu's. Is there rumors spreading around the mill??? If so we >> > need >> >> to nip this in the bud, this is probably discouraging people that > want >> > to >> >> get involved with coreboot. >> > >> > Well - look at it from the other perspective. Intel's being difficult. >> The >> > more obvious that becomes, the more they will be encouraged to change >> > their >> > ways and become more friendly and open. >> > >> I don't think spreading the word that coreboot does not support anything >> Intel is a positive way to accomplish anything. It just frustrates and >> discourages people willing to get involved. We have to face the facts > here, >> Intel may never get involved with coreboot, so the next best thing is to >> get as many developers involved willing to take the time to fill in the >> missing pieces of code. Thinking ouside of the box. This is what I did > for >> the i830, It might have taken me a little longer, but in the long run I > did >> it without any help from Intel (except for one public datasheet). > > Honesty is the best (and only) practice here. Firmware development > is hard - exceedingly hard, and thats with copious amounts of > documentation. Don't get me wrong I agree that it is hard no matter what documenation is available. > Without documentation, it becomes nearly impossible. > Somebody look at the Barcelona memory initialization code and tell > me they could have figured it out on their own. I'm thinking not. > > So we have to be blatantly obvious about what our shortcomings are. > You can believe all you want in the power of open source, but the > truth of the matter is that 90% of all the people who come on this list > to ask for a particular port are not interested in doing the work > themselves, And that maybe part of the problem with Intel hardware, everyone wants it but noone wants to work for it. I am far too familure with this, trust me. >and the precious few that are willing to do the work need to > be told right up front what they are facing. I was, and took it as a challenge, just like I am going to do with the USB debugging device. > They need to know what > NDAs they need to secure, what code distribution rights they need to > ask for, and just how difficult this work really is, especially in the > cpu/* and northbridge/* directories. > > Thats not to say that people shouldn't be encouraged to ask the right > questions - if enough people ask a vendor for datasheets, it might > have a positive effect. Agreed. > But acting as though we are not developing > from behind the eight ball is going to give everybody the wrong > impression, I hope I never implied that, I just want to give positive encouragement. > and it will result in even more upset feelings then if we just told them > right off the bat that they are asking for something that probably isn't > going to happen. > Agreed. But when someone asks If we support Intel hardware, telling them "no we don't go away" so to speak, do you expect a positive reaction? No, If someone said that to me I wouldn't even bother and just look for another bios solution and maybe even have a few comments about the group that didn't even bother, or offer help. > > And just in case this sounds like I'm bashing the competition, know that > my own company is in the same boat. We have yet to release the datasheet > for the SB600, and until we do, I'm going to be the first to tell the > honest truth if somebody asks for it. > Jordan, I have been involved with coreboot for about a year and a half now, and no matter how Intel feels about coreboot, which I keep hearing over and over, it is time to move in a new direction, and try something else. It is kind of like this: We call the pizza guy to deliver our pizza but he never shows up. What do we do? Keep calling the pizza guy to deliver our pizza over and over agian hoping someday he will show up? In the mean time we are getting hungrier and hungrier. Or, do we get up and go get pizza somwhere else? In the end, the second option was more work, but we stiil got pizza and fed our gut. I hope you get my point. -- Thanks, Joseph Smith Set-Top-Linux www.settoplinux.org From joe at settoplinux.org Tue Jul 1 03:59:31 2008 From: joe at settoplinux.org (Joseph Smith) Date: Mon, 30 Jun 2008 21:59:31 -0400 Subject: [coreboot] =?utf-8?q?Intel_rumers_spreading=3F=3F?= In-Reply-To: <407c36770806301700v568041dfgec935504fc7f4a41@mail.gmail.com> References: <8b1deb52d791346e11f17fd59d303b65@imap.1and1.com> <407c36770806301700v568041dfgec935504fc7f4a41@mail.gmail.com> Message-ID: <4084e5c3897960eb3fd910c9e31a9566@imap.1and1.com> On Tue, 1 Jul 2008 08:00:15 +0800, "Star Liu" wrote: > Is the rumor me? No, not you inparticular, it just seems we are getting alot of requests for Intel hardware. > If it's me, I'd like the tell what the inside is. > I'm a newbie in free software development, and I'd like to start my free > software development from the coreboot project. In China, so many > people(more than a half) use intel cpus, and most of them are above P4, > including me. So when i found coreboot only support intel cpu up to PIII, > I'm very curious, and willing to make it support intel cpus above P4. > That would be great! Sometime in the future I would love to port the i845 (probibly the most popular P4 chipset) so P4 support would be key! Any questions, we are all here to support you :-) By the way all of your emails keep getting flagged as spam for some reason?? Just so you know. -- Thanks, Joseph Smith Set-Top-Linux www.settoplinux.org From c-d.hailfinger.devel.2006 at gmx.net Tue Jul 1 04:16:55 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Tue, 01 Jul 2008 04:16:55 +0200 Subject: [coreboot] Intel rumers spreading?? In-Reply-To: References: <8b1deb52d791346e11f17fd59d303b65@imap.1and1.com> <20080630162837.GA18899@localdomain> <229b33b6ec310ff246964830c2a3b14b@imap.1and1.com> <20080630211440.GA17813@cosmic.amd.com> Message-ID: <48699397.7080306@gmx.net> On 01.07.2008 03:51, Joseph Smith wrote: > On Mon, 30 Jun 2008 15:14:40 -0600, Jordan Crouse wrote: > >> and it will result in even more upset feelings then if we just told them >> right off the bat that they are asking for something that probably isn't >> going to happen. >> > Agreed. But when someone asks If we support Intel hardware, telling them > "no we don't go away" so to speak, do you expect a positive reaction? No, > If someone said that to me I wouldn't even bother and just look for another > bios solution and maybe even have a few comments about the group that > didn't even bother, or offer help. > How about the following statement: "We are supporting quite a few Intel CPUs and chipsets, but datasheets for newer Intel chipsets are very difficult to get. If you have a good business case, you can always try to convince Intel to release the datasheets for the chipset you are using. The coreboot team would be delighted to see that happen. Once we have the docs, we can help you port coreboot to these chipsets." Regards, Carl-Daniel -- http://www.hailfinger.org/ From joe at settoplinux.org Tue Jul 1 04:35:00 2008 From: joe at settoplinux.org (Joseph Smith) Date: Mon, 30 Jun 2008 22:35:00 -0400 Subject: [coreboot] =?utf-8?q?Intel_rumers_spreading=3F=3F?= In-Reply-To: <48699397.7080306@gmx.net> References: <8b1deb52d791346e11f17fd59d303b65@imap.1and1.com> <20080630162837.GA18899@localdomain> <229b33b6ec310ff246964830c2a3b14b@imap.1and1.com> <20080630211440.GA17813@cosmic.amd.com> <48699397.7080306@gmx.net> Message-ID: <3f0c049c55b651d0d7d49b9491e7a255@imap.1and1.com> On Tue, 01 Jul 2008 04:16:55 +0200, Carl-Daniel Hailfinger wrote: > On 01.07.2008 03:51, Joseph Smith wrote: >> On Mon, 30 Jun 2008 15:14:40 -0600, Jordan Crouse wrote: >> >>> and it will result in even more upset feelings then if we just told > them >>> right off the bat that they are asking for something that probably > isn't >>> going to happen. >>> >> Agreed. But when someone asks If we support Intel hardware, telling them >> "no we don't go away" so to speak, do you expect a positive reaction? > No, >> If someone said that to me I wouldn't even bother and just look for > another >> bios solution and maybe even have a few comments about the group that >> didn't even bother, or offer help. >> > > How about the following statement: > "We are supporting quite a few Intel CPUs and chipsets, but datasheets > for newer Intel chipsets are very difficult to get. If you have a good > business case, you can always try to convince Intel to release the > datasheets for the chipset you are using. The coreboot team would be > delighted to see that happen. Once we have the docs, we can help you > port coreboot to these chipsets." > > I like it, you hit the nail right on the head Carl-Daniel :-) -- Thanks, Joseph Smith Set-Top-Linux www.settoplinux.org From peter at stuge.se Tue Jul 1 05:44:54 2008 From: peter at stuge.se (Peter Stuge) Date: Tue, 1 Jul 2008 05:44:54 +0200 Subject: [coreboot] The coreboot hare Message-ID: <20080701034454.24914.qmail@stuge.se> You have probably noticed the new logo on the web. It could also be seen on posters and flyers at LinuxTag about a month ago. Back when we decided to change the project's name, we also wanted to change to a new logo. Manhole Tux is cool and symbolic, but just like the old name he is not a great fit for the project since coreboot has much more general and generic potential than was anticipated. A few of us started thinking hard about the logo. We came up with some important requirements: * No obvious connection to other products, because coreboot is quite generic. In particular no connection to any operating system. * Something a little bit fun that complements the name * A clean and simple design that is widely applicable: + Web + Bootsplash + Posters and flyers + Case engravings and stickers * Ideally conveying advantageous properties of coreboot We tried to brainstorm over the course of two years or so, throughout the name change discussion, and continuing on after the change. There was some discussion and logo ideas on the mailing list. When we could not find an idea that we really liked, we finally gave up. After securing sponsorship to cover the cost, I sought help from an old friend who is a terrific artist and runs a design house called Breakfast Design near me. He was able to come up with a great idea very quickly and the design was reviewed and finalized just days before LinuxTag. I managed to get a good deal. My friend Jens does not normally engage in such small projects and customers (his usual clientele includes IKEA, book publishers and international record labels) but because he thinks our project is cool, and because we were able to finish the design quickly with only very few changes neccessary after each review, he agreed to do it! After some research on uniqueness, the hare was proposed. Early comments included "playful", "slick", "distinct", "a sense of speed" and "professional." Ever since I got used to the new shape (it took me about a week) I have grown quite fond of the hare. I've created http://coreboot.org/Logo where the logo is available in SVG and PNG format. The logo kit also includes a 4-colour PDF. The license could be debated. CC by-nd and by-sa were discussed, but by-sa would let anyone do anything to it, which I don't think is a good idea. I would prefer that we created any neccessary variations ourselves, and made them available for reuse. CC in general may not be such a good fit for a logo. The current license is modeled after the OpenOffice.org logo license. Special thanks to the sponsors who made it happen: Konsult Stuge coresystems GmbH Kitchener Waterloo Linux User Group and Richard Weait Best regards //Peter From joe at settoplinux.org Tue Jul 1 06:02:34 2008 From: joe at settoplinux.org (Joseph Smith) Date: Tue, 1 Jul 2008 00:02:34 -0400 Subject: [coreboot] The coreboot hare In-Reply-To: <20080701034454.24914.qmail@stuge.se> References: <20080701034454.24914.qmail@stuge.se> Message-ID: <19608AFC7310430CAE5A3142A79D3551@smitty2m> > * A clean and simple design that is widely applicable: > + Web Ok if I put a linking logo on my site? > + Bootsplash Very cool, would be even cooler to see this as a background for Bayou or possibly other payloads :-) > + Posters and flyers Cool :-) > + Case engravings and stickers Even cool for case badges ;-) Great work, I really like the design! Thanks, Joseph Smith Set-Top-Linux www.settoplinux.org From peter at stuge.se Tue Jul 1 06:14:28 2008 From: peter at stuge.se (Peter Stuge) Date: Tue, 1 Jul 2008 06:14:28 +0200 Subject: [coreboot] The coreboot hare In-Reply-To: <19608AFC7310430CAE5A3142A79D3551@smitty2m> References: <20080701034454.24914.qmail@stuge.se> <19608AFC7310430CAE5A3142A79D3551@smitty2m> Message-ID: <20080701041428.16238.qmail@stuge.se> On Tue, Jul 01, 2008 at 12:02:34AM -0400, Joseph Smith wrote: > > * A clean and simple design that is widely applicable: > > + Web > Ok if I put a linking logo on my site? Certainly! Maybe the "Page footer" version can double as a banner? Please keep in mind to use a white or bright background. > > + Bootsplash > Very cool, would be even cooler to see this as a background for Bayou > or possibly other payloads :-) Ahh - yes! Customizable logo in the tinycurses background! Awesome idea! > > + Case engravings and stickers > Even cool for case badges ;-) Ron had this address for dome stickers.. Hmm. :) > Great work, I really like the design! Thanks! //Peter From peter at stuge.se Tue Jul 1 06:22:04 2008 From: peter at stuge.se (Peter Stuge) Date: Tue, 1 Jul 2008 06:22:04 +0200 Subject: [coreboot] =?utf-8?q?OpenExpo_Z=C3=BCrich_September_24-25_2008?= Message-ID: <20080701042204.25247.qmail@stuge.se> More good news: We have been accepted as exhibitors at OpenExpo in Z?rich! We did not get a huge booth, but we should still have enough space to show off a few boards. So far me and Carl-Daniel are going, but it would of course be fun if even more people could make it there. :) We're also a Hackontest candidate - the contest takes place at the Expo. //Peter From aquynh at gmail.com Tue Jul 1 03:27:13 2008 From: aquynh at gmail.com (Nguyen Anh Quynh) Date: Tue, 1 Jul 2008 10:27:13 +0900 Subject: [coreboot] legacybios names In-Reply-To: <20080701002024.GB17855@morn.localdomain> References: <009101c8c24b$0f8d66c0$0023040a@chimp> <20080701002024.GB17855@morn.localdomain> Message-ID: <9cde8bff0806301827o35940ecdwc481c33590e58e4d@mail.gmail.com> On Tue, Jul 1, 2008 at 9:20 AM, Kevin O'Connor wrote: > Hi, > > On Fri, May 30, 2008 at 05:48:20AM -0600, Myles Watson wrote: >> Kevin, >> >> Here are some other suggestions: >> >> gccBIOS >> >> C-BIOS >> >> pcBIOS >> >> BochsBIOS > > Thanks for the suggestions Myles. Quynh also suggested See-BIOS some > time back. > > I think I'm going to use "SeaBIOS". Yes, sounds cool to me! cheers, Q From stepan at coresystems.de Tue Jul 1 10:57:20 2008 From: stepan at coresystems.de (Stefan Reinauer) Date: Tue, 01 Jul 2008 10:57:20 +0200 Subject: [coreboot] Intel support In-Reply-To: References: <8b1deb52d791346e11f17fd59d303b65@imap.1and1.com> <20080630162837.GA18899@localdomain> <229b33b6ec310ff246964830c2a3b14b@imap.1and1.com> <20080630211440.GA17813@cosmic.amd.com> Message-ID: <4869F170.4010706@coresystems.de> Joseph Smith wrote: >> Without documentation, it becomes nearly impossible. >> Somebody look at the Barcelona memory initialization code and tell >> me they could have figured it out on their own. I'm thinking not. >> >> So we have to be blatantly obvious about what our shortcomings are. >> You can believe all you want in the power of open source, but the >> truth of the matter is that 90% of all the people who come on this list >> to ask for a particular port are not interested in doing the work >> themselves, >> > > And that maybe part of the problem with Intel hardware, everyone wants it > but noone wants to work for it. I am far too familure with this, trust me. > I don't think it's a matter of "noone _wants_ to work for it" but rather a question of Intel ports not being economically justifiable by those who are interested in doing so. Getting supported AMD hardware is cheaper and works out of the box. I am very curious to hear your story though. It's a major issue and the coreboot project has to solve it some time. We're not Robin Hood just because we ignore the "big guys" We (coresystems) are working on support for newer Intel chipsets. But it's a long and cumbersome path to walk. Stefan -- coresystems GmbH ? Brahmsstr. 16 ? D-79104 Freiburg i. Br. Tel.: +49 761 7668825 ? Fax: +49 761 7664613 Email: info at coresystems.de ? http://www.coresystems.de/ Registergericht: Amtsgericht Freiburg ? HRB 7656 Gesch?ftsf?hrer: Stefan Reinauer ? Ust-IdNr.: DE245674866 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 249 bytes Desc: OpenPGP digital signature URL: From c-d.hailfinger.devel.2006 at gmx.net Tue Jul 1 12:25:57 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Tue, 01 Jul 2008 12:25:57 +0200 Subject: [coreboot] The coreboot hare In-Reply-To: <20080701034454.24914.qmail@stuge.se> References: <20080701034454.24914.qmail@stuge.se> Message-ID: <486A0635.4090108@gmx.net> Hi! On 01.07.2008 05:44, Peter Stuge wrote: > You have probably noticed the new logo on the web. It could also be > seen on posters and flyers at LinuxTag about a month ago. > > > Back when we decided to change the project's name, we also wanted to > change to a new logo. Manhole Tux is cool and symbolic, but just like > the old name he is not a great fit for the project since coreboot has > much more general and generic potential than was anticipated. > > A few of us started thinking hard about the logo. We came up with > some important requirements: > > * No obvious connection to other products, because coreboot is quite > generic. In particular no connection to any operating system. > * Something a little bit fun that complements the name > * A clean and simple design that is widely applicable: > + Web > + Bootsplash > + Posters and flyers > + Case engravings and stickers > * Ideally conveying advantageous properties of coreboot > > We tried to brainstorm over the course of two years or so, throughout > the name change discussion, and continuing on after the change. There > was some discussion and logo ideas on the mailing list. > > When we could not find an idea that we really liked, we finally gave > up. After securing sponsorship to cover the cost, I sought help from > an old friend who is a terrific artist and runs a design house called > Breakfast Design near me. He was able to come up with a great idea > very quickly and the design was reviewed and finalized just days > before LinuxTag. > > I managed to get a good deal. My friend Jens does not normally engage > in such small projects and customers (his usual clientele includes > IKEA, book publishers and international record labels) but because he > thinks our project is cool, and because we were able to finish the > design quickly with only very few changes neccessary after each > review, he agreed to do it! > > After some research on uniqueness, the hare was proposed. > Veto because no community input was sought during any of the review phases. Sorry. I will continue to use the penguin for all contest entries and the pending magazine articles until we have a design which had community review during the design process. > Early comments included "playful", "slick", "distinct", "a sense of > speed" and "professional." Ever since I got used to the new shape > (it took me about a week) I have grown quite fond of the hare. > I think it is the distorted head of a dog. Someone else I showed it to said it reminded her of a Mickey Mouse head in side view without ears. (I even have a modified drawing which makes that latter observation very visible). Besides that, associating coreboot with a running hare is not to be done lightly. A hare usually runs because it wants to flee. Besides that, Germans will have funny associations with a running hare: http://www.pitt.edu/~dash/grimm187.html > Special thanks to the sponsors who made it happen: > > Konsult Stuge > coresystems GmbH > Kitchener Waterloo Linux User Group and Richard Weait > And it's unfortunate that these donations/sponsorings have not been announced earlier. Some of us (well, at least me) would have liked to send a thank you note to the donors. Best Regards, Carl-Daniel From cristi.magherusan at net.utcluj.ro Tue Jul 1 12:37:22 2008 From: cristi.magherusan at net.utcluj.ro (Cristi Magherusan) Date: Tue, 01 Jul 2008 13:37:22 +0300 Subject: [coreboot] buildrom - LAB uclibc compilation failure In-Reply-To: <20080630150818.GG14577@cosmic.amd.com> References: <1214639959.13502.13.camel@hyperion.utcluj.ro> <1214670631.13502.21.camel@hyperion.utcluj.ro> <20080630150818.GG14577@cosmic.amd.com> Message-ID: <1214908642.29395.43.camel@localhost> Hello, On Mon, 2008-06-30 at 09:08 -0600, Jordan Crouse wrote: > Since you went to all the effort anyway, would you please document how you > created the initramfs for your payload, and how you integrated it with > buildrom? Eventually, I intend for buildroot to take over building LAB > payloads, since it is clear that the inmates have taken over the asylum > over at uclibc and are intent on making it unusable for regular users. I asked for a wiki account, but haven't got one yet *hint hint* :) Well, It was quite straightforward with buildroot, just that the last steps (mkelfImage, compressing the kernel image with lzma and using coreboot) needed to be made manually. Then I decided to use buildroot with its default settings since the 2.6.22 kernel is good enough for now, and the fact that is more integrated makes it much more suitable for a development system, and I can't afford to waste time on the, collateral task of making buildroot work. The buildroot was re-configured for my needs, I configured the kernel to contain KVM support and some other collateral things, then did the same with busybox, and I added a make test target that runs qemu with my bios image. Afterwards, I included a buildrom make target for my kvm tools, and started to hack on them and make them compile and link against stuff that will be present in the bios image. These tools also needed some stuff like zlib, which I had to include in buildrom and now I'm having some issues with uClibc, which is missing some features present in glibc that are needed by the kvm tools (specifically aio support, by now), and I must add them to uClibc. That's my current status. Best regards, Cristi -- Ing. Cristi M?gheru?an, Universitatea Tehnic? din Cluj-Napoca Centrul de Comunica?ii "Pusztai Kalman" Tel. 0264/401247 http://cc.utcluj.ro -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part URL: From HongGang.Ma at venture.com.sg Tue Jul 1 12:23:38 2008 From: HongGang.Ma at venture.com.sg (HongGang.Ma at venture.com.sg) Date: Tue, 1 Jul 2008 18:23:38 +0800 Subject: [coreboot] For Help of Flashrom Usage Message-ID: Hi, We are using flashrom to flash BIOS in Linux. But it can only successfully read flash and save into file, can not write ROM file into flash. Error information --- Segmentation fault. OS --- Fedora6 with kernel 2.6.18 Chipset --- Intel ICH6-M Flash chip --- SST49LF008A Flashrom version --- It is extracted from coreboot-v2-3401.tar.bz2. My operation step are, 1. cd flashrom 2. make 3. Read flash and save into myBIOS.bin (./flashrom -r myBIOS.bin). Result is OK 4. Write myBIOS.bin into flash (./flashrom -wv myBIOS.bin). Result: Segmentation fault. Could you please provide us some comments or proposals on the problem? Thanks a lot. Best regards? Ma Hong Gang | Principal software engineer, R & D Division ShangHai GES Information Technology CO. Ltd (Member of Venture Group of Companies) Co Registration No. 310115400065538 | 688 Li Shi Zhen Rd | Shanghai Zhangjiang Hi-Tech Park | China 201203 | EXT 8619 | Main +86 21 38984898 | Fax +86 21 50807068 | URL: www.venture.com.sg ? Please consider the environment before printing this e-mail -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: C4464708.jpg Type: image/jpeg Size: 2895 bytes Desc: not available URL: From joe at settoplinux.org Tue Jul 1 13:24:58 2008 From: joe at settoplinux.org (Joseph Smith) Date: Tue, 01 Jul 2008 07:24:58 -0400 Subject: [coreboot] The coreboot hare In-Reply-To: <486A0635.4090108@gmx.net> References: <20080701034454.24914.qmail@stuge.se> <486A0635.4090108@gmx.net> Message-ID: <14100933f80c3f1e3cc60545c1cff196@imap.1and1.com> > Veto because no community input was sought during any of the review > phases. Sorry. > Yeh, I don't remember any discusion on this.... > > I think it is the distorted head of a dog. Someone else I showed it to > said it reminded her of a Mickey Mouse head in side view without ears. > huh? I don't get you here, I think the design turned out really cool :-) -- Thanks, Joseph Smith Set-Top-Linux www.settoplinux.org From rminnich at gmail.com Tue Jul 1 15:18:11 2008 From: rminnich at gmail.com (ron minnich) Date: Tue, 1 Jul 2008 06:18:11 -0700 Subject: [coreboot] The coreboot hare In-Reply-To: <486A0635.4090108@gmx.net> References: <20080701034454.24914.qmail@stuge.se> <486A0635.4090108@gmx.net> Message-ID: <13426df10807010618r6cbef404o7c9a914f4d02a309@mail.gmail.com> On Tue, Jul 1, 2008 at 3:25 AM, Carl-Daniel Hailfinger wrote: > Veto because no community input was sought during any of the review > phases. Sorry. > I will continue to use the penguin for all contest entries and the > pending magazine articles until we have a design which had community > review during the design process. > > ah. well. Speaking as the person who o tried for 12 months to get community input on the name and logo, and o who then went to a small group in search of input, and o who tried to design a voting mechanism and o again requested input, and o got nothing from anyone!, and o who greatly appreciates your contributions to coreboot, I am very sorry you feel this way! I have passed this logo by a great many NON-coreboot, NON-computer types. They loved it, without exception. That said, we could consider community input and a vote and I feel pretty strongly that the new logo would win such a vote :-) We need to make some progress here. I love the new logo, personally, but more important, it's time to move on on the name change and logo. We tried and failed for one full year to get a new logo. This was the best we were able to get. But, I think it's really, really good. Let's get a decision on this. Do we vote? thanks ron From joe at settoplinux.org Tue Jul 1 16:03:19 2008 From: joe at settoplinux.org (Joseph Smith) Date: Tue, 01 Jul 2008 10:03:19 -0400 Subject: [coreboot] The coreboot hare In-Reply-To: <13426df10807010618r6cbef404o7c9a914f4d02a309@mail.gmail.com> References: <20080701034454.24914.qmail@stuge.se> <486A0635.4090108@gmx.net> <13426df10807010618r6cbef404o7c9a914f4d02a309@mail.gmail.com> Message-ID: <7a4910af8ab7693e245344af13151851@imap.1and1.com> On Tue, 1 Jul 2008 06:18:11 -0700, "ron minnich" wrote: > On Tue, Jul 1, 2008 at 3:25 AM, Carl-Daniel Hailfinger > wrote: > >> Veto because no community input was sought during any of the review >> phases. Sorry. >> I will continue to use the penguin for all contest entries and the >> pending magazine articles until we have a design which had community >> review during the design process. >> >> > > ah. well. Speaking as the person who > o tried for 12 months to get community input on the name and logo, and > o who then went to a small group in search of input, and > o who tried to design a voting mechanism and > o again requested input, and > o got nothing from anyone!, and > o who greatly appreciates your contributions to coreboot, > > I am very sorry you feel this way! > > I have passed this logo by a great many NON-coreboot, NON-computer > types. They loved it, without exception. That said, we could consider > community input and a vote and I feel pretty strongly that the new > logo would win such a vote :-) > > We need to make some progress here. I love the new logo, personally, > but more important, it's time to move on on the name change and logo. > We tried and failed for one full year to get a new logo. This was the > best we were able to get. But, I think it's really, really good. > > Let's get a decision on this. Do we vote? > We can vote....but so far there is only one person that doesn't like it. And I would say so far he is out voted :-) -- Thanks, Joseph Smith Set-Top-Linux www.settoplinux.org From c-d.hailfinger.devel.2006 at gmx.net Tue Jul 1 16:06:35 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Tue, 01 Jul 2008 16:06:35 +0200 Subject: [coreboot] The coreboot hare In-Reply-To: <13426df10807010618r6cbef404o7c9a914f4d02a309@mail.gmail.com> References: <20080701034454.24914.qmail@stuge.se> <486A0635.4090108@gmx.net> <13426df10807010618r6cbef404o7c9a914f4d02a309@mail.gmail.com> Message-ID: <486A39EB.4050104@gmx.net> On 01.07.2008 15:18, ron minnich wrote: > On Tue, Jul 1, 2008 at 3:25 AM, Carl-Daniel Hailfinger wrote: > >> Veto because no community input was sought during any of the review >> phases. Sorry. >> I will continue to use the penguin for all contest entries and the >> pending magazine articles until we have a design which had community >> review during the design process. >> >> > > ah. well. Speaking as the person who > o tried for 12 months to get community input on the name and logo, and > o who then went to a small group in search of input, and > o who tried to design a voting mechanism and > o again requested input, and > o got nothing from anyone!, and > I'm sorry that you got that impression. I remember quite a few mails on the list with logo and name proposals (some of them from me) over the course of the last twelve months. Perhaps there was a mail routing glitch and you didn't get them. I'll make sure to CC: you and request feedback if we ever have another name/logo decision process. Actually, I expect we'll have another logo decision process soon, this time for flashrom. > o who greatly appreciates your contributions to coreboot, > > I am very sorry you feel this way! > > I have passed this logo by a great many NON-coreboot, NON-computer > types. They loved it, without exception. That said, we could consider > community input and a vote and I feel pretty strongly that the new > logo would win such a vote :-) > Well, with one finished logo and all other contenders only in draft stage (due to the same no-feedback problem you had) I expect the finished logo to win easily. > We need to make some progress here. I love the new logo, personally, > but more important, it's time to move on on the name change and logo. > We tried and failed for one full year to get a new logo. This was the > best we were able to get. But, I think it's really, really good. > > Let's get a decision on this. Do we vote? > We'd need a few debates on CNN before we vote. Just kidding. I'd like to invest some time in the alternative proposals to make sure they have a chance of getting more than zero votes, though. Regards, Carl-Daniel From jordan.crouse at amd.com Tue Jul 1 16:22:15 2008 From: jordan.crouse at amd.com (Jordan Crouse) Date: Tue, 1 Jul 2008 08:22:15 -0600 Subject: [coreboot] The coreboot hare In-Reply-To: <20080701041428.16238.qmail@stuge.se> References: <20080701034454.24914.qmail@stuge.se> <19608AFC7310430CAE5A3142A79D3551@smitty2m> <20080701041428.16238.qmail@stuge.se> Message-ID: <20080701142215.GB18043@cosmic.amd.com> On 01/07/08 06:14 +0200, Peter Stuge wrote: > On Tue, Jul 01, 2008 at 12:02:34AM -0400, Joseph Smith wrote: > > > * A clean and simple design that is widely applicable: > > > + Web > > Ok if I put a linking logo on my site? > > Certainly! Maybe the "Page footer" version can double as a banner? > Please keep in mind to use a white or bright background. > > > > > + Bootsplash > > Very cool, would be even cooler to see this as a background for Bayou > > or possibly other payloads :-) > > Ahh - yes! Customizable logo in the tinycurses background! Awesome idea! I agree, but we need somebody to do a VESA driver for libpayload (with INT10 - gasp!). Any volunteers? Jordan -- Jordan Crouse Systems Software Development Engineer Advanced Micro Devices, Inc. From rminnich at gmail.com Tue Jul 1 16:23:11 2008 From: rminnich at gmail.com (ron minnich) Date: Tue, 1 Jul 2008 07:23:11 -0700 Subject: [coreboot] The coreboot hare In-Reply-To: <486A39EB.4050104@gmx.net> References: <20080701034454.24914.qmail@stuge.se> <486A0635.4090108@gmx.net> <13426df10807010618r6cbef404o7c9a914f4d02a309@mail.gmail.com> <486A39EB.4050104@gmx.net> Message-ID: <13426df10807010723h105338fel2e645ddfbfe4bbf5@mail.gmail.com> On Tue, Jul 1, 2008 at 7:06 AM, Carl-Daniel Hailfinger wrote: > I'm sorry that you got that impression. I remember quite a few mails on > the list with logo and name proposals (some of them from me) over the > course of the last twelve months. Perhaps there was a mail routing > glitch and you didn't get them. Those I saw. But the discussion was half-hearted or nonexistant at best, as it was for my requests and proposals and the others. It seems neither you or I ever really got anyone excited -- I know that I never did. Plus, as we know, the linuxbios name and logo were pretty compelling -- it's just that the vendors never warmed up to either of them, very much :-( >Actually, I > expect we'll have another logo decision process soon, this time for > flashrom. great! Thanks ron From jordan.crouse at amd.com Tue Jul 1 16:29:36 2008 From: jordan.crouse at amd.com (Jordan Crouse) Date: Tue, 1 Jul 2008 08:29:36 -0600 Subject: [coreboot] The coreboot hare In-Reply-To: <13426df10807010618r6cbef404o7c9a914f4d02a309@mail.gmail.com> References: <20080701034454.24914.qmail@stuge.se> <486A0635.4090108@gmx.net> <13426df10807010618r6cbef404o7c9a914f4d02a309@mail.gmail.com> Message-ID: <20080701142936.GC18043@cosmic.amd.com> On 01/07/08 06:18 -0700, ron minnich wrote: > On Tue, Jul 1, 2008 at 3:25 AM, Carl-Daniel Hailfinger > wrote: > > > Veto because no community input was sought during any of the review > > phases. Sorry. > > I will continue to use the penguin for all contest entries and the > > pending magazine articles until we have a design which had community > > review during the design process. > > > > > > ah. well. Speaking as the person who > o tried for 12 months to get community input on the name and logo, and > o who then went to a small group in search of input, and > o who tried to design a voting mechanism and > o again requested input, and > o got nothing from anyone!, and > o who greatly appreciates your contributions to coreboot, > > I am very sorry you feel this way! > > I have passed this logo by a great many NON-coreboot, NON-computer > types. They loved it, without exception. That said, we could consider > community input and a vote and I feel pretty strongly that the new > logo would win such a vote :-) > > We need to make some progress here. I love the new logo, personally, > but more important, it's time to move on on the name change and logo. > We tried and failed for one full year to get a new logo. This was the > best we were able to get. But, I think it's really, really good. > > Let's get a decision on this. Do we vote? I don't think so - this is not a democracy. The logo is the only one that has been presented in nearly a year of discussion. If there were alternate competing designs, then perhaps we could have some sort of vote or debate, but this is the only rabbit in the race (so to speak). Jordan -- Jordan Crouse Systems Software Development Engineer Advanced Micro Devices, Inc. From jordan.crouse at amd.com Tue Jul 1 16:35:04 2008 From: jordan.crouse at amd.com (Jordan Crouse) Date: Tue, 1 Jul 2008 08:35:04 -0600 Subject: [coreboot] The coreboot hare In-Reply-To: <20080701034454.24914.qmail@stuge.se> References: <20080701034454.24914.qmail@stuge.se> Message-ID: <20080701143504.GD18043@cosmic.amd.com> On 01/07/08 05:44 +0200, Peter Stuge wrote: > The license could be debated. CC by-nd and by-sa were discussed, but > by-sa would let anyone do anything to it, which I don't think is a > good idea. I would prefer that we created any necessary variations > ourselves, and made them available for reuse. CC in general may not > be such a good fit for a logo. > > The current license is modeled after the OpenOffice.org logo license. The current license isn't very friendly to commercial entities. As it stands, we are unable to use the logo in our signage, which would be a shame. We also couldn't put it into bayou since the license would be incompatible with the GPL. Can we consider CC-by-nd, please, to allow commercial reuse? And why is CC-by-sa out of the question? I think that the many variations of the Linux penguin has only served to enforce the brand, not dilute it. Jordan -- Jordan Crouse Systems Software Development Engineer Advanced Micro Devices, Inc. From segher at kernel.crashing.org Tue Jul 1 17:06:07 2008 From: segher at kernel.crashing.org (Segher Boessenkool) Date: Tue, 1 Jul 2008 17:06:07 +0200 Subject: [coreboot] The coreboot hare In-Reply-To: <13426df10807010618r6cbef404o7c9a914f4d02a309@mail.gmail.com> References: <20080701034454.24914.qmail@stuge.se> <486A0635.4090108@gmx.net> <13426df10807010618r6cbef404o7c9a914f4d02a309@mail.gmail.com> Message-ID: <8ed609dab94d10f3f997072a95bffb6e@kernel.crashing.org> > Let's get a decision on this. Do we vote? Sure, why not. Or we can just agree to agree, veto the veto, so we don't have to vote for a vote? :-) Segher From jakllsch at kollasch.net Tue Jul 1 17:34:11 2008 From: jakllsch at kollasch.net (Jonathan A. Kollasch) Date: Tue, 1 Jul 2008 15:34:11 +0000 Subject: [coreboot] AMD761 + VIA VT82C686B (eventually HighPiont HPT370A) In-Reply-To: References: <200806301145.17047.marekpenther@aol.com> Message-ID: <20080701153410.GG683@tazenda.kollasch.net> On Mon, Jun 30, 2008 at 04:17:35PM -0400, Corey Osgood wrote: > Sorry, but given the age of these chips (K6 system, right?), it's > somewhat doubtful that anyone even has a board around to work on. > There may be some limited support in LinuxBIOSv1. I actually have a KG7-RAID. It's S462 Athlon. This said, I'm not extremely interested in doing raminit code. > > -Corey > > On Mon, Jun 30, 2008 at 7:45 AM, Marek Artur Penther > wrote: > > I still waiting for linuxbios/coreboot to support at least these devices > > (AMD761, VIA VT82C686B). I have 'Abit KG7-RAID' MotherBoard and there are > > such devices. I'd like to run this MB with CoreBoot. I can provide a lot of > > datasheets and specsheets for these devices (all family of AMD7xx (AMD751, > > AMD756, AMD761, AMD762, AMD766, AMD768)). Including the BIOS developers guide to the 761? Last I checked that wasn't available. Jonathan Kollasch -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 194 bytes Desc: not available URL: From mylesgw at gmail.com Tue Jul 1 19:40:48 2008 From: mylesgw at gmail.com (Myles Watson) Date: Tue, 1 Jul 2008 11:40:48 -0600 Subject: [coreboot] legacybios names In-Reply-To: <20080701002024.GB17855@morn.localdomain> References: <009101c8c24b$0f8d66c0$0023040a@chimp> <20080701002024.GB17855@morn.localdomain> Message-ID: <001a01c8dba1$99be6af0$0023040a@chimp> > I think I'm going to use "SeaBIOS". That sounds fine. The only issue I see is that there's no real connection to the ocean. It does allow for some fun logos, though. Are you going to change the download URL soon? Thanks, Myles From jordan.crouse at amd.com Tue Jul 1 19:45:49 2008 From: jordan.crouse at amd.com (Jordan Crouse) Date: Tue, 1 Jul 2008 11:45:49 -0600 Subject: [coreboot] legacybios names In-Reply-To: <001a01c8dba1$99be6af0$0023040a@chimp> References: <009101c8c24b$0f8d66c0$0023040a@chimp> <20080701002024.GB17855@morn.localdomain> <001a01c8dba1$99be6af0$0023040a@chimp> Message-ID: <20080701174549.GF23505@cosmic.amd.com> On 01/07/08 11:40 -0600, Myles Watson wrote: > > > I think I'm going to use "SeaBIOS". > > That sounds fine. The only issue I see is that there's no real connection > to the ocean. It does allow for some fun logos, though. Can rabbits swim? :) Jordan -- Jordan Crouse Systems Software Development Engineer Advanced Micro Devices, Inc. From joe at settoplinux.org Tue Jul 1 19:54:49 2008 From: joe at settoplinux.org (Joseph Smith) Date: Tue, 01 Jul 2008 13:54:49 -0400 Subject: [coreboot] legacybios names In-Reply-To: <20080701174549.GF23505@cosmic.amd.com> References: <009101c8c24b$0f8d66c0$0023040a@chimp> <20080701002024.GB17855@morn.localdomain> <001a01c8dba1$99be6af0$0023040a@chimp> <20080701174549.GF23505@cosmic.amd.com> Message-ID: On Tue, 1 Jul 2008 11:45:49 -0600, Jordan Crouse wrote: > On 01/07/08 11:40 -0600, Myles Watson wrote: >> >> > I think I'm going to use "SeaBIOS". >> >> That sounds fine. The only issue I see is that there's no real > connection >> to the ocean. It does allow for some fun logos, though. > > Can rabbits swim? :) > If the hare is running fast enough it will skim right over the top of the water :-) -- Thanks, Joseph Smith Set-Top-Linux www.settoplinux.org From mylesgw at gmail.com Tue Jul 1 19:58:44 2008 From: mylesgw at gmail.com (Myles Watson) Date: Tue, 1 Jul 2008 11:58:44 -0600 Subject: [coreboot] legacybios names In-Reply-To: <20080701174549.GF23505@cosmic.amd.com> References: <009101c8c24b$0f8d66c0$0023040a@chimp> <20080701002024.GB17855@morn.localdomain> <001a01c8dba1$99be6af0$0023040a@chimp> <20080701174549.GF23505@cosmic.amd.com> Message-ID: <001b01c8dba4$1aad1790$0023040a@chimp> > > > I think I'm going to use "SeaBIOS". > > > > That sounds fine. The only issue I see is that there's no real > connection > > to the ocean. It does allow for some fun logos, though. > > Can rabbits swim? :) Yes. http://www.youtube.com/results?search_query=hare+swim&search_type= 20 hits http://www.youtube.com/results?search_query=rabbit+swim&search_type=&aq=f 185 hits http://www.youtube.com/results?search_query=bunny+swim&search_type=&aq=f 107 hits :) Myles From rminnich at gmail.com Tue Jul 1 20:05:29 2008 From: rminnich at gmail.com (ron minnich) Date: Tue, 1 Jul 2008 11:05:29 -0700 Subject: [coreboot] legacybios names In-Reply-To: <001b01c8dba4$1aad1790$0023040a@chimp> References: <009101c8c24b$0f8d66c0$0023040a@chimp> <20080701002024.GB17855@morn.localdomain> <001a01c8dba1$99be6af0$0023040a@chimp> <20080701174549.GF23505@cosmic.amd.com> <001b01c8dba4$1aad1790$0023040a@chimp> Message-ID: <13426df10807011105k743c5467n6232ce53d7c82d89@mail.gmail.com> neat name. No need to tie it to coreboot. I wonder if you can have a mermaid or Neptune logo -- could have fun with the pitchfork! ron From pyro at linuxlabs.com Tue Jul 1 20:44:23 2008 From: pyro at linuxlabs.com (pyro) Date: Tue, 1 Jul 2008 14:44:23 -0400 (EDT) Subject: [coreboot] legacybios names In-Reply-To: <20080701174549.GF23505@cosmic.amd.com> References: <009101c8c24b$0f8d66c0$0023040a@chimp> <20080701002024.GB17855@morn.localdomain> <001a01c8dba1$99be6af0$0023040a@chimp> <20080701174549.GF23505@cosmic.amd.com> Message-ID: Greetings, On Tue, 1 Jul 2008, Jordan Crouse wrote: > On 01/07/08 11:40 -0600, Myles Watson wrote: > > > > > I think I'm going to use "SeaBIOS". > > > > That sounds fine. The only issue I see is that there's no real connection > > to the ocean. It does allow for some fun logos, though. > > Can rabbits swim? :) According to Jimmy Carter, they can: http://en.wikipedia.org/wiki/Jimmy_Carter_rabbit_incident Sorry, couldn't resist :-) > > Jordan > > -- > Jordan Crouse > Systems Software Development Engineer > Advanced Micro Devices, Inc. > > > -- > coreboot mailing list > coreboot at coreboot.org > http://www.coreboot.org/mailman/listinfo/coreboot > ||||| |||| ||||||||||||| ||| by Linux Labs International, Inc. Steven James, CTO 866 824 9737 support From joe at settoplinux.org Tue Jul 1 20:45:59 2008 From: joe at settoplinux.org (Joseph Smith) Date: Tue, 1 Jul 2008 14:45:59 -0400 Subject: [coreboot] legacybios names In-Reply-To: <13426df10807011105k743c5467n6232ce53d7c82d89@mail.gmail.com> References: <009101c8c24b$0f8d66c0$0023040a@chimp><20080701002024.GB17855@morn.localdomain><001a01c8dba1$99be6af0$0023040a@chimp><20080701174549.GF23505@cosmic.amd.com><001b01c8dba4$1aad1790$0023040a@chimp> <13426df10807011105k743c5467n6232ce53d7c82d89@mail.gmail.com> Message-ID: <4E862D19DE874B38A4EF213F0AC9EC6A@smitty2m> > -----Original Message----- > From: coreboot-bounces+joe=settoplinux.org at coreboot.org [mailto:coreboot- > bounces+joe=settoplinux.org at coreboot.org] On Behalf Of ron minnich > Sent: Tuesday, July 01, 2008 2:05 PM > To: Myles Watson > Cc: coreboot at coreboot.org; Jordan Crouse; Kevin O'Connor; Nguyen Anh Quynh > Subject: Re: [coreboot] legacybios names > > neat name. No need to tie it to coreboot. I wonder if you can have a > mermaid or Neptune logo -- could have fun with the pitchfork! > Either that or a Big fish, SeaBIOS -> SEABASS Thanks, Joseph Smith Set-Top-Linux www.settoplinux.org From marekpenther at aol.com Tue Jul 1 22:28:28 2008 From: marekpenther at aol.com (Marek Artur Penther) Date: Tue, 1 Jul 2008 20:28:28 +0000 Subject: [coreboot] datasheets for AMD7xxXX (AMD75x, AMD76x, AMD760MP/MPX) Message-ID: <200807012028.28692.marekpenther@aol.com> All datasheets can be downloaded from: www.amd.com for AMD750 (AMD751 and AMD756) see http://www.amd.com/pl-pl/Processors/TechnicalResources/0,,30_182_739_1133^1137,00.html for AMD760 (AMD761 and AMD766) see http://www.amd.com/pl-pl/Processors/TechnicalResources/0,,30_182_739_1133,00.html for AMD760MP (AMD762 and AMD766) see http://www.amd.com/pl-pl/Processors/TechnicalResources/0,,30_182_739_1130,00.html for AMD760MPX (AMD762 and AMD768) see http://www.amd.com/pl-pl/Processors/TechnicalResources/0,,30_182_739_4296,00.html for AMD Athlon, Athlon XP, Duron processor see http://www.amd.com/pl-pl/Processors/TechnicalResources/0,,30_182_739_2983,00.html There is list of my collection of data/specsheets for this platform: AMD-750 - Chipset Overview.pdf AMD-751 - System Controller.pdf AMD-751 - System Controller - Revision Guide.pdf AMD-756 Peripherial Bus Controller - Revision Guide.pdf AMD-756 - Peripherial Bus Controller.pdf AMD-760MPX Platform for the AMD Athlon MP Processor.pdf AMD-760MPX - Chipset Overview.pdf AMD-760MP Platform.pdf AMD-760MP - Chipset Overview.pdf AMD-760 - Chipset with DDR SDRAM Memory Support.pdf AMD-761 - System Controller.pdf AMD-761 - System Controller - Revision Guide.pdf AMD-761 - System Controller - Software BIOS Guide.pdf AMD-762 - System Controller.pdf AMD-762 - System Controller - Revision Guide.pdf AMD-762 - System Controller - Software BIOS Design Guide.pdf AMD-766 - Peripherial Bus Controller.pdf AMD-766 - Peripherial Bus Controller - Revision Guide.pdf AMD-768 - Peripherial Bus Controller.pdf AMD-768 - Peripherial Bus Controller - Revision Guide.pdf Interfacing the AMD-761 System Controller and the Via Technologies, Inc. VT82C686B Southbridge.pdf AMD Athlon Processor - x86 Code Optimization Guide.pdf AMD Athlon Processor - Technical Brief.pdf AMD Athlon - Processor Module.pdf AMD Athlon Processor Module - Signal and Power-UP Requirements.pdf AMD Athlon Processor Model 1 and Model 2 - Revision Guide.pdf AMD Athlon Processor Model 4.pdf AMD Athlon Processor Model 4 - Revision Guide.pdf AMD Athlon XP Processor Model 6.pdf AMD Athlon Processor Model 6 - Revision Guide.pdf AMD Athlon XP Processor Model 8.pdf AMD Athlon Processor Model 8 - Revision Guide.pdf AMD Athlon XP Processor Model 10.PDF AMD Athlon XP Processor Model 10 with 256K L2 Cache.pdf AMD Athlon Processor Model 10 - Revision Guide.pdf System Considerations for Dual AMD Athlon MP Processors in Tower and 1U Form Factors.pdf Linux Kernel Issue with Systems Using AGP Graphics.pdf From svn at coreboot.org Tue Jul 1 22:57:48 2008 From: svn at coreboot.org (svn at coreboot.org) Date: Tue, 1 Jul 2008 22:57:48 +0200 Subject: [coreboot] r208 - in buildrom-devel: config/payloads config/platforms packages packages/legacybios Message-ID: Author: myles Date: 2008-07-01 22:57:47 +0200 (Tue, 01 Jul 2008) New Revision: 208 Added: buildrom-devel/packages/legacybios/ buildrom-devel/packages/legacybios/hardcode.diff buildrom-devel/packages/legacybios/legacybios.mk Modified: buildrom-devel/config/payloads/Config.in buildrom-devel/config/payloads/payloads.conf buildrom-devel/config/platforms/qemu.conf buildrom-devel/config/platforms/serengeti_cheetah.conf Log: This patch adds legacybios to buildrom. It has some options hardcoded in hardcode.diff because it seems like the easiest way to keep the configuration in one place. As soon as the URL changes to SeaBIOS, I'll change the name in buildrom. Signed-off-by: Myles Watson Acked-by: Uwe Hermann Modified: buildrom-devel/config/payloads/Config.in =================================================================== --- buildrom-devel/config/payloads/Config.in 2008-06-23 15:28:22 UTC (rev 207) +++ buildrom-devel/config/payloads/Config.in 2008-07-01 20:57:47 UTC (rev 208) @@ -52,6 +52,9 @@ bool "Linux As Bootloader" select PAYLOAD_64BIT +config PAYLOAD_LEGACYBIOS + bool "LegacyBIOS" + config PAYLOAD_OFW depends on EXPERIMENTAL depends on !PLATFORM_M57SLI Modified: buildrom-devel/config/payloads/payloads.conf =================================================================== --- buildrom-devel/config/payloads/payloads.conf 2008-06-23 15:28:22 UTC (rev 207) +++ buildrom-devel/config/payloads/payloads.conf 2008-07-01 20:57:47 UTC (rev 208) @@ -16,6 +16,7 @@ ### Include the correct payload configuration PAYLOAD-y= +PAYLOAD-$(CONFIG_PAYLOAD_LEGACYBIOS) = legacybios PAYLOAD-$(CONFIG_PAYLOAD_LAB) = lab PAYLOAD-$(CONFIG_PAYLOAD_ETHERBOOT) = etherboot PAYLOAD-$(CONFIG_PAYLOAD_GPXE) = gpxe Modified: buildrom-devel/config/platforms/qemu.conf =================================================================== --- buildrom-devel/config/platforms/qemu.conf 2008-06-23 15:28:22 UTC (rev 207) +++ buildrom-devel/config/platforms/qemu.conf 2008-07-01 20:57:47 UTC (rev 208) @@ -15,7 +15,7 @@ ETHERBOOT_ARCH=i386 # coreboot-v2 configuration -CBV2_TAG=3281 +CBV2_TAG=3343 CBV2_TDIR=qemu-x86 # coreboot v3 configuration Modified: buildrom-devel/config/platforms/serengeti_cheetah.conf =================================================================== --- buildrom-devel/config/platforms/serengeti_cheetah.conf 2008-06-23 15:28:22 UTC (rev 207) +++ buildrom-devel/config/platforms/serengeti_cheetah.conf 2008-07-01 20:57:47 UTC (rev 208) @@ -40,11 +40,11 @@ ifeq ($(CONFIG_PLATFORM_CHEETAH_FAM10),y) COREBOOT_BOARD=serengeti_cheetah_fam10 CBV2_TDIR=serengeti_cheetah_fam10 -CBV2_TAG=3335 +CBV2_TAG=3343 else COREBOOT_BOARD=serengeti_cheetah CBV2_TDIR=serengeti_cheetah -CBV2_TAG=3335 +CBV2_TAG=3343 endif # FILO configuration Added: buildrom-devel/packages/legacybios/hardcode.diff =================================================================== --- buildrom-devel/packages/legacybios/hardcode.diff (rev 0) +++ buildrom-devel/packages/legacybios/hardcode.diff 2008-07-01 20:57:47 UTC (rev 208) @@ -0,0 +1,39 @@ +diff --git a/src/config.h b/src/config.h +index 4ae23dc..5ed9799 100644 +--- a/src/config.h ++++ b/src/config.h +@@ -14,17 +14,17 @@ + #endif + + // Configure as a payload coreboot payload. +-#define CONFIG_COREBOOT 0 ++#define CONFIG_COREBOOT 1 + +-#define CONFIG_DEBUG_SERIAL 0 ++#define CONFIG_DEBUG_SERIAL 1 + +-#define CONFIG_FLOPPY_SUPPORT 1 ++#define CONFIG_FLOPPY_SUPPORT 1 + #define CONFIG_PS2_MOUSE 1 + #define CONFIG_ATA 1 + #define CONFIG_KBD_CALL_INT15_4F 1 + #define CONFIG_CDROM_BOOT 1 + #define CONFIG_CDROM_EMU 1 +-#define CONFIG_PCIBIOS 1 ++#define CONFIG_PCIBIOS 0 + + /* define it if the (emulated) hardware supports SMM mode */ + #define CONFIG_USE_SMM 1 +diff --git a/src/post.c b/src/post.c +index a6f7c3d..7890d65 100644 +--- a/src/post.c ++++ b/src/post.c +@@ -83,7 +83,7 @@ ram_probe(void) + u32 rs; + if (CONFIG_COREBOOT) { + // XXX - just hardcode for now. +- rs = 128*1024*1024; ++ rs = 128*1024*1024; + } else { + // On emulators, get memory size from nvram. + rs = (inb_cmos(CMOS_MEM_EXTMEM2_LOW) Added: buildrom-devel/packages/legacybios/legacybios.mk =================================================================== --- buildrom-devel/packages/legacybios/legacybios.mk (rev 0) +++ buildrom-devel/packages/legacybios/legacybios.mk 2008-07-01 20:57:47 UTC (rev 208) @@ -0,0 +1,59 @@ +LEGACYBIOS_URL=git://git.linuxtogo.org/home/kevin/legacybios/ +LEGACYBIOS_TAG=master + +LEGACYBIOS_DIR=$(BUILD_DIR)/legacybios +LEGACYBIOS_SRC_DIR=$(LEGACYBIOS_DIR)/legacybios-$(LEGACYBIOS_TAG) +LEGACYBIOS_STAMP_DIR=$(LEGACYBIOS_DIR)/stamps +LEGACYBIOS_LOG_DIR=$(LEGACYBIOS_DIR)/logs + +LEGACYBIOS_PATCHES=hardcode.diff + +ifeq ($(CONFIG_VERBOSE),y) +LEGACYBIOS_FETCH_LOG=/dev/stdout +LEGACYBIOS_BUILD_LOG=/dev/stdout +else +LEGACYBIOS_BUILD_LOG=$(LEGACYBIOS_LOG_DIR)/build.log +LEGACYBIOS_FETCH_LOG=$(LEGACYBIOS_LOG_DIR)/fetch.log +endif + +LEGACYBIOS_TARBALL=legacybios.tar + +ifeq ($(shell if [ -f $(PACKAGE_DIR)/legacybios/conf/customconfig--$(PAYLOAD)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD) ]; then echo 1; fi),1) + LEGACYBIOS_CONFIG = customconfig--$(PAYLOAD)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD) +endif + +$(SOURCE_DIR)/$(LEGACYBIOS_TARBALL): | $(LEGACYBIOS_STAMP_DIR) $(LEGACYBIOS_LOG_DIR) + @ echo "Fetching LegacyBIOS..." + @ mkdir -p $(SOURCE_DIR) + @ $(BIN_DIR)/fetchgit.sh $(LEGACYBIOS_URL) $(SOURCE_DIR)/legacybios $(LEGACYBIOS_TAG) $(SOURCE_DIR)/$(LEGACYBIOS_TARBALL) legacybios > $(LEGACYBIOS_FETCH_LOG) 2>&1 + +$(LEGACYBIOS_STAMP_DIR)/.unpacked: $(SOURCE_DIR)/$(LEGACYBIOS_TARBALL) | $(LEGACYBIOS_STAMP_DIR) $(LEGACYBIOS_DIR) $(LEGACYBIOS_LOG_DIR) + @ echo "Unpacking LegacyBIOS..." + @ tar -C $(LEGACYBIOS_DIR) -xf $(SOURCE_DIR)/$(LEGACYBIOS_TARBALL) + @ touch $@ + +$(LEGACYBIOS_SRC_DIR)/out/bios.bin: $(LEGACYBIOS_STAMP_DIR)/.unpacked + @ echo "Building LegacyBIOS..." + @ make -C $(LEGACYBIOS_SRC_DIR) > $(LEGACYBIOS_BUILD_LOG) 2>&1 + +$(LEGACYBIOS_STAMP_DIR) $(LEGACYBIOS_LOG_DIR): + @ mkdir -p $@ + +$(LEGACYBIOS_STAMP_DIR)/.copied: $(LEGACYBIOS_SRC_DIR)/out/bios.bin + @ mkdir -p $(shell dirname $(PAYLOAD_ELF)) + @ cp $(LEGACYBIOS_SRC_DIR)/out/bios.bin.elf $(PAYLOAD_ELF) + @ touch $@ + +legacybios: $(LEGACYBIOS_STAMP_DIR)/.copied + @ cp $(LEGACYBIOS_SRC_DIR)/out/bios.bin.elf $(LEGACYBIOS_SRC_DIR)/legacybios.elf + +legacybios-clean: + @ echo "Cleaning LegacyBIOS..." + @ rm -f $(LEGACYBIOS_STAMP_DIR)/.copied +ifneq ($(wildcard $(LEGACYBIOS_SRC_DIR)/Makefile),) + @ $(MAKE) -C $(LEGACYBIOS_SRC_DIR) clean > /dev/null 2>&1 +endif + +legacybios-distclean: + @ rm -rf $(LEGACYBIOS_DIR)/* + From mylesgw at gmail.com Tue Jul 1 22:59:02 2008 From: mylesgw at gmail.com (Myles Watson) Date: Tue, 1 Jul 2008 14:59:02 -0600 Subject: [coreboot] Add legacybios to buildrom In-Reply-To: <2831fecf0806260739t2577d065u2086e4464f114a54@mail.gmail.com> References: <2831fecf0806231553l3980d985kcb09dfba0e7954c0@mail.gmail.com> <20080626142602.GI580@greenwood> <20080626143355.GE12854@cosmic.amd.com> <2831fecf0806260739t2577d065u2086e4464f114a54@mail.gmail.com> Message-ID: <2831fecf0807011359x9351138ld237d3358a205f22@mail.gmail.com> On Thu, Jun 26, 2008 at 8:39 AM, Myles Watson wrote: > On Thu, Jun 26, 2008 at 8:33 AM, Jordan Crouse wrote: >> On 26/06/08 16:26 +0200, Uwe Hermann wrote: >>> On Mon, Jun 23, 2008 at 04:53:46PM -0600, Myles Watson wrote: >>> > This is the same patch I posted earlier which adds legacybios to >>> > buildrom. It has some options hardcoded in hardcode.diff because it >>> > seems like the easiest way to keep the configuration in one place. >>> > >>> > Signed-off-by: Myles Watson >>> >>> Acked-by: Uwe Hermann Rev 208. Thanks, Myles >>> Looks good and it's build-tested by me. Will test on hardware later. >> >> As per Stepan it is his intention that LegacyBIOS be part of coreboot-v3, >> so I don't want to mess with his efforts. Of course, that leaves the >> question of what we want to do for v2. >> >> Can we wait for his guidance before committing? > > Sure. I don't think adding support for a payload to buildrom should > interfere with anything, but I can wait for his input. > > Thanks, > Myles > From peter at stuge.se Tue Jul 1 23:10:46 2008 From: peter at stuge.se (Peter Stuge) Date: Tue, 1 Jul 2008 23:10:46 +0200 Subject: [coreboot] r208 - in buildrom-devel: config/payloads config/platforms packages packages/legacybios Message-ID: <20080701211046.30724.qmail@stuge.se> On Tue, Jul 01, 2008 at 10:57:48PM +0200, svn at coreboot.org wrote: > Added: > buildrom-devel/packages/legacybios/ Please update the name everywhere when upstream has made the change. :) //Peter From svn at coreboot.org Tue Jul 1 23:13:46 2008 From: svn at coreboot.org (svn at coreboot.org) Date: Tue, 1 Jul 2008 23:13:46 +0200 Subject: [coreboot] r209 - buildrom-devel/config/payloads Message-ID: Author: myles Date: 2008-07-01 23:13:46 +0200 (Tue, 01 Jul 2008) New Revision: 209 Modified: buildrom-devel/config/payloads/Config.in Log: This trivial patch changes a "depends" -> "depends on" for compatibility with newer kconfig. Signed-off-by: Myles Watson Acked-by: Myles Watson Modified: buildrom-devel/config/payloads/Config.in =================================================================== --- buildrom-devel/config/payloads/Config.in 2008-07-01 20:57:47 UTC (rev 208) +++ buildrom-devel/config/payloads/Config.in 2008-07-01 21:13:46 UTC (rev 209) @@ -5,7 +5,7 @@ config USE_LZMA bool "Enable LZMA compression" - depends COREBOOT_V3 || (COREBOOT_V2 && !PLATFORM_GEODE) + depends on COREBOOT_V3 || (COREBOOT_V2 && !PLATFORM_GEODE) default y help Precompress the payload with LZMA when using coreboot v2. This changes From mylesgw at gmail.com Tue Jul 1 23:15:55 2008 From: mylesgw at gmail.com (Myles Watson) Date: Tue, 1 Jul 2008 15:15:55 -0600 Subject: [coreboot] r208 - in buildrom-devel: config/payloadsconfig/platforms packages packages/legacybios In-Reply-To: <20080701211046.30724.qmail@stuge.se> References: <20080701211046.30724.qmail@stuge.se> Message-ID: <002601c8dbbf$a69617f0$0023040a@chimp> > On Tue, Jul 01, 2008 at 10:57:48PM +0200, svn at coreboot.org wrote: > > Added: > > buildrom-devel/packages/legacybios/ > > Please update the name everywhere when upstream has made the change. > :) Will do. Thanks, Myles From jordan.crouse at amd.com Tue Jul 1 23:17:59 2008 From: jordan.crouse at amd.com (Jordan Crouse) Date: Tue, 1 Jul 2008 15:17:59 -0600 Subject: [coreboot] Add legacybios to buildrom In-Reply-To: <2831fecf0807011359x9351138ld237d3358a205f22@mail.gmail.com> References: <2831fecf0806231553l3980d985kcb09dfba0e7954c0@mail.gmail.com> <20080626142602.GI580@greenwood> <20080626143355.GE12854@cosmic.amd.com> <2831fecf0806260739t2577d065u2086e4464f114a54@mail.gmail.com> <2831fecf0807011359x9351138ld237d3358a205f22@mail.gmail.com> Message-ID: <20080701211759.GB25252@cosmic.amd.com> On 01/07/08 14:59 -0600, Myles Watson wrote: > On Thu, Jun 26, 2008 at 8:39 AM, Myles Watson wrote: > > On Thu, Jun 26, 2008 at 8:33 AM, Jordan Crouse wrote: > >> On 26/06/08 16:26 +0200, Uwe Hermann wrote: > >>> On Mon, Jun 23, 2008 at 04:53:46PM -0600, Myles Watson wrote: > >>> > This is the same patch I posted earlier which adds legacybios to > >>> > buildrom. It has some options hardcoded in hardcode.diff because it > >>> > seems like the easiest way to keep the configuration in one place. > >>> > > >>> > Signed-off-by: Myles Watson > >>> > >>> Acked-by: Uwe Hermann > > Rev 208. Was this renamed or does that still need to be done? > Thanks, > Myles > > >>> Looks good and it's build-tested by me. Will test on hardware later. > >> > >> As per Stepan it is his intention that LegacyBIOS be part of coreboot-v3, > >> so I don't want to mess with his efforts. Of course, that leaves the > >> question of what we want to do for v2. > >> > >> Can we wait for his guidance before committing? > > > > Sure. I don't think adding support for a payload to buildrom should > > interfere with anything, but I can wait for his input. > > > > Thanks, > > Myles > > > -- Jordan Crouse Systems Software Development Engineer Advanced Micro Devices, Inc. From mylesgw at gmail.com Tue Jul 1 23:26:01 2008 From: mylesgw at gmail.com (Myles Watson) Date: Tue, 1 Jul 2008 15:26:01 -0600 Subject: [coreboot] Add legacybios to buildrom In-Reply-To: <20080701211759.GB25252@cosmic.amd.com> References: <2831fecf0806231553l3980d985kcb09dfba0e7954c0@mail.gmail.com> <20080626142602.GI580@greenwood> <20080626143355.GE12854@cosmic.amd.com> <2831fecf0806260739t2577d065u2086e4464f114a54@mail.gmail.com> <2831fecf0807011359x9351138ld237d3358a205f22@mail.gmail.com> <20080701211759.GB25252@cosmic.amd.com> Message-ID: <002701c8dbc1$10232950$0023040a@chimp> > -----Original Message----- > From: Jordan Crouse [mailto:jordan.crouse at amd.com] > Sent: Tuesday, July 01, 2008 3:18 PM > To: Myles Watson > Cc: Uwe Hermann; Coreboot; Stefan Reinauer > Subject: Re: Add legacybios to buildrom > > On 01/07/08 14:59 -0600, Myles Watson wrote: > > On Thu, Jun 26, 2008 at 8:39 AM, Myles Watson wrote: > > > On Thu, Jun 26, 2008 at 8:33 AM, Jordan Crouse > wrote: > > >> On 26/06/08 16:26 +0200, Uwe Hermann wrote: > > >>> On Mon, Jun 23, 2008 at 04:53:46PM -0600, Myles Watson wrote: > > >>> > This is the same patch I posted earlier which adds legacybios to > > >>> > buildrom. It has some options hardcoded in hardcode.diff because > it > > >>> > seems like the easiest way to keep the configuration in one place. > > >>> > > > >>> > Signed-off-by: Myles Watson > > >>> > > >>> Acked-by: Uwe Hermann > > > > Rev 208. > > Was this renamed or does that still need to be done? I'll rename it when Kevin renames the URL. Thanks, Myles > > Thanks, > > Myles > > > > >>> Looks good and it's build-tested by me. Will test on hardware later. > > >> > > >> As per Stepan it is his intention that LegacyBIOS be part of > coreboot-v3, > > >> so I don't want to mess with his efforts. Of course, that leaves the > > >> question of what we want to do for v2. > > >> > > >> Can we wait for his guidance before committing? > > > > > > Sure. I don't think adding support for a payload to buildrom should > > > interfere with anything, but I can wait for his input. > > > > > > Thanks, > > > Myles > > > > > > > -- > Jordan Crouse > Systems Software Development Engineer > Advanced Micro Devices, Inc. From mylesgw at gmail.com Tue Jul 1 23:35:05 2008 From: mylesgw at gmail.com (Myles Watson) Date: Tue, 1 Jul 2008 15:35:05 -0600 Subject: [coreboot] [PATCH] buildrom: Update kconfig to recent version In-Reply-To: <20080425000631.GA32238@greenwood> References: <20080425000631.GA32238@greenwood> Message-ID: <2831fecf0807011435r5d290ea4jc2af9b86e1c817be@mail.gmail.com> On Thu, Apr 24, 2008 at 6:06 PM, Uwe Hermann wrote: > See patch. > > The actual patch is > buildrom_update_kconfig.patch.gz > but that's huge and totally unreadable so I recommend reviewing > buildrom_update_kconfig_makefile.patch > > That's the only change to the buildrom code itself, the rest is just > replacing the whole scripts/kconfig/ dir with the new kconfig. > > I used the coreinfo kconfig/ with only a handful of string replacements > a la s/coreinfo/buildrom/ so the diff to coreinfo's kconfig is tiny. > > > I did some ad-hoc testing with this, tried various kconfig targets > (menuconfig, xconfig, gconfig, ...) and various buildrom builds and > it seems to work fine so far, but some more testing by others is > highly appreciated. It doesn't change the behavior of my favorite builds. It does get rid of the invalid value warnings. In Makefile, you can remove the declaration of KCONFIG_DIR, since you deleted all other references to it. Acked-by: Myles Watson Thanks, Myles > > Thanks, Uwe. > -- > http://www.hermann-uwe.de | http://www.holsham-traders.de > http://www.crazy-hacks.org | http://www.unmaintained-free-software.org > > -- > coreboot mailing list > coreboot at coreboot.org > http://www.coreboot.org/mailman/listinfo/coreboot > From peter at stuge.se Wed Jul 2 00:18:22 2008 From: peter at stuge.se (Peter Stuge) Date: Wed, 2 Jul 2008 00:18:22 +0200 Subject: [coreboot] flashrom: Remove Makefile pciutils check, and don't rm *~ in clean Message-ID: <20080701221822.18719.qmail@stuge.se> Patch attached. I have on two occasions in a short period of time run into systems where the pciutils check fails, while both packages are in fact installed. In one case, no compiler was installed. The other case has not been resolved yet, but the fact is that the check is not precise enough. It is also a waste of time to do the check on every single make invocation. The other hunk is about make clean. I think make clean should only remove files that were created by other targets in the Makefile. On principle I don't like make clean removing backups that someone may want to keep. (I haven't gotten bit by this yet, but I would be upset if it should happen.) Hope you agree on these! :) //Peter -------------- next part -------------- A non-text attachment was scrubbed... Name: fr.Makefile.pciutils.tildes.patch Type: text/x-diff Size: 1391 bytes Desc: not available URL: From mylesgw at gmail.com Wed Jul 2 00:36:29 2008 From: mylesgw at gmail.com (Myles Watson) Date: Tue, 1 Jul 2008 16:36:29 -0600 Subject: [coreboot] help with win-xp and legacybios/coreboot In-Reply-To: <20080628174539.GB11061@morn.localdomain> References: <20080628174539.GB11061@morn.localdomain> Message-ID: <2831fecf0807011536t16304457q9041f0d5b8461d28@mail.gmail.com> On Sat, Jun 28, 2008 at 11:45 AM, Kevin O'Connor wrote: > Hi, > > I have successfully installed and booted win-xp with coreboot-v2 and > legacybios under qemu. Unfortunately, when I try to install or boot > win-xp with coreboot-v2 and legacybios on my via epia-m the system > hangs. > > At this point, I don't know if the problem is related to coreboot and > its epia-m support, or if it is related to legacybios. I've confirmed > that the hang does not occur inside the bios. The last thing the > install reports before hanging is "Setup is starting Windows". > > It would be helpful if others could try installing / booting win-xp > on real hardware. If you can do this, please follow the directions > at: > > http://www.coreboot.org/pipermail/coreboot/2008-June/036108.html I must be missing something, because my boot fails with this message on my s2892: Class Code mismatch ROM 00010600, dev 00010601 copying non-VGA ROM Image from 0xfd100000 to 0xd0000, 0x5400 bytes entering emulator halt_sys: file /home/xd1000/try/buildrom/buildrom-devel/work/coreboot/svn/src/de vices/emulator/x86emu/ops.c, line 183 PCI: 05:01.0 init Devices initialized Writing IRQ routing tables to 0xdff0000...done. Wrote the mp table end at: 0dff0410 - 0dff0640 move mptable from 0x20 to 0xfffffc00, size 0xdff03e0 I'll look into it more tomorrow, but if you already know what it is that would be great. BTW: when I was trying to get XP to boot before, I was having timing problems. Have you tested the timer tick with factory BIOS and coreboot? Thanks, Myles From peter at stuge.se Wed Jul 2 01:20:25 2008 From: peter at stuge.se (Peter Stuge) Date: Wed, 2 Jul 2008 01:20:25 +0200 Subject: [coreboot] flashrom: probe_flash() cleanup and remove false positive unknown .. SPI chip Message-ID: <20080701232025.2680.qmail@stuge.se> Patch attached. //Peter -------------- next part -------------- A non-text attachment was scrubbed... Name: fr.spi.nofalsepositives.patch Type: text/x-diff Size: 2296 bytes Desc: not available URL: From peter at stuge.se Wed Jul 2 01:37:11 2008 From: peter at stuge.se (Peter Stuge) Date: Wed, 2 Jul 2008 01:37:11 +0200 Subject: [coreboot] flashrom: Case insensitive matching of vendor:board strings in coreboot table Message-ID: <20080701233711.15539.qmail@stuge.se> Patch attached. Is strcasecmp() not kosher enough? //Peter -------------- next part -------------- A non-text attachment was scrubbed... Name: fr.nodashm.patch Type: text/x-diff Size: 1044 bytes Desc: not available URL: From stepan at coresystems.de Wed Jul 2 02:04:30 2008 From: stepan at coresystems.de (Stefan Reinauer) Date: Wed, 02 Jul 2008 02:04:30 +0200 Subject: [coreboot] flashrom: Case insensitive matching of vendor:board strings in coreboot table In-Reply-To: <20080701233711.15539.qmail@stuge.se> References: <20080701233711.15539.qmail@stuge.se> Message-ID: <486AC60E.70805@coresystems.de> Peter Stuge wrote: > Patch attached. Is strcasecmp() not kosher enough? > > > //Peter > > flashrom: Case insensitive matching of vendor:board strings in coreboot table > > Needed at least for GIGABYTE:m57sli in coreboot to match gigabyte:m57sli in > flashrom. > > Signed-off-by: Peter Stuge > Acked-by: Stefan Reinauer Though: Does that only match the coreboot table, or also the manually specified strings? Asking because of your new message: > printf("\nUnknown vendor:board in coreboot table: %s:%s\n\n", vendor, part); -- coresystems GmbH ? Brahmsstr. 16 ? D-79104 Freiburg i. Br. Tel.: +49 761 7668825 ? Fax: +49 761 7664613 Email: info at coresystems.de ? http://www.coresystems.de/ Registergericht: Amtsgericht Freiburg ? HRB 7656 Gesch?ftsf?hrer: Stefan Reinauer ? Ust-IdNr.: DE245674866 From stepan at coresystems.de Wed Jul 2 02:08:18 2008 From: stepan at coresystems.de (Stefan Reinauer) Date: Wed, 02 Jul 2008 02:08:18 +0200 Subject: [coreboot] flashrom: Remove Makefile pciutils check, and don't rm *~ in clean In-Reply-To: <20080701221822.18719.qmail@stuge.se> References: <20080701221822.18719.qmail@stuge.se> Message-ID: <486AC6F2.8050509@coresystems.de> Peter Stuge wrote: > Patch attached. > > I have on two occasions in a short period of time run into systems > where the pciutils check fails, while both packages are in fact > installed. In one case, no compiler was installed. The other case > has not been resolved yet, but the fact is that the check is not > precise enough. > It is very precise. It does not check for a compiler, because having a compiler installed for compiling is obvious. Having those additional packages installed is less obvious. > It is also a waste of time to do the check on every single make > invocation. > I disagree with removing this. We started including it because we had so many people not reading the readme and complaining about failed compilation. NACK. -- coresystems GmbH ? Brahmsstr. 16 ? D-79104 Freiburg i. Br. Tel.: +49 761 7668825 ? Fax: +49 761 7664613 Email: info at coresystems.de ? http://www.coresystems.de/ Registergericht: Amtsgericht Freiburg ? HRB 7656 Gesch?ftsf?hrer: Stefan Reinauer ? Ust-IdNr.: DE245674866 From marekpenther at aol.com Tue Jul 1 22:30:25 2008 From: marekpenther at aol.com (Marek Artur Penther) Date: Tue, 1 Jul 2008 20:30:25 +0000 Subject: [coreboot] AMD-761 - System Controller - Software/BIOS Guide (Datasheet) Message-ID: <200807012030.27582.marekpenther@aol.com> -------------- next part -------------- A non-text attachment was scrubbed... Name: AMD-761 - System Controller - Software BIOS Guide.pdf Type: application/pdf Size: 2997197 bytes Desc: not available URL: From svn at coreboot.org Wed Jul 2 02:47:31 2008 From: svn at coreboot.org (svn at coreboot.org) Date: Wed, 2 Jul 2008 02:47:31 +0200 Subject: [coreboot] r3402 - trunk/util/flashrom Message-ID: Author: stuge Date: 2008-07-02 02:47:30 +0200 (Wed, 02 Jul 2008) New Revision: 3402 Modified: trunk/util/flashrom/board_enable.c Log: flashrom: Case insensitive matching of vendor:board strings in coreboot table Needed at least for GIGABYTE:m57sli in coreboot to match gigabyte:m57sli in flashrom. Signed-off-by: Peter Stuge Acked-by: Stefan Reinauer Modified: trunk/util/flashrom/board_enable.c =================================================================== --- trunk/util/flashrom/board_enable.c 2008-06-30 23:45:22 UTC (rev 3401) +++ trunk/util/flashrom/board_enable.c 2008-07-02 00:47:30 UTC (rev 3402) @@ -648,10 +648,10 @@ struct board_pciid_enable *partmatch = NULL; for (; board->name; board++) { - if (vendor && (!board->lb_vendor || strcmp(board->lb_vendor, vendor))) + if (vendor && (!board->lb_vendor || strcasecmp(board->lb_vendor, vendor))) continue; - if (!board->lb_part || strcmp(board->lb_part, part)) + if (!board->lb_part || strcasecmp(board->lb_part, part)) continue; if (!pci_dev_find(board->first_vendor, board->first_device)) @@ -678,8 +678,7 @@ if (partmatch) return partmatch; - printf("NOT FOUND %s:%s\n", vendor, part); - + printf("\nUnknown vendor:board in coreboot table: %s:%s\n\n", vendor, part); return NULL; } From svn at coreboot.org Wed Jul 2 02:59:29 2008 From: svn at coreboot.org (svn at coreboot.org) Date: Wed, 2 Jul 2008 02:59:29 +0200 Subject: [coreboot] r3403 - trunk/util/flashrom Message-ID: Author: stuge Date: 2008-07-02 02:59:29 +0200 (Wed, 02 Jul 2008) New Revision: 3403 Modified: trunk/util/flashrom/board_enable.c Log: flashrom: Unknown vendor:board message can be triggered by -m too Thanks to Stefan for pointing this one out. Signed-off-by: Peter Stuge Acked-by: Peter Stuge Modified: trunk/util/flashrom/board_enable.c =================================================================== --- trunk/util/flashrom/board_enable.c 2008-07-02 00:47:30 UTC (rev 3402) +++ trunk/util/flashrom/board_enable.c 2008-07-02 00:59:29 UTC (rev 3403) @@ -678,7 +678,7 @@ if (partmatch) return partmatch; - printf("\nUnknown vendor:board in coreboot table: %s:%s\n\n", vendor, part); + printf("\nUnknown vendor:board from coreboot table or -m option: %s:%s\n\n", vendor, part); return NULL; } From peter at stuge.se Wed Jul 2 02:59:59 2008 From: peter at stuge.se (Peter Stuge) Date: Wed, 2 Jul 2008 02:59:59 +0200 Subject: [coreboot] flashrom: Case insensitive matching of vendor:board strings in coreboot table In-Reply-To: <486AC60E.70805@coresystems.de> References: <20080701233711.15539.qmail@stuge.se> <486AC60E.70805@coresystems.de> Message-ID: <20080702005959.14845.qmail@stuge.se> On Wed, Jul 02, 2008 at 02:04:30AM +0200, Stefan Reinauer wrote: > Acked-by: Stefan Reinauer Thanks! r3402 > Though: Does that only match the coreboot table, or also the > manually specified strings? -m strings too, if -m is specified, they are used in this comparison instead of anything that was read from the coreboot table. > Asking because of your new message: > > printf("\nUnknown vendor:board in coreboot table: %s:%s\n\n", vendor, part); Thanks. Fixed in r3403. //Peter From c-d.hailfinger.devel.2006 at gmx.net Wed Jul 2 03:20:36 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Wed, 02 Jul 2008 03:20:36 +0200 Subject: [coreboot] flashrom: probe_flash() cleanup and remove false positive unknown .. SPI chip In-Reply-To: <20080701232025.2680.qmail@stuge.se> References: <20080701232025.2680.qmail@stuge.se> Message-ID: <486AD7E4.9050000@gmx.net> On 02.07.2008 01:20, Peter Stuge wrote: > flashrom: probe_flash() cleanup and remove false positive unknown .. SPI chip > > Restructure probe_flash() for some readability, and now only find an unknown > .. SPI chip if it is the first flash chip found in the system. > > This also removes the true positive match when there is more than one flash > chip and the 2nd or 3rd are unknown but I think that case is uncommon enough > to warrant this improvement for the common case. The uncommon case can still > use the -frc forced read. > > Signed-off-by: Peter Stuge > Hm. AFAICS this collides with the cleanups Stefan wanted to do. The evolution of flashrom is somewhat funny: 1. worked perfectly as long as only one flash chip was present, no false positives 2. multiple flash chip support was added, false generic positives for all SPI chips occured 3. cleanup/fix/bandaid for the code either improves functionality and reduces readability or the other way round 4. repeat step 3 As long as we don't perform per-bus/address probing (where appropriate), there will be no real fix for readability nor functionality. Stefan's cleanup queue looks very promising, though. Peter, can you hold this patch for a few more days until Stefan had time to send part 2 of his cleanup stuff? I believe that will simplify the code greatly, while fixing the "unknown chip" problem permanently. Regards, Carl-Daniel From peter at stuge.se Wed Jul 2 03:23:16 2008 From: peter at stuge.se (Peter Stuge) Date: Wed, 2 Jul 2008 03:23:16 +0200 Subject: [coreboot] flashrom: Remove Makefile pciutils check, and don't rm *~ in clean In-Reply-To: <486AC6F2.8050509@coresystems.de> References: <20080701221822.18719.qmail@stuge.se> <486AC6F2.8050509@coresystems.de> Message-ID: <20080702012316.1575.qmail@stuge.se> On Wed, Jul 02, 2008 at 02:08:18AM +0200, Stefan Reinauer wrote: > > but the fact is that the check is not precise enough. > > It is very precise. It does not check for a compiler, because > having a compiler installed for compiling is obvious. > Having those additional packages installed is less obvious. True, but because the compiler is so obvious it is easy to overlook. At the very least the message is not clear enough. It claims to check for this package but in fact it isn't the only requirements, and when the check says that the package wasn't found, that can be incorrect. I don't think we should have error messages that can be false like that. > > It is also a waste of time to do the check on every single make > > invocation. > > I disagree with removing this. We started including it because we > had so many people not reading the readme and complaining about > failed compilation. How do you feel about a configure script? Not autoconf but a simple sh script, much like xcompile, to check for compiler and library just once and then create the Makefile, possibly adding to LDFLAGS and CFLAGS from environment variables and/or --with-cflags --with-ldflags parameters in the process. //Peter From kevin at koconnor.net Wed Jul 2 04:02:19 2008 From: kevin at koconnor.net (Kevin O'Connor) Date: Tue, 1 Jul 2008 22:02:19 -0400 Subject: [coreboot] legacybios names In-Reply-To: <001a01c8dba1$99be6af0$0023040a@chimp> References: <009101c8c24b$0f8d66c0$0023040a@chimp> <20080701002024.GB17855@morn.localdomain> <001a01c8dba1$99be6af0$0023040a@chimp> Message-ID: <20080702020219.GA24090@morn.localdomain> On Tue, Jul 01, 2008 at 11:40:48AM -0600, Myles Watson wrote: > > > I think I'm going to use "SeaBIOS". > > That sounds fine. The only issue I see is that there's no real connection > to the ocean. It does allow for some fun logos, though. It's a play on words with "C bios", but I think SeaBIOS will reach out to a bigger audience. And - as several people have said - I think it opens up a lot of opportunities for cool logos. :-) > > Are you going to change the download URL soon? > Sure: http://linuxtogo.org/~kevin/SeaBIOS/ I've registered both seabios.org and seabios.com. I don't have any immediate plans for them - we'll see. -Kevin From peter at stuge.se Wed Jul 2 04:25:30 2008 From: peter at stuge.se (Peter Stuge) Date: Wed, 2 Jul 2008 04:25:30 +0200 Subject: [coreboot] flashrom: probe_flash() cleanup and remove false positive unknown .. SPI chip In-Reply-To: <486AD7E4.9050000@gmx.net> References: <20080701232025.2680.qmail@stuge.se> <486AD7E4.9050000@gmx.net> Message-ID: <20080702022530.17094.qmail@stuge.se> On Wed, Jul 02, 2008 at 03:20:36AM +0200, Carl-Daniel Hailfinger wrote: > The evolution of flashrom is somewhat funny: Too many cooks, a little bitrot and that's what you get. :) Anyway - optimize for the common case! That means degrading in uncommon cases, which I think is fine. > As long as we don't perform per-bus/address probing (where > appropriate), there will be no real fix for readability nor > functionality. -frc can allow reading at any time if the chip is the only problem. Multiple known chips will work reliably. Multiple chips with 2nd or 3rd unknown will not work - but this is a highly uncommon case so I do not really care. > Stefan's cleanup queue looks very promising, though. > Peter, can you hold this patch for a few more days until Stefan had > time to send part 2 of his cleanup stuff? I expect it to take much longer than a few days, and thus be after 1.0, which should go out the door any day now. > I believe that will simplify the code greatly, while fixing the > "unknown chip" problem permanently. I should go post a reply in the flash bus thread. I have some thoughts. //Peter From c-d.hailfinger.devel.2006 at gmx.net Wed Jul 2 04:40:34 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Wed, 02 Jul 2008 04:40:34 +0200 Subject: [coreboot] flashrom: Remove Makefile pciutils check, and don't rm *~ in clean In-Reply-To: <20080701221822.18719.qmail@stuge.se> References: <20080701221822.18719.qmail@stuge.se> Message-ID: <486AEAA2.6080709@gmx.net> On 02.07.2008 00:18, Peter Stuge wrote: > Patch attached. > > I have on two occasions in a short period of time run into systems > where the pciutils check fails, while both packages are in fact > installed. In one case, no compiler was installed. The other case > has not been resolved yet, but the fact is that the check is not > precise enough. > > It is also a waste of time to do the check on every single make > invocation. > Stefan alread commented on this. > The other hunk is about make clean. I think make clean should only > remove files that were created by other targets in the Makefile. > On principle I don't like make clean removing backups that someone > may want to keep. (I haven't gotten bit by this yet, but I would be > upset if it should happen.) > > Hope you agree on these! :) > Fully agreed on the non-removal of backup files. > flashrom: Remove Makefile pciutils check, and don't rm *~ in clean > > Signed-off-by: Peter Stuge The "don't rm *~ in clean" part is Acked-by: Carl-Daniel Hailfinger Regards, Carl-Daniel From c-d.hailfinger.devel.2006 at gmx.net Wed Jul 2 04:52:31 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Wed, 02 Jul 2008 04:52:31 +0200 Subject: [coreboot] flashrom: probe_flash() cleanup and remove false positive unknown .. SPI chip In-Reply-To: <20080702022530.17094.qmail@stuge.se> References: <20080701232025.2680.qmail@stuge.se> <486AD7E4.9050000@gmx.net> <20080702022530.17094.qmail@stuge.se> Message-ID: <486AED6F.2050204@gmx.net> On 02.07.2008 04:25, Peter Stuge wrote: > On Wed, Jul 02, 2008 at 03:20:36AM +0200, Carl-Daniel Hailfinger wrote: > >> The evolution of flashrom is somewhat funny: >> > > Too many cooks, a little bitrot and that's what you get. :) > we need to enstrengthen our common vision while concentrating on a customoer-focused attitude I'd really like to discuss future flashrom design once we got version 1.0 out. There are so many things flashrom could be made to do and everybody has ideas, yet we are missing a coherent design. The good thing about this is that the flashrom design certainly won't suffer from a lack of participation. > Anyway - optimize for the common case! That means degrading in > uncommon cases, which I think is fine. > One could argue that two flash chips are an uncommon case, but... point taken. >> As long as we don't perform per-bus/address probing (where >> appropriate), there will be no real fix for readability nor >> functionality. >> > > -frc can allow reading at any time if the chip is the only problem. > > Multiple known chips will work reliably. > > Multiple chips with 2nd or 3rd unknown will not work - but this is a > highly uncommon case so I do not really care. > The price we pay for this is even more special-case code. >> Stefan's cleanup queue looks very promising, though. >> Peter, can you hold this patch for a few more days until Stefan had >> time to send part 2 of his cleanup stuff? >> > > I expect it to take much longer than a few days, and thus be after > 1.0, which should go out the door any day now. > No offense intended, but with all this probe special-casing the code has become a lot less readable. I look forward to the per-bus probing because it will allow us to revert most of the probing code to the state directly after multiple flash chip support went in (short, easily readable code). >> I believe that will simplify the code greatly, while fixing the >> "unknown chip" problem permanently. >> > > I should go post a reply in the flash bus thread. I have some > thoughts. > Please do! Your input on the design is very much desired. Regards, Carl-Daniel -- http://www.hailfinger.org/ From peter at stuge.se Wed Jul 2 04:58:40 2008 From: peter at stuge.se (Peter Stuge) Date: Wed, 2 Jul 2008 04:58:40 +0200 Subject: [coreboot] flashrom: probe_flash() cleanup and remove false positive unknown .. SPI chip In-Reply-To: <486AD7E4.9050000@gmx.net> References: <20080701232025.2680.qmail@stuge.se> <486AD7E4.9050000@gmx.net> Message-ID: <20080702025840.10145.qmail@stuge.se> On Wed, Jul 02, 2008 at 03:20:36AM +0200, Carl-Daniel Hailfinger wrote: > 3. cleanup/fix/bandaid for the code either improves functionality > and reduces readability or the other way round I split my patch into two; one that only cleans up probe_flash(), and another (which is now very simple) that removes false positives (and true positives when unknown chip is 2nd or 3rd). //Peter -------------- next part -------------- A non-text attachment was scrubbed... Name: fr.probe.cleanup.patch Type: text/x-diff Size: 1640 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fr.onlyfirstunknown.patch Type: text/x-diff Size: 1381 bytes Desc: not available URL: From svn at coreboot.org Wed Jul 2 05:03:58 2008 From: svn at coreboot.org (svn at coreboot.org) Date: Wed, 2 Jul 2008 05:03:58 +0200 Subject: [coreboot] r3404 - trunk/util/flashrom Message-ID: Author: stuge Date: 2008-07-02 05:03:58 +0200 (Wed, 02 Jul 2008) New Revision: 3404 Modified: trunk/util/flashrom/Makefile Log: flashrom: Don't rm *~ in make clean, who knows what files that could be Signed-off-by: Peter Stuge Acked-by: Carl-Daniel Hailfinger Modified: trunk/util/flashrom/Makefile =================================================================== --- trunk/util/flashrom/Makefile 2008-07-02 00:59:29 UTC (rev 3403) +++ trunk/util/flashrom/Makefile 2008-07-02 03:03:58 UTC (rev 3404) @@ -46,7 +46,7 @@ $(CC) -c $(CFLAGS) $(SVNDEF) $(CPPFLAGS) $< -o $@ clean: - rm -f $(PROGRAM) *.o *~ + rm -f $(PROGRAM) *.o distclean: clean rm -f .dependencies From peter at stuge.se Wed Jul 2 05:05:00 2008 From: peter at stuge.se (Peter Stuge) Date: Wed, 2 Jul 2008 05:05:00 +0200 Subject: [coreboot] flashrom: Remove Makefile pciutils check, and don't rm *~ in clean In-Reply-To: <486AEAA2.6080709@gmx.net> References: <20080701221822.18719.qmail@stuge.se> <486AEAA2.6080709@gmx.net> Message-ID: <20080702030500.14860.qmail@stuge.se> On Wed, Jul 02, 2008 at 04:40:34AM +0200, Carl-Daniel Hailfinger wrote: > > It is also a waste of time to do the check on every single make > > invocation. > > Stefan alread commented on this. How do you feel about configure? > > flashrom: Remove Makefile pciutils check, and don't rm *~ in clean > > > > Signed-off-by: Peter Stuge > > The "don't rm *~ in clean" part is > Acked-by: Carl-Daniel Hailfinger Thanks! r3404 //Peter From peter at stuge.se Wed Jul 2 05:25:42 2008 From: peter at stuge.se (Peter Stuge) Date: Wed, 2 Jul 2008 05:25:42 +0200 Subject: [coreboot] For Help of Flashrom Usage In-Reply-To: References: Message-ID: <20080702032542.30381.qmail@stuge.se> Hello, On Tue, Jul 01, 2008 at 06:23:38PM +0800, HongGang.Ma at venture.com.sg wrote: > We are using flashrom to flash BIOS in Linux. But it can only > successfully read flash and save into file, can not write ROM file > into flash. > > Error information --- Segmentation fault. There is a known bug in flashrom. Sometimes it will incorrectly identify the ROM file that should be written as a coreboot ROM file, and in that case some data from the ROM file will be used incorrectly and typically cause flashrom to crash with a Segmentation fault. > Could you please provide us some comments or proposals on the problem? To confirm that you are also encountering the known bug, you can try running: flashrom -wv myBIOS.rom -V If you see a message similar to this: coreboot last image size (not ROM size) is 1234 bytes. Where 1234 is some nonsense number, it is indeed the known bug. You can disable the heuristic that is used to identify coreboot ROM files by applying the attached patch or changing layout.c manually. Please let us know if it works for you. Thank you for your interest in flashrom! :) //Peter -------------- next part -------------- A non-text attachment was scrubbed... Name: fr.idheur.kludge.patch Type: text/x-diff Size: 370 bytes Desc: not available URL: From svn at coreboot.org Wed Jul 2 05:08:44 2008 From: svn at coreboot.org (svn at coreboot.org) Date: Wed, 2 Jul 2008 05:08:44 +0200 Subject: [coreboot] r3405 - trunk/util/flashrom Message-ID: Author: stuge Date: 2008-07-02 05:07:46 +0200 (Wed, 02 Jul 2008) New Revision: 3405 Modified: trunk/util/flashrom/flashchips.c Log: flashrom: Update to TEST_OK for Winbond W39V040FA PROBE READ Thanks to Jake for the test report! Signed-off-by: Peter Stuge Acked-by: Peter Stuge Modified: trunk/util/flashrom/flashchips.c =================================================================== --- trunk/util/flashrom/flashchips.c 2008-07-02 03:03:58 UTC (rev 3404) +++ trunk/util/flashrom/flashchips.c 2008-07-02 03:07:46 UTC (rev 3405) @@ -130,7 +130,7 @@ {"Winbond", "W29EE011", WINBOND_ID, W_29C011, 128, 128, TEST_OK_PREW, probe_w29ee011, erase_chip_jedec, write_jedec}, {"Winbond", "W39V040A", WINBOND_ID, W_39V040A, 512, 64*1024, TEST_UNTESTED, probe_jedec, erase_chip_jedec, write_39sf020}, {"Winbond", "W39V040B", WINBOND_ID, W_39V040B, 512, 64*1024, TEST_OK_PREW, probe_jedec, erase_chip_jedec, write_39sf020}, - {"Winbond", "W39V040FA", WINBOND_ID, W_39V040FA, 512, 64*1024, TEST_UNTESTED, probe_jedec, erase_chip_jedec, write_39sf020}, + {"Winbond", "W39V040FA", WINBOND_ID, W_39V040FA, 512, 64*1024, TEST_OK_PR, probe_jedec, erase_chip_jedec, write_39sf020}, {"Winbond", "W39V080A", WINBOND_ID, W_39V080A, 1024, 64*1024, TEST_OK_PREW, probe_jedec, erase_chip_jedec, write_39sf020}, {"Winbond", "W49F002U", WINBOND_ID, W_49F002U, 256, 128, TEST_OK_PREW, probe_jedec, erase_chip_jedec, write_49f002}, {"Winbond", "W49V002A", WINBOND_ID, W_49V002A, 256, 128, TEST_UNTESTED, probe_jedec, erase_chip_jedec, write_49f002}, From peter at stuge.se Wed Jul 2 05:37:19 2008 From: peter at stuge.se (Peter Stuge) Date: Wed, 2 Jul 2008 05:37:19 +0200 Subject: [coreboot] flashrom: Remove Makefile pciutils check, and don't rm *~ in clean In-Reply-To: <20080702030500.14860.qmail@stuge.se> References: <20080701221822.18719.qmail@stuge.se> <486AEAA2.6080709@gmx.net> <20080702030500.14860.qmail@stuge.se> Message-ID: <20080702033719.6503.qmail@stuge.se> On Wed, Jul 02, 2008 at 05:05:00AM +0200, Peter Stuge wrote: > > > flashrom: Remove Makefile pciutils check, and don't rm *~ in clean > > > > > > Signed-off-by: Peter Stuge > > > > The "don't rm *~ in clean" part is > > Acked-by: Carl-Daniel Hailfinger > > Thanks! r3404 Correction, 3405. From peter at stuge.se Wed Jul 2 05:38:28 2008 From: peter at stuge.se (Peter Stuge) Date: Wed, 2 Jul 2008 05:38:28 +0200 Subject: [coreboot] flashrom: Remove Makefile pciutils check, and don't rm *~ in clean In-Reply-To: <20080702033719.6503.qmail@stuge.se> References: <20080701221822.18719.qmail@stuge.se> <486AEAA2.6080709@gmx.net> <20080702030500.14860.qmail@stuge.se> <20080702033719.6503.qmail@stuge.se> Message-ID: <20080702033828.7377.qmail@stuge.se> On Wed, Jul 02, 2008 at 05:37:19AM +0200, Peter Stuge wrote: > > Thanks! r3404 > > Correction, 3405. No, 3404 was right. Sorry for the noise. //Peter From mhghot at hotmail.com Wed Jul 2 08:42:28 2008 From: mhghot at hotmail.com (MHG) Date: Wed, 2 Jul 2008 14:42:28 +0800 Subject: [coreboot] For Help of Flashrom Usage In-Reply-To: <20080702032542.30381.qmail@stuge.se> References: <20080702032542.30381.qmail@stuge.se> Message-ID: Hi Peter, Thank you very much. The problem is solved after I changed layout.c according to your patch file. Thanks again. Best regards, Eric > Date: Wed, 2 Jul 2008 05:25:42 +0200> From: peter at stuge.se> To: coreboot at coreboot.org> Subject: Re: [coreboot] For Help of Flashrom Usage> > Hello,> > On Tue, Jul 01, 2008 at 06:23:38PM +0800, HongGang.Ma at venture.com.sg wrote:> > We are using flashrom to flash BIOS in Linux. But it can only> > successfully read flash and save into file, can not write ROM file> > into flash.> > > > Error information --- Segmentation fault.> > There is a known bug in flashrom. Sometimes it will incorrectly> identify the ROM file that should be written as a coreboot ROM file,> and in that case some data from the ROM file will be used incorrectly> and typically cause flashrom to crash with a Segmentation fault.> > > > Could you please provide us some comments or proposals on the problem?> > To confirm that you are also encountering the known bug, you can try> running: flashrom -wv myBIOS.rom -V> > If you see a message similar to this:> > coreboot last image size (not ROM size) is 1234 bytes.> > Where 1234 is some nonsense number, it is indeed the known bug.> > > You can disable the heuristic that is used to identify coreboot ROM> files by applying the attached patch or changing layout.c manually.> Please let us know if it works for you.> > > Thank you for your interest in flashrom! :)> > > //Peter _________________________________________________________________ MSN ???????????????????? http://cn.msn.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From svn at coreboot.org Wed Jul 2 11:41:00 2008 From: svn at coreboot.org (coreboot) Date: Wed, 02 Jul 2008 09:41:00 -0000 Subject: [coreboot] #80: serial console in grub2 works In-Reply-To: <043.299c51cc9688868e047901396ec61592@coreboot.org> References: <043.299c51cc9688868e047901396ec61592@coreboot.org> Message-ID: <052.a35b26a64527e925a67aaff4b41b8d89@coreboot.org> #80: serial console in grub2 works ----------------------------+----------------------------------------------- Reporter: oxygene | Owner: oxygene Type: enhancement | Status: closed Priority: major | Milestone: Port GRUB2 to coreboot Component: grub2 | Version: Resolution: fixed | Keywords: Dependencies: | Patchstatus: patch needs review ----------------------------+----------------------------------------------- Changes (by stepan): * status: reopened => closed * resolution: => fixed -- Ticket URL: coreboot From hansolofalcon at worldnet.att.net Wed Jul 2 13:45:25 2008 From: hansolofalcon at worldnet.att.net (Gregg C Levine) Date: Wed, 2 Jul 2008 07:45:25 -0400 Subject: [coreboot] USB Debug support Message-ID: <01e001c8dc39$1ee3c7b0$6401a8c0@who8> Hello! Let me see if I understand the thread earlier on USB Debug support. A USB cable configured to connect two systems together, such as a laptop to receive files from a desktop is simply two USB-A cables wired to an appropriate logic array. This would (Or "should be". Either way) probably be the latest generation in USB Gadget hardware. Ideally a Linux system can use this to talk to an appropriately configured system, provided the target was built using the debug features turned on for the USB stack layer. While I have here hardware for trying out this idea, namely my Linux development station, I have not as yet chosen a target. -- Gregg C Levine hansolofalcon at worldnet.att.net "The Force will be with you always." Obi-Wan Kenobi ? From peter at stuge.se Wed Jul 2 14:27:48 2008 From: peter at stuge.se (Peter Stuge) Date: Wed, 2 Jul 2008 14:27:48 +0200 Subject: [coreboot] USB Debug support In-Reply-To: <01e001c8dc39$1ee3c7b0$6401a8c0@who8> References: <01e001c8dc39$1ee3c7b0$6401a8c0@who8> Message-ID: <20080702122748.3011.qmail@stuge.se> Hi, On Wed, Jul 02, 2008 at 07:45:25AM -0400, Gregg C Levine wrote: > A USB cable configured to connect two systems together, such as a > laptop to receive files from a desktop is simply two USB-A cables > wired to an appropriate logic array. This would (Or "should be". > Either way) probably be the latest generation in USB Gadget > hardware. Yes. But the logic "array" is quite complex, and implements several layers of protocol. Please look at chapters 5, 8 and 9 in the USB specification for a description of the protocol. > Ideally a Linux system can use this to talk to an appropriately > configured system, provided the target was built using the debug > features turned on for the USB stack layer. Not enough. These are the hardware requirements: * The target USB controller must be EHCI * The target USB controller must implement the optional Debug Port * The target board must have a USB connector for the physical port that supports Debug Port. It is always only one particular port. * The "cable" must implement the Debug Device functional specification. See links on http://coreboot.org/EHCI_Debug_Port > While I have here hardware for trying out this idea, namely my > Linux development station, I have not as yet chosen a target. You will also need the debug device. I suggest ordering the NET20DC product from semiconductorstore.com. //Peter From joe at settoplinux.org Wed Jul 2 14:08:59 2008 From: joe at settoplinux.org (Joseph Smith) Date: Wed, 2 Jul 2008 08:08:59 -0400 Subject: [coreboot] USB Debug support In-Reply-To: <01e001c8dc39$1ee3c7b0$6401a8c0@who8> References: <01e001c8dc39$1ee3c7b0$6401a8c0@who8> Message-ID: <2F85BB213CF54A5EAA157A125E4D7B6B@smitty2m> Thanks, > -----Original Message----- > From: coreboot-bounces at coreboot.org [mailto:coreboot-bounces at coreboot.org] > On Behalf Of Gregg C Levine > Sent: Wednesday, July 02, 2008 7:45 AM > To: Coreboot > Subject: [coreboot] USB Debug support > > Hello! > Let me see if I understand the thread earlier on USB Debug support. > > A USB cable configured to connect two systems together, such as a laptop > to > receive files from a desktop is simply two USB-A cables wired to an > appropriate logic array. Correct but the "appropriate logic array" are two USB device chips talking to each other so to speak. > This would (Or "should be". Either way) probably be > the latest generation in USB Gadget hardware. > > Ideally a Linux system can use this to talk to an appropriately configured > system, provided the target was built using the debug features turned on > for the USB stack layer. > Yes there is a kernel driver for this, it just needs to be enabled in the kernel. > While I have here hardware for trying out this idea, namely my Linux > development station, I have not as yet chosen a target. > You just have to make sure the EHCI USB device on the southbridge supports USB debugging and is enabled in the PCI config space. > In the next 6 months (projected timeframe) I will be working on a HOWTO build your own USB debug cable. I have much reading and studying to do first though. Hope that helps. Joseph Smith Set-Top-Linux www.settoplinux.org From peter at stuge.se Wed Jul 2 14:09:14 2008 From: peter at stuge.se (Peter Stuge) Date: Wed, 2 Jul 2008 14:09:14 +0200 Subject: [coreboot] For Help of Flashrom Usage In-Reply-To: References: <20080702032542.30381.qmail@stuge.se> Message-ID: <20080702120914.19988.qmail@stuge.se> Hi Eric, On Wed, Jul 02, 2008 at 02:42:28PM +0800, MHG wrote: > Thank you very much. > > The problem is solved after I changed layout.c according to your > patch file. Thank you for the report. We are working on a real fix for this bug. //Peter From svn at coreboot.org Wed Jul 2 15:33:10 2008 From: svn at coreboot.org (svn at coreboot.org) Date: Wed, 2 Jul 2008 15:33:10 +0200 Subject: [coreboot] r3406 - trunk/util/flashrom Message-ID: Author: stepan Date: 2008-07-02 15:33:09 +0200 (Wed, 02 Jul 2008) New Revision: 3406 Modified: trunk/util/flashrom/flashchips.c trunk/util/flashrom/w39v080fa.c Log: set w39v080fa to fully supported. I'm am flashing this chip several times a day. Also enable unlocking which is only needed when running coreboot, that slipped in the original commit and through the original review ;-) So it must be trivial enough. Signed-off-by: Stefan Reinauer Acked-by: Stefan Reinauer Modified: trunk/util/flashrom/flashchips.c =================================================================== --- trunk/util/flashrom/flashchips.c 2008-07-02 03:07:46 UTC (rev 3405) +++ trunk/util/flashrom/flashchips.c 2008-07-02 13:33:09 UTC (rev 3406) @@ -3,7 +3,7 @@ * * Copyright (C) 2000 Silicon Integrated System Corporation * Copyright (C) 2004 Tyan Corp - * Copyright (C) 2005-2007 coresystems GmbH + * Copyright (C) 2005-2008 coresystems GmbH * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -135,7 +135,7 @@ {"Winbond", "W49F002U", WINBOND_ID, W_49F002U, 256, 128, TEST_OK_PREW, probe_jedec, erase_chip_jedec, write_49f002}, {"Winbond", "W49V002A", WINBOND_ID, W_49V002A, 256, 128, TEST_UNTESTED, probe_jedec, erase_chip_jedec, write_49f002}, {"Winbond", "W49V002FA", WINBOND_ID, W_49V002FA, 256, 128, TEST_UNTESTED, probe_jedec, erase_chip_jedec, write_49f002}, - {"Winbond", "W39V080FA", WINBOND_ID, W_39V080FA, 1024, 64*1024, TEST_OK_PR, probe_winbond_fwhub, erase_winbond_fwhub, write_winbond_fwhub}, + {"Winbond", "W39V080FA", WINBOND_ID, W_39V080FA, 1024, 64*1024, TEST_OK_PREW, probe_winbond_fwhub, erase_winbond_fwhub, write_winbond_fwhub}, {"Winbond", "W39V080FA (dual mode)",WINBOND_ID, W_39V080FA_DM, 512, 64*1024, TEST_UNTESTED, probe_winbond_fwhub, erase_winbond_fwhub, write_winbond_fwhub}, {"EON", "unknown EON SPI chip", EON_ID_NOPREFIX,GENERIC_DEVICE_ID, 0, 256, TEST_UNTESTED, probe_spi_rdid, NULL, NULL}, Modified: trunk/util/flashrom/w39v080fa.c =================================================================== --- trunk/util/flashrom/w39v080fa.c 2008-07-02 03:07:46 UTC (rev 3405) +++ trunk/util/flashrom/w39v080fa.c 2008-07-02 13:33:09 UTC (rev 3406) @@ -168,6 +168,8 @@ int i, total_size = flash->total_size * 1024; volatile uint8_t *bios = flash->virtual_memory; + unlock_winbond_fwhub(flash); + printf("Erasing: "); for (i = 0; i < total_size; i += flash->page_size) From peter at stuge.se Wed Jul 2 15:51:29 2008 From: peter at stuge.se (Peter Stuge) Date: Wed, 2 Jul 2008 15:51:29 +0200 Subject: [coreboot] r3406 - trunk/util/flashrom Message-ID: <20080702135129.15076.qmail@stuge.se> On Wed, Jul 02, 2008 at 03:33:10PM +0200, svn at coreboot.org wrote: > Also enable unlocking Great! However, I would like to remove the call to erase_winbond_fwhub() in write_winbond_fwhub() - this driver and maybe one or two others do this, and it doesn't seem right. Convenient, sure, but not right. Better make -Ewv work then, and apply the swapopts patch for -ewv. :) //Peter From stepan at coresystems.de Wed Jul 2 16:24:36 2008 From: stepan at coresystems.de (Stefan Reinauer) Date: Wed, 02 Jul 2008 16:24:36 +0200 Subject: [coreboot] r3406 - trunk/util/flashrom In-Reply-To: <20080702135129.15076.qmail@stuge.se> References: <20080702135129.15076.qmail@stuge.se> Message-ID: <486B8FA4.3000201@coresystems.de> Peter Stuge wrote: > On Wed, Jul 02, 2008 at 03:33:10PM +0200, svn at coreboot.org wrote: > >> Also enable unlocking >> > > Great! > > However, I would like to remove the call to erase_winbond_fwhub() in > write_winbond_fwhub() - this driver and maybe one or two others do > this, and it doesn't seem right. Convenient, sure, but not right. > > I don't get your point, sorry. > Better make -Ewv work then, and apply the swapopts patch for -ewv. :) > and -ezytgrl ! -- coresystems GmbH ? Brahmsstr. 16 ? D-79104 Freiburg i. Br. Tel.: +49 761 7668825 ? Fax: +49 761 7664613 Email: info at coresystems.de ? http://www.coresystems.de/ Registergericht: Amtsgericht Freiburg ? HRB 7656 Gesch?ftsf?hrer: Stefan Reinauer ? Ust-IdNr.: DE245674866 From peter at stuge.se Wed Jul 2 17:30:22 2008 From: peter at stuge.se (Peter Stuge) Date: Wed, 2 Jul 2008 17:30:22 +0200 Subject: [coreboot] r3406 - trunk/util/flashrom In-Reply-To: <486B8FA4.3000201@coresystems.de> References: <20080702135129.15076.qmail@stuge.se> <486B8FA4.3000201@coresystems.de> Message-ID: <20080702153022.5533.qmail@stuge.se> On Wed, Jul 02, 2008 at 04:24:36PM +0200, Stefan Reinauer wrote: > > However, I would like to remove the call to erase_winbond_fwhub() in > > write_winbond_fwhub() - this driver and maybe one or two others do > > this, and it doesn't seem right. Convenient, sure, but not right. > > I don't get your point, sorry. On looking closer, all drivers do this. Erase before write. I don't think that is right? I would like that behavior only when explicitly saying both erase and write. Otherwise, the layout stuff will be erasing and rewriting data that is not actually part of the selected region in the layout. > > Better make -Ewv work then, and apply the swapopts patch for -ewv. :) > > and -ezytgrl ! Hm? :) I have been contemplating adding -T to run a full test cycle on a chip, actually. Automated testing is always nice. Maybe require -Tf to actually do anything? //Peter From svn at coreboot.org Wed Jul 2 18:12:30 2008 From: svn at coreboot.org (coreboot) Date: Wed, 02 Jul 2008 16:12:30 -0000 Subject: [coreboot] #97: Clean up probe_flash() Message-ID: <041.f25f9800bdd6388c3aa5fba46d97b008@coreboot.org> #97: Clean up probe_flash() ----------------------------------+----------------------------------------- Reporter: stuge | Owner: somebody Type: enhancement | Status: new Priority: major | Milestone: flashrom v1.0 Component: flashrom | Version: v2 Keywords: probe readability | Dependencies: Patchstatus: patch needs review | ----------------------------------+----------------------------------------- Restructure for better readability and extensibility. -- Ticket URL: coreboot From stepan at coresystems.de Wed Jul 2 18:14:39 2008 From: stepan at coresystems.de (Stefan Reinauer) Date: Wed, 02 Jul 2008 18:14:39 +0200 Subject: [coreboot] r3406 - trunk/util/flashrom In-Reply-To: <20080702153022.5533.qmail@stuge.se> References: <20080702135129.15076.qmail@stuge.se> <486B8FA4.3000201@coresystems.de> <20080702153022.5533.qmail@stuge.se> Message-ID: <486BA96F.5040302@coresystems.de> Peter Stuge wrote: > On looking closer, all drivers do this. Erase before write. I don't > think that is right? > > I would like that behavior only when explicitly saying both erase and > write. Otherwise, the layout stuff will be erasing and rewriting data > that is not actually part of the selected region in the layout. > I think a write of a given block should always automatically erase that very block first, but not more. There should not be a situation where the user has to know that she can only write the flash after she set all the bits to 1 by erasing it. That's hardware knowledge that the tool must have, not the user. (Otherwise she would use dd for the task) But I agree the way we do deleting + writing is ugly. In /dev/bios my data structure for the flash chips had an array of blocks for each chip, so /dev/bios would see if the block at a given address is 4, 8, 112K or whether it could write the whole chip with a granularity of 256 bytes. >>> Better make -Ewv work then, and apply the swapopts patch for -ewv. :) >>> >> and -ezytgrl ! >> > > Hm? :) > That's what I thought, too, when I read that line. What's Ewv, ewv and why is swapopts involved in automatically erasing flash chips? > I have been contemplating adding -T to run a full test cycle on a > chip, actually. Automated testing is always nice. Maybe require -Tf > to actually do anything? > Something that prints out TEST_OK_PREW or the human understandable version of that in the end? I love this idea. -T should print a big warning "You are going to destroy the data on this chip if you run the command again with -f" Stefan -- coresystems GmbH ? Brahmsstr. 16 ? D-79104 Freiburg i. Br. Tel.: +49 761 7668825 ? Fax: +49 761 7664613 Email: info at coresystems.de ? http://www.coresystems.de/ Registergericht: Amtsgericht Freiburg ? HRB 7656 Gesch?ftsf?hrer: Stefan Reinauer ? Ust-IdNr.: DE245674866 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 249 bytes Desc: OpenPGP digital signature URL: From svn at coreboot.org Wed Jul 2 18:16:12 2008 From: svn at coreboot.org (coreboot) Date: Wed, 02 Jul 2008 16:16:12 -0000 Subject: [coreboot] #98: Eliminate false positive "unknown .. SPI chip" matches Message-ID: <041.f5e0f851af475dd9ed354e9f68f1a10a@coreboot.org> #98: Eliminate false positive "unknown .. SPI chip" matches ----------------------------------+----------------------------------------- Reporter: stuge | Owner: somebody Type: defect | Status: new Priority: major | Milestone: flashrom v1.0 Component: flashrom | Version: Keywords: spi probe | Dependencies: #97 Patchstatus: patch needs review | ----------------------------------+----------------------------------------- -- Ticket URL: coreboot From svn at coreboot.org Wed Jul 2 18:18:34 2008 From: svn at coreboot.org (coreboot) Date: Wed, 02 Jul 2008 16:18:34 -0000 Subject: [coreboot] #99: Clean up it87xx_probe_spi_flash() for better readability Message-ID: <041.847e6dc5be1bb0643933288f325a20d8@coreboot.org> #99: Clean up it87xx_probe_spi_flash() for better readability ----------------------------------+----------------------------------------- Reporter: stuge | Owner: somebody Type: enhancement | Status: new Priority: minor | Milestone: flashrom v1.0 Component: flashrom | Version: Keywords: | Dependencies: spi probe readability Patchstatus: patch needs review | ----------------------------------+----------------------------------------- -- Ticket URL: coreboot From svn at coreboot.org Wed Jul 2 18:19:00 2008 From: svn at coreboot.org (coreboot) Date: Wed, 02 Jul 2008 16:19:00 -0000 Subject: [coreboot] #97: Clean up probe_flash() In-Reply-To: <041.f25f9800bdd6388c3aa5fba46d97b008@coreboot.org> References: <041.f25f9800bdd6388c3aa5fba46d97b008@coreboot.org> Message-ID: <050.2e0da778bbc88fdb684d0df14233a981@coreboot.org> #97: Clean up probe_flash() ----------------------------+----------------------------------------------- Reporter: stuge | Owner: stuge Type: enhancement | Status: new Priority: major | Milestone: flashrom v1.0 Component: flashrom | Version: v2 Resolution: | Keywords: probe readability Dependencies: | Patchstatus: patch is ready to be committed ----------------------------+----------------------------------------------- Changes (by stepan): * owner: somebody => stuge * patchstatus: patch needs review => patch is ready to be committed Comment: Acked-by: Stefan Reinauer -- Ticket URL: coreboot From svn at coreboot.org Wed Jul 2 18:19:37 2008 From: svn at coreboot.org (coreboot) Date: Wed, 02 Jul 2008 16:19:37 -0000 Subject: [coreboot] #100: flashrom: Change start/end -s and -e to -S and -E, and change erase -E to -e. Message-ID: <041.8aa562bc051ad7561e8886785fe385eb@coreboot.org> #100: flashrom: Change start/end -s and -e to -S and -E, and change erase -E to -e. -------------------------------------+-------------------------------------- Reporter: stuge | Owner: somebody Type: enhancement | Status: new Priority: major | Milestone: flashrom v1.0 Component: flashrom | Version: Keywords: usability cli options | Dependencies: Patchstatus: patch needs review | -------------------------------------+-------------------------------------- -- Ticket URL: coreboot From svn at coreboot.org Wed Jul 2 18:25:31 2008 From: svn at coreboot.org (coreboot) Date: Wed, 02 Jul 2008 16:25:31 -0000 Subject: [coreboot] #101: flashrom: Remove pciutils check from Makefile Message-ID: <041.17fb32e3a5c300f5053da0fa3e652820@coreboot.org> #101: flashrom: Remove pciutils check from Makefile ---------------------------------------------+------------------------------ Reporter: stuge | Owner: somebody Type: defect | Status: new Priority: major | Milestone: flashrom v1.0 Component: flashrom | Version: Keywords: pciutils libpci build ldflags | Dependencies: Patchstatus: patch needs review | ---------------------------------------------+------------------------------ The check belongs in a configure script or similar, the check also claims that packages can not be found for any build error, which is not good enough. Has confused more than one user already. -- Ticket URL: coreboot From corey.osgood at gmail.com Wed Jul 2 18:26:45 2008 From: corey.osgood at gmail.com (Corey Osgood) Date: Wed, 2 Jul 2008 12:26:45 -0400 Subject: [coreboot] The coreboot hare In-Reply-To: <8ed609dab94d10f3f997072a95bffb6e@kernel.crashing.org> References: <20080701034454.24914.qmail@stuge.se> <486A0635.4090108@gmx.net> <13426df10807010618r6cbef404o7c9a914f4d02a309@mail.gmail.com> <8ed609dab94d10f3f997072a95bffb6e@kernel.crashing.org> Message-ID: I agree to veto the vote. Hare's good enough for me. -Corey On Tue, Jul 1, 2008 at 11:06 AM, Segher Boessenkool wrote: >> Let's get a decision on this. Do we vote? > > Sure, why not. Or we can just agree to agree, veto the veto, > so we don't have to vote for a vote? :-) > > > Segher > > > -- > coreboot mailing list > coreboot at coreboot.org > http://www.coreboot.org/mailman/listinfo/coreboot > From svn at coreboot.org Wed Jul 2 18:29:07 2008 From: svn at coreboot.org (coreboot) Date: Wed, 02 Jul 2008 16:29:07 -0000 Subject: [coreboot] #102: flashrom: coreboot ROM image file identification heuristic is broken Message-ID: <041.d02ed69d3d641142e64c5b79feb8cb4e@coreboot.org> #102: flashrom: coreboot ROM image file identification heuristic is broken -----------------------------------+---------------------------------------- Reporter: stuge | Owner: somebody Type: defect | Status: new Priority: blocker | Milestone: flashrom v1.0 Component: flashrom | Version: Keywords: rom image heuristic | Dependencies: Patchstatus: patch needs work | -----------------------------------+---------------------------------------- Non-coreboot ROM images are incorrectly identified as coreboot images, and arbitrary data is used in flashrom code. The heuristic is far too simplistic, we need a proper signature in all coreboot images. The suggested fix is to add a LAR header to the ROM image, I like that too. When an image is incorrectly identified, junk data used by flashrom typically causes flashrom to segfault. -- Ticket URL: coreboot From peter at stuge.se Wed Jul 2 18:39:33 2008 From: peter at stuge.se (Peter Stuge) Date: Wed, 2 Jul 2008 18:39:33 +0200 Subject: [coreboot] r3406 - trunk/util/flashrom In-Reply-To: <486BA96F.5040302@coresystems.de> References: <20080702135129.15076.qmail@stuge.se> <486B8FA4.3000201@coresystems.de> <20080702153022.5533.qmail@stuge.se> <486BA96F.5040302@coresystems.de> Message-ID: <20080702163934.30348.qmail@stuge.se> On Wed, Jul 02, 2008 at 06:14:39PM +0200, Stefan Reinauer wrote: > >On looking closer, all drivers do this. Erase before write. I > >don't think that is right? > > I think a write of a given block should always automatically erase > that very block first, but not more. I disagree. > There should not be a situation where the user has to know that she > can only write the flash after she set all the bits to 1 by erasing > it. This stands in contrast with the layout and (current) -s/-e options. If I tell flashrom to only write to a six-byte area in the chip - I sure do not want the eraseblock to be erased. > That's hardware knowledge that the tool must have, not the user. I disagree. This is a major characteristic of flash technology and I don't think we should be hiding it. Look at the GALEP software for comparison. They have a check box for enabling/disabling automatic erase on chip program. Their software does not sport the same layout/-s/-e features as flashrom does, they only deal with full chip operations, yet IIRC they still have erase-before-write disabled by default. > (Otherwise she would use dd for the task) Not really true, because the write sequence is still annoying to do by hand. > But I agree the way we do deleting + writing is ugly. .. > granularity Not good enough I think. I do not want flashrom to ever erase flash cells that the user did not explicitly request. > >>>Better make -Ewv work then, and apply the swapopts patch for -ewv. :) > >>> > >>and -ezytgrl ! > > > >Hm? :) > > That's what I thought, too, when I read that line. What's Ewv, ewv > and why is swapopts involved in automatically erasing flash chips? -E currently does erase, -w write and -v verify. When running flashrom with -E, it will exit() after the erase is finished, and so -Ewv does not work. Because all flash drivers (incorrectly IMO) erase before write, -Ewv is not needed, but since I want to change that, I also have to let flashrom do -Ewv in one go. Swapopts is involved, because I would like to change -E into -e, to have lowercase options for all common commands. > >I have been contemplating adding -T to run a full test cycle > > Something that prints out TEST_OK_PREW or the human understandable > version of that in the end? I love this idea. Yeah. > -T should print a big warning "You are going to destroy the data on > this chip if you run the command again with -f" Yep, that's what I had in mind too. //Peter -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: From svn at coreboot.org Wed Jul 2 18:42:17 2008 From: svn at coreboot.org (coreboot) Date: Wed, 02 Jul 2008 16:42:17 -0000 Subject: [coreboot] #103: flashrom: Don't exit() after successful erase operation Message-ID: <041.d6f003223df3afe9c38d44f78d70243d@coreboot.org> #103: flashrom: Don't exit() after successful erase operation ---------------------------------+------------------------------------------ Reporter: stuge | Owner: somebody Type: defect | Status: new Priority: major | Milestone: flashrom v1.0 Component: flashrom | Version: Keywords: erase exit | Dependencies: Patchstatus: there is no patch | ---------------------------------+------------------------------------------ -- Ticket URL: coreboot From stepan at coresystems.de Wed Jul 2 18:43:19 2008 From: stepan at coresystems.de (Stefan Reinauer) Date: Wed, 02 Jul 2008 18:43:19 +0200 Subject: [coreboot] r3406 - trunk/util/flashrom In-Reply-To: <20080702163934.30348.qmail@stuge.se> References: <20080702135129.15076.qmail@stuge.se> <486B8FA4.3000201@coresystems.de> <20080702153022.5533.qmail@stuge.se> <486BA96F.5040302@coresystems.de> <20080702163934.30348.qmail@stuge.se> Message-ID: <486BB027.4000009@coresystems.de> Peter Stuge wrote: >> There should not be a situation where the user has to know that she >> can only write the flash after she set all the bits to 1 by erasing >> it. >> > > This stands in contrast with the layout and (current) -s/-e options. > Not at all. > If I tell flashrom to only write to a six-byte area in the chip - I > sure do not want the eraseblock to be erased. > If necessary for those 6 byte to write, yes, that is exactly what you want. >> That's hardware knowledge that the tool must have, not the user. >> > > I disagree. This is a major characteristic of flash technology and I > don't think we should be hiding it. > > Look at the GALEP software for comparison. Yes, everyone knows the galep software is crap for exactly stuff like that. The new version does not allow autoerase anymore. -- coresystems GmbH ? Brahmsstr. 16 ? D-79104 Freiburg i. Br. Tel.: +49 761 7668825 ? Fax: +49 761 7664613 Email: info at coresystems.de ? http://www.coresystems.de/ Registergericht: Amtsgericht Freiburg ? HRB 7656 Gesch?ftsf?hrer: Stefan Reinauer ? Ust-IdNr.: DE245674866 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 249 bytes Desc: OpenPGP digital signature URL: From svn at coreboot.org Wed Jul 2 18:44:40 2008 From: svn at coreboot.org (coreboot) Date: Wed, 02 Jul 2008 16:44:40 -0000 Subject: [coreboot] #104: flashrom: Change flash drivers to never erase data before writing Message-ID: <041.613243c7ca7145feb67f1cb5420bf35c@coreboot.org> #104: flashrom: Change flash drivers to never erase data before writing ---------------------------------+------------------------------------------ Reporter: stuge | Owner: somebody Type: defect | Status: new Priority: major | Milestone: flashrom v1.0 Component: flashrom | Version: Keywords: erase write | Dependencies: #103 Patchstatus: there is no patch | ---------------------------------+------------------------------------------ The user should be responsible for ensuring that the flash chip has been erased where new data should be written. At the moment, flashrom will erase at least one full page and then rewrite it, when the user asks to only write a few bytes using -l/-i/-s/-e. -- Ticket URL: coreboot From svn at coreboot.org Wed Jul 2 18:44:50 2008 From: svn at coreboot.org (coreboot) Date: Wed, 02 Jul 2008 16:44:50 -0000 Subject: [coreboot] #101: flashrom: Remove pciutils check from Makefile In-Reply-To: <041.17fb32e3a5c300f5053da0fa3e652820@coreboot.org> References: <041.17fb32e3a5c300f5053da0fa3e652820@coreboot.org> Message-ID: <050.48ca9fbe809eb977b2e71d912d9f9b3b@coreboot.org> #101: flashrom: Remove pciutils check from Makefile -------------------------+-------------------------------------------------- Reporter: stuge | Owner: somebody Type: defect | Status: new Priority: trivial | Milestone: flashrom v1.0 Component: flashrom | Version: Resolution: | Keywords: pciutils libpci build ldflags Dependencies: | Patchstatus: patch needs review -------------------------+-------------------------------------------------- Changes (by stepan): * priority: major => trivial Comment: How is an external script different from the script that is already there? Just suggest a script. But you're suggesting to cut bread with a fork here. -- Ticket URL: coreboot From peter at stuge.se Wed Jul 2 18:51:33 2008 From: peter at stuge.se (Peter Stuge) Date: Wed, 2 Jul 2008 18:51:33 +0200 Subject: [coreboot] r3406 - trunk/util/flashrom In-Reply-To: <486BB027.4000009@coresystems.de> References: <20080702135129.15076.qmail@stuge.se> <486B8FA4.3000201@coresystems.de> <20080702153022.5533.qmail@stuge.se> <486BA96F.5040302@coresystems.de> <20080702163934.30348.qmail@stuge.se> <486BB027.4000009@coresystems.de> Message-ID: <20080702165133.7635.qmail@stuge.se> On Wed, Jul 02, 2008 at 06:43:19PM +0200, Stefan Reinauer wrote: > >If I tell flashrom to only write to a six-byte area in the chip - I > >sure do not want the eraseblock to be erased. > > If necessary for those 6 byte to write, yes, that is exactly what > you want. No. I want an error if it is neccessary and I did not also ask for erase. There are at least two cases where this matters; Flash coreboot with ff:ff MAC for onboard, set it up to download a nifty flashrom-derivative payload that will reflash the MAC with something useful before shipping. This operation should not automatically erase and rewrite any data that was already in the chip. Add new files to v3 LAR in flash chip, this should also never erase and rewrite data that was in the chip. I think you could come with even more. :) Because the user has not requested erase, I think erasing is a critical bug. :\ > >Look at the GALEP software for comparison. > > Yes, everyone knows the galep software is crap for exactly stuff > like that. The new version does not allow autoerase anymore. Too bad, because it is a nifty feature. But can you imagine the customer response if they _forced_ autoerase (like flashrom) ? //Peter -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: From svn at coreboot.org Wed Jul 2 18:52:41 2008 From: svn at coreboot.org (coreboot) Date: Wed, 02 Jul 2008 16:52:41 -0000 Subject: [coreboot] #105: flashrom: add documentation files (ChangeLog etc) that need to be in the release Message-ID: <041.43c89429f4bc2b157cdb53f0a41b38c3@coreboot.org> #105: flashrom: add documentation files (ChangeLog etc) that need to be in the release ---------------------------------+------------------------------------------ Reporter: stuge | Owner: somebody Type: enhancement | Status: new Priority: blocker | Milestone: flashrom v1.0 Component: flashrom | Version: Keywords: documentation | Dependencies: Patchstatus: there is no patch | ---------------------------------+------------------------------------------ -- Ticket URL: coreboot From svn at coreboot.org Wed Jul 2 18:56:41 2008 From: svn at coreboot.org (coreboot) Date: Wed, 02 Jul 2008 16:56:41 -0000 Subject: [coreboot] #106: flashrom: Add -T to automatically test all flash chip operations Message-ID: <041.16204f2bdbfde4e3eac5ffa09962d8e9@coreboot.org> #106: flashrom: Add -T to automatically test all flash chip operations ---------------------------------+------------------------------------------ Reporter: stuge | Owner: somebody Type: enhancement | Status: new Priority: major | Milestone: flashrom v1.0 Component: flashrom | Version: Keywords: testing | Dependencies: Patchstatus: there is no patch | ---------------------------------+------------------------------------------ Maybe require -f to actually perform the test, since it will potentially fail to restore the flash chip to it's original state. -- Ticket URL: coreboot From svn at coreboot.org Wed Jul 2 18:57:43 2008 From: svn at coreboot.org (coreboot) Date: Wed, 02 Jul 2008 16:57:43 -0000 Subject: [coreboot] #107: flashrom: Display test status in -L chip listing Message-ID: <041.eea91e31685039e0026d8afdaa925b4c@coreboot.org> #107: flashrom: Display test status in -L chip listing ---------------------------------+------------------------------------------ Reporter: stuge | Owner: somebody Type: enhancement | Status: new Priority: minor | Milestone: flashrom v1.0 Component: flashrom | Version: Keywords: testing | Dependencies: Patchstatus: there is no patch | ---------------------------------+------------------------------------------ -- Ticket URL: coreboot From svn at coreboot.org Wed Jul 2 18:58:47 2008 From: svn at coreboot.org (coreboot) Date: Wed, 02 Jul 2008 16:58:47 -0000 Subject: [coreboot] #107: flashrom: Display test status in -L chip listing In-Reply-To: <041.eea91e31685039e0026d8afdaa925b4c@coreboot.org> References: <041.eea91e31685039e0026d8afdaa925b4c@coreboot.org> Message-ID: <050.1085079953a5d60b42f18a358c524003@coreboot.org> #107: flashrom: Display test status in -L chip listing ----------------------------+----------------------------------------------- Reporter: stuge | Owner: somebody Type: enhancement | Status: new Priority: minor | Milestone: flashrom v1.0 Component: flashrom | Version: Resolution: | Keywords: testing Dependencies: | Patchstatus: there is no patch ----------------------------+----------------------------------------------- Comment(by stuge): Can also include adding wiki-usable output. -- Ticket URL: coreboot From peter at stuge.se Wed Jul 2 19:00:01 2008 From: peter at stuge.se (Peter Stuge) Date: Wed, 2 Jul 2008 19:00:01 +0200 Subject: [coreboot] flashrom: Move options -s -e to -S -E and -E to -e. In-Reply-To: <481B9324.90509@gmx.net> References: <20080502181259.15991.qmail@stuge.se> <481B9324.90509@gmx.net> Message-ID: <20080702170001.15298.qmail@stuge.se> On Sat, May 03, 2008 at 12:18:12AM +0200, Carl-Daniel Hailfinger wrote: > Can we please change verify to -V and verbose to -v? That's the > mistake I still make after hundreds of invocations of flashrom. I disagree with this change. My motivation for swapopts is to keep the common tasks on lowercase options. //Peter From svn at coreboot.org Wed Jul 2 19:15:47 2008 From: svn at coreboot.org (svn at coreboot.org) Date: Wed, 2 Jul 2008 19:15:47 +0200 Subject: [coreboot] r3407 - trunk/util/flashrom Message-ID: Author: stuge Date: 2008-07-02 19:15:47 +0200 (Wed, 02 Jul 2008) New Revision: 3407 Modified: trunk/util/flashrom/flashrom.c Log: flashrom: probe_flash() cleanup for better code readability Signed-off-by: Peter Stuge Acked-by: Stefan Reinauer Modified: trunk/util/flashrom/flashrom.c =================================================================== --- trunk/util/flashrom/flashrom.c 2008-07-02 13:33:09 UTC (rev 3406) +++ trunk/util/flashrom/flashrom.c 2008-07-02 17:15:47 UTC (rev 3407) @@ -102,18 +102,15 @@ struct flashchip *probe_flash(struct flashchip *flash, int force) { volatile uint8_t *bios; - unsigned long flash_baseaddr, size; + unsigned long flash_baseaddr = 0, size; - while (flash->name != NULL) { - if (chip_to_probe && strcmp(flash->name, chip_to_probe) != 0) { - flash++; + for (; flash && flash->name; flash++) { + if (chip_to_probe && strcmp(flash->name, chip_to_probe) != 0) continue; - } printf_debug("Probing for %s %s, %d KB: ", flash->vendor, flash->name, flash->total_size); if (!flash->probe && !force) { printf_debug("failed! flashrom has no probe function for this flash chip.\n"); - flash++; continue; } @@ -150,18 +147,21 @@ } flash->virtual_memory = bios; - if (force || flash->probe(flash) == 1) { - printf("Found chip \"%s %s\" (%d KB) at physical address 0x%lx.\n", - flash->vendor, flash->name, flash->total_size, - flash_baseaddr); - return flash; - } + if (force) + break; + + if (flash->probe(flash) == 1) + break; + munmap((void *)bios, size); - - flash++; } - return NULL; + if (!flash || !flash->name) + return NULL; + + printf("Found chip \"%s %s\" (%d KB) at physical address 0x%lx.\n", + flash->vendor, flash->name, flash->total_size, flash_baseaddr); + return flash; } int verify_flash(struct flashchip *flash, uint8_t *buf) From svn at coreboot.org Wed Jul 2 19:16:31 2008 From: svn at coreboot.org (coreboot) Date: Wed, 02 Jul 2008 17:16:31 -0000 Subject: [coreboot] #97: Clean up probe_flash() In-Reply-To: <041.f25f9800bdd6388c3aa5fba46d97b008@coreboot.org> References: <041.f25f9800bdd6388c3aa5fba46d97b008@coreboot.org> Message-ID: <050.2d56a28c128093b8096e075122b14044@coreboot.org> #97: Clean up probe_flash() ----------------------------+----------------------------------------------- Reporter: stuge | Owner: stuge Type: enhancement | Status: closed Priority: major | Milestone: flashrom v1.0 Component: flashrom | Version: v2 Resolution: fixed | Keywords: probe readability Dependencies: | Patchstatus: patch has been committed ----------------------------+----------------------------------------------- Changes (by stuge): * status: new => closed * patchstatus: patch is ready to be committed => patch has been committed * resolution: => fixed Comment: r3407 -- Ticket URL: coreboot From svn at coreboot.org Wed Jul 2 19:20:47 2008 From: svn at coreboot.org (coreboot) Date: Wed, 02 Jul 2008 17:20:47 -0000 Subject: [coreboot] #101: flashrom: Remove pciutils check from Makefile In-Reply-To: <041.17fb32e3a5c300f5053da0fa3e652820@coreboot.org> References: <041.17fb32e3a5c300f5053da0fa3e652820@coreboot.org> Message-ID: <050.7d9a4145c1cb63619ae0c50522e107e3@coreboot.org> #101: flashrom: Remove pciutils check from Makefile -------------------------+-------------------------------------------------- Reporter: stuge | Owner: stuge Type: defect | Status: new Priority: trivial | Milestone: flashrom v1.0 Component: flashrom | Version: Resolution: | Keywords: pciutils libpci build ldflags Dependencies: | Patchstatus: patch needs work -------------------------+-------------------------------------------------- Changes (by stuge): * owner: somebody => stuge * patchstatus: patch needs review => patch needs work Comment: Fair enough, will work on patch. -- Ticket URL: coreboot From svn at coreboot.org Wed Jul 2 19:22:56 2008 From: svn at coreboot.org (coreboot) Date: Wed, 02 Jul 2008 17:22:56 -0000 Subject: [coreboot] #108: Add int 10 VESA video driver to libpayload Message-ID: <041.89236f385696b49b0a2fd553b4dd813f@coreboot.org> #108: Add int 10 VESA video driver to libpayload ---------------------------------+------------------------------------------ Reporter: stuge | Owner: somebody Type: enhancement | Status: new Priority: major | Milestone: Component: libpayload | Version: Keywords: video | Dependencies: Patchstatus: there is no patch | ---------------------------------+------------------------------------------ -- Ticket URL: coreboot From segher at kernel.crashing.org Wed Jul 2 20:00:31 2008 From: segher at kernel.crashing.org (Segher Boessenkool) Date: Wed, 2 Jul 2008 20:00:31 +0200 Subject: [coreboot] The coreboot hare In-Reply-To: References: <20080701034454.24914.qmail@stuge.se> <486A0635.4090108@gmx.net> <13426df10807010618r6cbef404o7c9a914f4d02a309@mail.gmail.com> <8ed609dab94d10f3f997072a95bffb6e@kernel.crashing.org> Message-ID: > I agree to veto the vote. Hare's good enough for me. I didn't say that! Segher From svn at coreboot.org Wed Jul 2 21:45:35 2008 From: svn at coreboot.org (svn at coreboot.org) Date: Wed, 2 Jul 2008 21:45:35 +0200 Subject: [coreboot] r210 - in buildrom-devel: . scripts/kconfig scripts/kconfig/lxdialog Message-ID: Author: uwe Date: 2008-07-02 21:45:34 +0200 (Wed, 02 Jul 2008) New Revision: 210 Added: buildrom-devel/scripts/kconfig/.gitignore buildrom-devel/scripts/kconfig/check.sh buildrom-devel/scripts/kconfig/gconf.c buildrom-devel/scripts/kconfig/gconf.glade buildrom-devel/scripts/kconfig/images.c buildrom-devel/scripts/kconfig/lxdialog/.gitignore buildrom-devel/scripts/kconfig/qconf.cc buildrom-devel/scripts/kconfig/qconf.h Removed: buildrom-devel/scripts/kconfig/lxdialog/Makefile buildrom-devel/scripts/kconfig/lxdialog/colors.h buildrom-devel/scripts/kconfig/lxdialog/lxdialog.c buildrom-devel/scripts/kconfig/lxdialog/msgbox.c buildrom-devel/scripts/kconfig/zconf.hash.c Modified: buildrom-devel/Makefile buildrom-devel/scripts/kconfig/Makefile buildrom-devel/scripts/kconfig/POTFILES.in buildrom-devel/scripts/kconfig/conf.c buildrom-devel/scripts/kconfig/confdata.c buildrom-devel/scripts/kconfig/expr.c buildrom-devel/scripts/kconfig/expr.h buildrom-devel/scripts/kconfig/kxgettext.c buildrom-devel/scripts/kconfig/lex.zconf.c_shipped buildrom-devel/scripts/kconfig/lkc.h buildrom-devel/scripts/kconfig/lkc_proto.h buildrom-devel/scripts/kconfig/lxdialog/BIG.FAT.WARNING buildrom-devel/scripts/kconfig/lxdialog/check-lxdialog.sh buildrom-devel/scripts/kconfig/lxdialog/checklist.c buildrom-devel/scripts/kconfig/lxdialog/dialog.h buildrom-devel/scripts/kconfig/lxdialog/inputbox.c buildrom-devel/scripts/kconfig/lxdialog/menubox.c buildrom-devel/scripts/kconfig/lxdialog/textbox.c buildrom-devel/scripts/kconfig/lxdialog/util.c buildrom-devel/scripts/kconfig/lxdialog/yesno.c buildrom-devel/scripts/kconfig/mconf.c buildrom-devel/scripts/kconfig/menu.c buildrom-devel/scripts/kconfig/symbol.c buildrom-devel/scripts/kconfig/util.c buildrom-devel/scripts/kconfig/zconf.gperf buildrom-devel/scripts/kconfig/zconf.hash.c_shipped buildrom-devel/scripts/kconfig/zconf.l buildrom-devel/scripts/kconfig/zconf.tab.c_shipped buildrom-devel/scripts/kconfig/zconf.y Log: buildrom: Update kconfig to a much more recent version. Signed-off-by: Uwe Hermann Acked-by: Myles Watson Modified: buildrom-devel/Makefile =================================================================== --- buildrom-devel/Makefile 2008-07-01 21:13:46 UTC (rev 209) +++ buildrom-devel/Makefile 2008-07-02 19:45:34 UTC (rev 210) @@ -1,3 +1,29 @@ +export src := $(shell pwd) +export srctree := $(src) +export srck := $(src)/scripts/kconfig +export obj := $(src)/build +export objk := $(src)/build/scripts/kconfig + +export KERNELVERSION := 0.1.0 +export KCONFIG_AUTOHEADER := $(obj)/config.h +export KCONFIG_AUTOCONFIG := $(obj)/auto.conf + +CONFIG_SHELL := sh +KBUILD_DEFCONFIG := scripts/defconfig +UNAME_RELEASE := $(shell uname -r) +MAKEFLAGS += -rR --no-print-directory + +# Make is silent per default, but 'make V=1' will show all compiler calls. +ifneq ($(V),1) +Q := @ +endif + +HOSTCC = gcc +HOSTCXX = g++ +HOSTCFLAGS := -I$(srck) -I$(objk) +HOSTCXXFLAGS := -I$(srck) -I$(objk) + + BASE_DIR:=$(shell pwd) SCRIPT_DIR=$(BASE_DIR)/scripts @@ -21,13 +47,13 @@ config-targets := 1 endif -ifneq ($(filter textconfig oldconfig defconfig menuconfig,$(MAKECMDGOALS)),) +ifneq ($(filter config oldconfig defconfig menuconfig xconfig gconfig allyesconfig allnoconfig allmodconfig randconfig,$(MAKECMDGOALS)),) config-targets := 1 dot-config := 0 endif ifeq ($(dot-config),0) -all: .config +all: prepare .config .config: oldconfig @echo "Configuration completed - type make to build your ROM" @@ -139,32 +165,14 @@ endif super-distclean: - @ make -C $(KCONFIG_DIR) clean + @ rm -rf build @ rm -rf $(BUILD_DIR) - @ rm -f .config tmpconfig.h .kconfig.d .config.old + @ rm -f .config tmpconfig.h .kconfig.d .config.old .tmpconfig* ..config.tmp -ifeq ($(config-targets),1) +prepare: + $(Q)mkdir -p $(obj)/scripts/kconfig/lxdialog -$(KCONFIG_DIR)/conf: - make -C $(KCONFIG_DIR) conf +include scripts/kconfig/Makefile -$(KCONFIG_DIR)/mconf: - make -C $(KCONFIG_DIR) mconf +.PHONY: $(PHONY) prepare clean distclean -$(KCONFIG_DIR)/lxdialog/lxdialog: - make -C $(KCONFIG_DIR)/lxdialog lxdialog - - -textconfig: $(KCONFIG_DIR)/conf - @$(KCONFIG_DIR)/conf $(BASE_DIR)/Config.in - -oldconfig: $(KCONFIG_DIR)/conf - @$(KCONFIG_DIR)/conf -o $(BASE_DIR)/Config.in - -defconfig: $(KCONFIG_DIR)/conf - @$(KCONFIG_DIR)/conf -d $(BASE_DIR)/Config.in - -menuconfig: $(KCONFIG_DIR)/lxdialog/lxdialog $(KCONFIG_DIR)/mconf - @$(KCONFIG_DIR)/mconf $(BASE_DIR)/Config.in - -endif Added: buildrom-devel/scripts/kconfig/.gitignore =================================================================== --- buildrom-devel/scripts/kconfig/.gitignore (rev 0) +++ buildrom-devel/scripts/kconfig/.gitignore 2008-07-02 19:45:34 UTC (rev 210) @@ -0,0 +1,19 @@ +# +# Generated files +# +config* +lex.*.c +*.tab.c +*.tab.h +zconf.hash.c +*.moc +lkc_defs.h + +# +# configuration programs +# +conf +mconf +qconf +gconf +kxgettext Modified: buildrom-devel/scripts/kconfig/Makefile =================================================================== --- buildrom-devel/scripts/kconfig/Makefile 2008-07-01 21:13:46 UTC (rev 209) +++ buildrom-devel/scripts/kconfig/Makefile 2008-07-02 19:45:34 UTC (rev 210) @@ -1,107 +1,337 @@ -# Makefile for Pixil config -# Originally from Busybox +# =========================================================================== +# Kernel configuration targets +# These targets are used from top-level makefile -HOSTCC ?= gcc -HOSTCFLAGS=-O0 -g +PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config -all: ncurses conf mconf +Kconfig := Config.in -LIBS = -lncurses -ifeq (/usr/include/ncurses/ncurses.h, $(wildcard /usr/include/ncurses/ncurses.h)) - HOSTNCURSES += -I/usr/include/ncurses -DCURSES_LOC="" +xconfig: prepare $(objk)/qconf + $(Q)$(objk)/qconf $(Kconfig) + +gconfig: prepare $(objk)/gconf + $(Q)$(objk)/gconf $(Kconfig) + +menuconfig: prepare $(objk)/mconf + $(Q)$(objk)/mconf $(Kconfig) + +config: prepare $(objk)/conf + $(Q)$(objk)/conf $(Kconfig) + +oldconfig: prepare $(objk)/conf + $(Q)$(objk)/conf -o $(Kconfig) + +silentoldconfig: prepare $(objk)/conf + $(Q)$(objk)/conf -s $(Kconfig) + +# --- UNUSED, ignore ---------------------------------------------------------- +# Create new linux.pot file +# Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files +# The symlink is used to repair a deficiency in arch/um +update-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h + $(Q)echo " GEN config" + $(Q)xgettext --default-domain=linux \ + --add-comments --keyword=_ --keyword=N_ \ + --from-code=UTF-8 \ + --files-from=scripts/kconfig/POTFILES.in \ + --output $(obj)/config.pot + $(Q)sed -i s/CHARSET/UTF-8/ $(obj)/config.pot + $(Q)ln -fs Kconfig.i386 arch/um/Kconfig.arch + $(Q)(for i in `ls arch/`; \ + do \ + echo " GEN $$i"; \ + $(obj)/kxgettext arch/$$i/Kconfig \ + >> $(obj)/config.pot; \ + done ) + $(Q)msguniq --sort-by-file --to-code=UTF-8 $(obj)/config.pot \ + --output $(obj)/linux.pot + $(Q)rm -f arch/um/Kconfig.arch + $(Q)rm -f $(obj)/config.pot +# --- UNUSED, ignore ---------------------------------------------------------- + +PHONY += randconfig allyesconfig allnoconfig allmodconfig defconfig + +randconfig: prepare $(objk)/conf + $(Q)$(objk)/conf -r $(Kconfig) + +allyesconfig: prepare $(objk)/conf + $(Q)$(objk)/conf -y $(Kconfig) + +allnoconfig: prepare $(objk)/conf + $(Q)$(objk)/conf -n $(Kconfig) + +allmodconfig: prepare $(objk)/conf + $(Q)$(objk)/conf -m $(Kconfig) + +defconfig: prepare $(objk)/conf +ifeq ($(KBUILD_DEFCONFIG),) + $(Q)$(objk)/conf -d $(Kconfig) else -ifeq (/usr/include/ncurses/curses.h, $(wildcard /usr/include/ncurses/curses.h)) - HOSTNCURSES += -I/usr/include/ncurses -DCURSES_LOC="" -else -ifeq (/usr/local/include/ncurses/ncurses.h, $(wildcard /usr/local/include/ncurses/ncurses.h)) - HOSTCFLAGS += -I/usr/local/include/ncurses -DCURSES_LOC="" -else -ifeq (/usr/local/include/ncurses/curses.h, $(wildcard /usr/local/include/ncurses/curses.h)) - HOSTCFLAGS += -I/usr/local/include/ncurses -DCURSES_LOC="" -else -ifeq (/usr/include/ncurses.h, $(wildcard /usr/include/ncurses.h)) - HOSTNCURSES += -DCURSES_LOC="" -else - HOSTNCURSES += -DCURSES_LOC="" + @echo "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'" + $(Q)$(objk)/conf -D $(KBUILD_DEFCONFIG) $(Kconfig) endif + +%_defconfig: prepare $(objk)/conf + $(Q)$(objk)/conf -D configs/$@ $(Kconfig) + +# Help text used by make help +help: + @echo ' config - Update current config utilising a line-oriented program' + @echo ' menuconfig - Update current config utilising a menu based program' + @echo ' xconfig - Update current config utilising a QT based front-end' + @echo ' gconfig - Update current config utilising a GTK based front-end' + @echo ' oldconfig - Update current config utilising a provided .config as base' + @echo ' silentoldconfig - Same as oldconfig, but quietly' + @echo ' randconfig - New config with random answer to all options' + @echo ' defconfig - New config with default answer to all options' + @echo ' allmodconfig - New config selecting modules when possible' + @echo ' allyesconfig - New config where all options are accepted with yes' + @echo ' allnoconfig - New config where all options are answered with no' + +# lxdialog stuff +check-lxdialog := $(srck)/lxdialog/check-lxdialog.sh + +# Use recursively expanded variables so we do not call gcc unless +# we really need to do so. (Do not call gcc as part of make mrproper) +HOST_EXTRACFLAGS = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags) +HOST_LOADLIBES = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC)) + +HOST_EXTRACFLAGS += -DLOCALE + + +# =========================================================================== +# Shared Makefile for the various kconfig executables: +# conf: Used for defconfig, oldconfig and related targets +# mconf: Used for the mconfig target. +# Utilizes the lxdialog package +# qconf: Used for the xconfig target +# Based on QT which needs to be installed to compile it +# gconf: Used for the gconfig target +# Based on GTK which needs to be installed to compile it +# object files used by all kconfig flavours + +lxdialog := lxdialog/checklist.o lxdialog/util.o lxdialog/inputbox.o +lxdialog += lxdialog/textbox.o lxdialog/yesno.o lxdialog/menubox.o + +conf-objs := conf.o zconf.tab.o +mconf-objs := mconf.o zconf.tab.o $(lxdialog) +kxgettext-objs := kxgettext.o zconf.tab.o + +hostprogs-y := conf qconf gconf kxgettext + +ifeq ($(MAKECMDGOALS),menuconfig) + hostprogs-y += mconf endif + +ifeq ($(MAKECMDGOALS),xconfig) + qconf-target := 1 endif +ifeq ($(MAKECMDGOALS),gconfig) + gconf-target := 1 endif + + +ifeq ($(qconf-target),1) +qconf-cxxobjs := qconf.o +qconf-objs := kconfig_load.o zconf.tab.o endif -CONF_SRC =conf.c -MCONF_SRC =mconf.c lxdialog/checklist.c lxdialog/menubox.c lxdialog/textbox.c lxdialog/yesno.c lxdialog/inputbox.c lxdialog/util.c lxdialog/msgbox.c -SHARED_SRC=zconf.tab.c -SHARED_DEPS:=lkc.h lkc_proto.h lkc_defs.h expr.h zconf.hash.c -CONF_OBJS =$(patsubst %.c,%.o, $(CONF_SRC)) -MCONF_OBJS=$(patsubst %.c,%.o, $(MCONF_SRC)) -SHARED_OBJS=$(patsubst %.c,%.o, $(SHARED_SRC)) +ifeq ($(gconf-target),1) +gconf-objs := gconf.o kconfig_load.o zconf.tab.o +endif -conf: $(CONF_OBJS) $(SHARED_OBJS) - $(HOSTCC) $(NATIVE_LDFLAGS) $^ -o $@ +clean-files := lkc_defs.h qconf.moc .tmp_qtcheck \ + .tmp_gtkcheck zconf.tab.c lex.zconf.c zconf.hash.c gconf.glade.h +clean-files += mconf qconf gconf +clean-files += config.pot buildrom.pot -mconf: $(MCONF_OBJS) $(SHARED_OBJS) - $(HOSTCC) $(NATIVE_LDFLAGS) $^ -o $@ $(LIBS) +# Check that we have the required ncurses stuff installed for lxdialog (menuconfig) +PHONY += $(objk)/dochecklxdialog +$(addprefix $(obj)/,$(lxdialog)): $(objk)/dochecklxdialog +$(objk)/dochecklxdialog: + $(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOST_LOADLIBES) -$(CONF_OBJS): %.o : %.c $(SHARED_DEPS) - $(HOSTCC) $(HOSTCFLAGS) -I. -c $< -o $@ +always := dochecklxdialog -$(MCONF_OBJS): %.o : %.c $(SHARED_DEPS) - $(HOSTCC) $(HOSTCFLAGS) $(HOSTNCURSES) -I. -c $< -o $@ +# Add environment specific flags +HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(srck)/check.sh $(HOSTCC) $(HOSTCFLAGS)) -lkc_defs.h: lkc_proto.h - @sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/' +# generated files seem to need this to find local include files +HOSTCFLAGS_lex.zconf.o := -I$(src) +HOSTCFLAGS_zconf.tab.o := -I$(src) +HOSTLOADLIBES_qconf = $(KC_QT_LIBS) -ldl +HOSTCXXFLAGS_qconf.o = $(KC_QT_CFLAGS) -D LKC_DIRECT_LINK + +HOSTLOADLIBES_gconf = `pkg-config --libs gtk+-2.0 gmodule-2.0 libglade-2.0` +HOSTCFLAGS_gconf.o = `pkg-config --cflags gtk+-2.0 gmodule-2.0 libglade-2.0` \ + -D LKC_DIRECT_LINK + +$(objk)/qconf.o: $(objk)/.tmp_qtcheck + +ifeq ($(qconf-target),1) +$(objk)/.tmp_qtcheck: $(srck)/Makefile +-include $(objk)/.tmp_qtcheck + +# QT needs some extra effort... +$(objk)/.tmp_qtcheck: prepare + @set -e; dir=""; pkg=""; \ + pkg-config --exists qt 2> /dev/null && pkg=qt; \ + pkg-config --exists qt-mt 2> /dev/null && pkg=qt-mt; \ + if [ -n "$$pkg" ]; then \ + cflags="\$$(shell pkg-config $$pkg --cflags)"; \ + libs="\$$(shell pkg-config $$pkg --libs)"; \ + moc="\$$(shell pkg-config $$pkg --variable=prefix)/bin/moc"; \ + dir="$$(pkg-config $$pkg --variable=prefix)"; \ + else \ + for d in $$QTDIR /usr/share/qt* /usr/lib/qt*; do \ + if [ -f $$d/include/qconfig.h ]; then dir=$$d; break; fi; \ + done; \ + if [ -z "$$dir" ]; then \ + echo "*"; \ + echo "* Unable to find the QT3 installation. Please make sure that"; \ + echo "* the QT3 development package is correctly installed and"; \ + echo "* either install pkg-config or set the QTDIR environment"; \ + echo "* variable to the correct location."; \ + echo "*"; \ + false; \ + fi; \ + libpath=$$dir/lib; lib=qt; osdir=""; \ + $(HOSTCXX) -print-multi-os-directory > /dev/null 2>&1 && \ + osdir=x$$($(HOSTCXX) -print-multi-os-directory); \ + test -d $$libpath/$$osdir && libpath=$$libpath/$$osdir; \ + test -f $$libpath/libqt-mt.so && lib=qt-mt; \ + cflags="-I$$dir/include"; \ + libs="-L$$libpath -Wl,-rpath,$$libpath -l$$lib"; \ + moc="$$dir/bin/moc"; \ + fi; \ + if [ ! -x $$dir/bin/moc -a -x /usr/bin/moc ]; then \ + echo "*"; \ + echo "* Unable to find $$dir/bin/moc, using /usr/bin/moc instead."; \ + echo "*"; \ + moc="/usr/bin/moc"; \ + fi; \ + echo "KC_QT_CFLAGS=$$cflags" > $@; \ + echo "KC_QT_LIBS=$$libs" >> $@; \ + echo "KC_QT_MOC=$$moc" >> $@ +endif + +$(objk)/gconf.o: $(objk)/.tmp_gtkcheck + +ifeq ($(gconf-target),1) +-include $(objk)/.tmp_gtkcheck + +# GTK needs some extra effort, too... +$(objk)/.tmp_gtkcheck: prepare + @if `pkg-config --exists gtk+-2.0 gmodule-2.0 libglade-2.0`; then \ + if `pkg-config --atleast-version=2.0.0 gtk+-2.0`; then \ + touch $@; \ + else \ + echo "*"; \ + echo "* GTK+ is present but version >= 2.0.0 is required."; \ + echo "*"; \ + false; \ + fi \ + else \ + echo "*"; \ + echo "* Unable to find the GTK+ installation. Please make sure that"; \ + echo "* the GTK+ 2.0 development package is correctly installed..."; \ + echo "* You need gtk+-2.0, glib-2.0 and libglade-2.0."; \ + echo "*"; \ + false; \ + fi +endif + +# --- UNUSED, ignore ---------------------------------------------------------- +ifdef UNUSED +$(obj)/zconf.tab.o: $(obj)/lex.zconf.c $(obj)/zconf.hash.c + +$(obj)/kconfig_load.o: $(obj)/lkc_defs.h + +$(obj)/qconf.o: $(obj)/qconf.moc $(obj)/lkc_defs.h + +$(obj)/gconf.o: $(obj)/lkc_defs.h + +$(obj)/%.moc: $(src)/%.h + $(KC_QT_MOC) -i $< -o $@ + +$(obj)/lkc_defs.h: $(src)/lkc_proto.h + sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/' + +# Extract gconf menu items for I18N support +$(obj)/gconf.glade.h: $(obj)/gconf.glade + intltool-extract --type=gettext/glade $(obj)/gconf.glade +endif +# --- UNUSED, ignore ---------------------------------------------------------- + ### -# The following requires flex/bison -# By default we use the _shipped versions, uncomment the -# following line if you are modifying the flex/bison src. -#LKC_GENPARSER := 1 +# The following requires flex/bison/gperf +# By default we use the _shipped versions, uncomment the following line if +# you are modifying the flex/bison src. +# LKC_GENPARSER := 1 ifdef LKC_GENPARSER -%.tab.c %.tab.h: %.y - bison -t -d -v -b $* -p $(notdir $*) $< +# --- UNUSED, ignore ---------------------------------------------------------- +$(obj)/zconf.tab.c: $(src)/zconf.y +$(obj)/lex.zconf.c: $(src)/zconf.l +$(obj)/zconf.hash.c: $(src)/zconf.gperf +%.tab.c: %.y + bison -l -b $* -p $(notdir $*) $< + cp $@ $@_shipped + lex.%.c: %.l - flex -P$(notdir $*) -o$@ $< -else + flex -L -P$(notdir $*) -o$@ $< + cp $@ $@_shipped -lex.zconf.o: lex.zconf.c $(SHARED_DEPS) - $(HOSTCC) $(HOSTCFLAGS) -I. -c $< -o $@ +%.hash.c: %.gperf + gperf < $< > $@ + cp $@ $@_shipped +# --- UNUSED, ignore ---------------------------------------------------------- -lex.zconf.c: lex.zconf.c_shipped - cp lex.zconf.c_shipped lex.zconf.c +endif -zconf.hash.c: zconf.hash.c_shipped - cp $< $@ +$(objk)/qconf: $(patsubst %,$(objk)/%,$(qconf-cxxobjs)) \ + $(patsubst %,$(objk)/%,$(qconf-objs)) + $(Q)$(HOSTCXX) $(HOSTCXXFLAGS) $(HOSTLOADLIBES_qconf) -o $@ $^ +$(objk)/gconf: $(patsubst %,$(objk)/%,$(gconf-objs)) + $(Q)$(HOSTCC) $(HOSTCFLAGS) $(HOSTLOADLIBES_gconf) -o $@ $^ +$(objk)/mconf: $(patsubst %,$(objk)/%,$(mconf-objs)) + $(Q)$(HOSTCC) $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) $(HOST_LOADLIBES) -o $@ $^ +$(objk)/conf: $(patsubst %,$(objk)/%,$(conf-objs)) + $(Q)$(HOSTCC) $(HOSTCFLAGS) -o $@ $^ -zconf.tab.o: zconf.tab.c lex.zconf.c confdata.c expr.c symbol.c menu.c $(SHARED_DEPS) - $(HOSTCC) $(HOSTCFLAGS) -I. -c $< -o $@ +$(objk)/mconf.o: $(srck)/mconf.c + $(Q)$(HOSTCC) $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) -c -o $@ $< +$(objk)/conf.o: $(srck)/conf.c + $(Q)$(HOSTCC) $(HOSTCFLAGS) -c -o $@ $< -zconf.tab.c: zconf.tab.c_shipped - cp zconf.tab.c_shipped zconf.tab.c +$(objk)/zconf.tab.o: $(objk)/zconf.tab.c $(objk)/lex.zconf.c \ + $(objk)/zconf.hash.c + $(Q)$(HOSTCC) $(HOSTCFLAGS) -c -o $@ $(objk)/zconf.tab.c +$(objk)/kconfig_load.o: $(srck)/kconfig_load.c $(objk)/lkc_defs.h + $(Q)$(HOSTCC) $(HOSTCFLAGS) -c -o $@ $< +$(objk)/qconf.o: $(srck)/qconf.cc $(objk)/qconf.moc $(objk)/lkc_defs.h + $(Q)$(HOSTCXX) $(HOSTCXXFLAGS) $(HOSTCXXFLAGS_qconf.o) -c -o $@ $< +$(objk)/gconf.o: $(srck)/gconf.c $(objk)/lkc_defs.h + $(Q)$(HOSTCC) $(HOSTCFLAGS) $(HOSTCFLAGS_gconf.o) -c -o $@ $< +$(objk)/%.moc: $(srck)/%.h + $(Q)$(KC_QT_MOC) -i $< -o $@ +$(objk)/lkc_defs.h: $(srck)/lkc_proto.h + $(Q)sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/' -endif +$(objk)/lex.zconf.c: $(srck)/lex.zconf.c_shipped + $(Q)cp $< $@ +$(objk)/zconf.hash.c: $(srck)/zconf.hash.c_shipped + $(Q)cp $< $@ +$(objk)/zconf.tab.c: $(srck)/zconf.tab.c_shipped + $(Q)cp $< $@ -.PHONY: ncurses +$(objk)/lxdialog/lxdialog: $(objk)/dochecklxdialog \ + $(patsubst %,$(objk)/lxdialog/%,$(lxdialog)) + $(Q)$(HOSTCC) $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) $(HOST_LOADLIBES) \ + $(patsubst %,$(objk)/lxdialog/%,$(lxdialog)) -o $@ +$(objk)/lxdialog/%.o: $(srck)/lxdialog/%.c + $(Q)$(HOSTCC) $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) $^ -c -o $@ -ncurses: - @echo "main() {}" > lxtemp.c - @if $(HOSTCC) lxtemp.c $(LIBS) ; then \ - rm -f lxtemp.c a.out; \ - else \ - rm -f lxtemp.c; \ - echo -e "\007" ;\ - echo ">> Unable to find the Ncurses libraries." ;\ - echo ">>" ;\ - echo ">> You must have Ncurses installed in order" ;\ - echo ">> to use 'make menuconfig'" ;\ - echo ;\ - exit 1 ;\ - fi - -clean: - @ rm -f *.o *~ core $(TARGETS) $(MCONF_OBJS) $(CONF_OBJS) \ - conf mconf zconf.tab.c lex.zconf.c lkc_defs.h - Modified: buildrom-devel/scripts/kconfig/POTFILES.in =================================================================== --- buildrom-devel/scripts/kconfig/POTFILES.in 2008-07-01 21:13:46 UTC (rev 209) +++ buildrom-devel/scripts/kconfig/POTFILES.in 2008-07-02 19:45:34 UTC (rev 210) @@ -1,3 +1,9 @@ +scripts/kconfig/lxdialog/checklist.c +scripts/kconfig/lxdialog/inputbox.c +scripts/kconfig/lxdialog/menubox.c +scripts/kconfig/lxdialog/textbox.c +scripts/kconfig/lxdialog/util.c +scripts/kconfig/lxdialog/yesno.c scripts/kconfig/mconf.c scripts/kconfig/conf.c scripts/kconfig/confdata.c @@ -2,2 +8,3 @@ scripts/kconfig/gconf.c +scripts/kconfig/gconf.glade.h scripts/kconfig/qconf.cc Added: buildrom-devel/scripts/kconfig/check.sh =================================================================== --- buildrom-devel/scripts/kconfig/check.sh (rev 0) +++ buildrom-devel/scripts/kconfig/check.sh 2008-07-02 19:45:34 UTC (rev 210) @@ -0,0 +1,14 @@ +#!/bin/sh +# Needed for systems without gettext +$* -xc -o /dev/null - > /dev/null 2>&1 << EOF +#include +int main() +{ + gettext(""); + return 0; +} +EOF +if [ ! "$?" -eq "0" ]; then + echo -DKBUILD_NO_NLS; +fi + Property changes on: buildrom-devel/scripts/kconfig/check.sh ___________________________________________________________________ Added: svn:executable + * Modified: buildrom-devel/scripts/kconfig/conf.c =================================================================== --- buildrom-devel/scripts/kconfig/conf.c 2008-07-01 21:13:46 UTC (rev 209) +++ buildrom-devel/scripts/kconfig/conf.c 2008-07-02 19:45:34 UTC (rev 210) @@ -3,12 +3,13 @@ * Released under the terms of the GNU GPL v2.0. */ +#include #include +#include #include -#include #include +#include #include -#include #include #define LKC_DIRECT_LINK @@ -37,6 +38,14 @@ static char nohelp_text[] = N_("Sorry, no help available for this option yet.\n"); +static const char *get_help(struct menu *menu) +{ + if (menu_has_help(menu)) + return _(menu_get_help(menu)); + else + return nohelp_text; +} + static void strip(char *str) { char *p = str; @@ -64,13 +73,13 @@ } } -static void conf_askvalue(struct symbol *sym, const char *def) +static int conf_askvalue(struct symbol *sym, const char *def) { enum symbol_type type = sym_get_type(sym); tristate val; if (!sym_has_value(sym)) - printf("(NEW) "); + printf(_("(NEW) ")); line[0] = '\n'; line[1] = 0; @@ -79,7 +88,7 @@ printf("%s\n", def); line[0] = '\n'; line[1] = 0; - return; + return 0; } switch (input_mode) { @@ -89,23 +98,23 @@ case set_random: if (sym_has_value(sym)) { printf("%s\n", def); - return; + return 0; } break; case ask_new: case ask_silent: if (sym_has_value(sym)) { printf("%s\n", def); - return; + return 0; } check_stdin(); case ask_all: fflush(stdout); fgets(line, 128, stdin); - return; + return 1; case set_default: printf("%s\n", def); - return; + return 1; default: break; } @@ -115,7 +124,7 @@ case S_HEX: case S_STRING: printf("%s\n", def); - return; + return 1; default: ; } @@ -152,7 +161,7 @@ } case set_random: do { - val = (tristate)(random() % 3); + val = (tristate)(rand() % 3); } while (!sym_tristate_within_range(sym, val)); switch (val) { case no: line[0] = 'n'; break; @@ -166,30 +175,29 @@ break; } printf("%s", line); + return 1; } int conf_string(struct menu *menu) { struct symbol *sym = menu->sym; - const char *def, *help; + const char *def; while (1) { - printf("%*s%s ", indent - 1, "", menu->prompt->text); + printf("%*s%s ", indent - 1, "", _(menu->prompt->text)); printf("(%s) ", sym->name); def = sym_get_string_value(sym); if (sym_get_string_value(sym)) printf("[%s] ", def); - conf_askvalue(sym, def); + if (!conf_askvalue(sym, def)) + return 0; switch (line[0]) { case '\n': break; case '?': /* print help */ if (line[1] == '\n') { - help = nohelp_text; - if (menu->sym->help) - help = menu->sym->help; - printf("\n%s\n", menu->sym->help); + printf("\n%s\n", get_help(menu)); def = NULL; break; } @@ -207,10 +215,9 @@ struct symbol *sym = menu->sym; int type; tristate oldval, newval; - const char *help; while (1) { - printf("%*s%s ", indent - 1, "", menu->prompt->text); + printf("%*s%s ", indent - 1, "", _(menu->prompt->text)); if (sym->name) printf("(%s) ", sym->name); type = sym_get_type(sym); @@ -233,10 +240,11 @@ printf("/m"); if (oldval != yes && sym_tristate_within_range(sym, yes)) printf("/y"); - if (sym->help) + if (menu_has_help(menu)) printf("/?"); printf("] "); - conf_askvalue(sym, sym_get_string_value(sym)); + if (!conf_askvalue(sym, sym_get_string_value(sym))) + return 0; strip(line); switch (line[0]) { @@ -269,10 +277,7 @@ if (sym_set_tristate_value(sym, newval)) return 0; help: - help = nohelp_text; - if (sym->help) - help = sym->help; - printf("\n%s\n", help); + printf("\n%s\n", get_help(menu)); } } @@ -302,7 +307,7 @@ case no: return 1; case mod: - printf("%*s%s\n", indent - 1, "", menu_get_prompt(menu)); + printf("%*s%s\n", indent - 1, "", _(menu_get_prompt(menu))); return 0; case yes: break; @@ -312,7 +317,7 @@ while (1) { int cnt, def; - printf("%*s%s\n", indent - 1, "", menu_get_prompt(menu)); + printf("%*s%s\n", indent - 1, "", _(menu_get_prompt(menu))); def_sym = sym_get_choice_value(sym); cnt = def = 0; line[0] = 0; @@ -320,7 +325,7 @@ if (!menu_is_visible(child)) continue; if (!child->sym) { - printf("%*c %s\n", indent, '*', menu_get_prompt(child)); + printf("%*c %s\n", indent, '*', _(menu_get_prompt(child))); continue; } cnt++; @@ -329,20 +334,20 @@ printf("%*c", indent, '>'); } else printf("%*c", indent, ' '); - printf(" %d. %s", cnt, menu_get_prompt(child)); + printf(" %d. %s", cnt, _(menu_get_prompt(child))); if (child->sym->name) printf(" (%s)", child->sym->name); if (!sym_has_value(child->sym)) - printf(" (NEW)"); + printf(_(" (NEW)")); printf("\n"); } - printf("%*schoice", indent - 1, ""); + printf(_("%*schoice"), indent - 1, ""); if (cnt == 1) { printf("[1]: 1\n"); goto conf_childs; } printf("[1-%d", cnt); - if (sym->help) + if (menu_has_help(menu)) printf("?"); printf("]: "); switch (input_mode) { @@ -359,8 +364,7 @@ fgets(line, 128, stdin); strip(line); if (line[0] == '?') { - printf("\n%s\n", menu->sym->help ? - menu->sym->help : nohelp_text); + printf("\n%s\n", get_help(menu)); continue; } if (!line[0]) @@ -371,7 +375,8 @@ continue; break; case set_random: - def = (random() % cnt) + 1; + if (is_new) + def = (rand() % cnt) + 1; case set_default: case set_yes: case set_mod: @@ -390,15 +395,14 @@ } if (!child) continue; - if (strlen(line) > 0 && line[strlen(line) - 1] == '?') { - printf("\n%s\n", child->sym->help ? - child->sym->help : nohelp_text); + if (line[strlen(line) - 1] == '?') { + printf("\n%s\n", get_help(child)); continue; } sym_set_choice_value(sym, child->sym); - if (child->list) { + for (child = child->list; child; child = child->next) { indent += 2; - conf(child->list); + conf(child); indent -= 2; } return 1; @@ -430,7 +434,7 @@ if (prompt) printf("%*c\n%*c %s\n%*c\n", indent, '*', - indent, '*', prompt, + indent, '*', _(prompt), indent, '*'); default: ; @@ -492,12 +496,16 @@ int main(int ac, char **av) { - int i = 1; + int opt; const char *name; struct stat tmpstat; - if (ac > i && av[i][0] == '-') { - switch (av[i++][1]) { + setlocale(LC_ALL, ""); + bindtextdomain(PACKAGE, LOCALEDIR); + textdomain(PACKAGE); + + while ((opt = getopt(ac, av, "osdD:nmyrh")) != -1) { + switch (opt) { case 'o': input_mode = ask_new; break; @@ -510,12 +518,7 @@ break; case 'D': input_mode = set_default; - defconfig_file = av[i++]; - if (!defconfig_file) { - printf(_("%s: No default config file specified\n"), - av[0]); - exit(1); - } + defconfig_file = optarg; break; case 'n': input_mode = set_no; @@ -528,18 +531,22 @@ break; case 'r': input_mode = set_random; - srandom(time(NULL)); + srand(time(NULL)); break; case 'h': - case '?': - fprintf(stderr, "See README for usage info\n"); + printf(_("See README for usage info\n")); exit(0); + break; + default: + fprintf(stderr, _("See README for usage info\n")); + exit(1); } } - name = av[i]; - if (!name) { + if (ac == optind) { printf(_("%s: Kconfig file missing\n"), av[0]); + exit(1); } + name = av[optind]; conf_parse(name); //zconfdump(stdout); switch (input_mode) { @@ -547,9 +554,9 @@ if (!defconfig_file) defconfig_file = conf_get_default_confname(); if (conf_read(defconfig_file)) { - printf("***\n" + printf(_("***\n" "*** Can't find default configuration \"%s\"!\n" - "***\n", defconfig_file); + "***\n"), defconfig_file); exit(1); } break; @@ -557,9 +564,10 @@ if (stat(".config", &tmpstat)) { printf(_("***\n" "*** You have not yet configured buildrom!\n" + "*** (missing .config file)\n" "***\n" "*** Please run some configurator (e.g. \"make oldconfig\" or\n" - "*** \"make menuconfig\" or \"make defconfig\").\n" + "*** \"make menuconfig\" or \"make xconfig\").\n" "***\n")); exit(1); } @@ -573,7 +581,7 @@ case set_random: name = getenv("KCONFIG_ALLCONFIG"); if (name && !stat(name, &tmpstat)) { - conf_read_simple(name); + conf_read_simple(name, S_DEF_USER); break; } switch (input_mode) { @@ -584,9 +592,9 @@ default: break; } if (!stat(name, &tmpstat)) - conf_read_simple(name); + conf_read_simple(name, S_DEF_USER); else if (!stat("all.config", &tmpstat)) - conf_read_simple("all.config"); + conf_read_simple("all.config", S_DEF_USER); break; default: break; @@ -599,14 +607,32 @@ input_mode = ask_silent; valid_stdin = 1; } - } + } else if (conf_get_changed()) { + name = getenv("KCONFIG_NOSILENTUPDATE"); + if (name && *name) { + fprintf(stderr, _("\n*** Configuration requires explicit update.\n\n")); + return 1; + } + } else + goto skip_check; + do { conf_cnt = 0; check_conf(&rootmenu); } while (conf_cnt); if (conf_write(NULL)) { - fprintf(stderr, _("\n*** Error during writing of the buildrom configuration.\n\n")); + fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n")); return 1; } + if (conf_write_autoconf()) { + fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n")); + return 1; + } +skip_check: + if (input_mode == ask_silent && conf_write_autoconf()) { + fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n")); + return 1; + } + return 0; } Modified: buildrom-devel/scripts/kconfig/confdata.c =================================================================== --- buildrom-devel/scripts/kconfig/confdata.c 2008-07-01 21:13:46 UTC (rev 209) +++ buildrom-devel/scripts/kconfig/confdata.c 2008-07-02 19:45:34 UTC (rev 210) @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -20,15 +21,8 @@ static const char *conf_filename; static int conf_lineno, conf_warnings, conf_unsaved; -const char conf_def_filename[] = ".config"; +const char conf_defname[] = "arch/$ARCH/defconfig"; -const char conf_defname[] = "scripts/defconfig"; - -const char *conf_confnames[] = { - ".config", - NULL, -}; - static void conf_warning(const char *fmt, ...) { va_list ap; @@ -40,6 +34,13 @@ conf_warnings++; } +const char *conf_get_configname(void) +{ + char *name = getenv("KCONFIG_CONFIG"); + + return name ? name : ".config"; +} + static char *conf_expand_value(const char *in) { struct symbol *sym; @@ -82,51 +83,127 @@ return name; } -int conf_read_simple(const char *name) +static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p) { + char *p2; + + switch (sym->type) { + case S_TRISTATE: + if (p[0] == 'm') { + sym->def[def].tri = mod; + sym->flags |= def_flags; + break; + } + case S_BOOLEAN: + if (p[0] == 'y') { + sym->def[def].tri = yes; + sym->flags |= def_flags; + break; + } + if (p[0] == 'n') { + sym->def[def].tri = no; + sym->flags |= def_flags; + break; + } + conf_warning("symbol value '%s' invalid for %s", p, sym->name); + break; + case S_OTHER: + if (*p != '"') { + for (p2 = p; *p2 && !isspace(*p2); p2++) + ; + sym->type = S_STRING; + goto done; + } + case S_STRING: + if (*p++ != '"') + break; + for (p2 = p; (p2 = strpbrk(p2, "\"\\")); p2++) { + if (*p2 == '"') { + *p2 = 0; + break; + } + memmove(p2, p2 + 1, strlen(p2)); + } + if (!p2) { + conf_warning("invalid string found"); + return 1; + } + case S_INT: + case S_HEX: + done: + if (sym_string_valid(sym, p)) { + sym->def[def].val = strdup(p); + sym->flags |= def_flags; + } else { + conf_warning("symbol value '%s' invalid for %s", p, sym->name); + return 1; + } + break; + default: + ; + } + return 0; +} + +int conf_read_simple(const char *name, int def) +{ FILE *in = NULL; char line[1024]; char *p, *p2; struct symbol *sym; - int i; + int i, def_flags; if (name) { in = zconf_fopen(name); } else { - const char **names = conf_confnames; - while ((name = *names++)) { - name = conf_expand_value(name); + struct property *prop; + + name = conf_get_configname(); + in = zconf_fopen(name); + if (in) + goto load; + sym_add_change_count(1); + if (!sym_defconfig_list) + return 1; + + for_all_defaults(sym_defconfig_list, prop) { + if (expr_calc_value(prop->visible.expr) == no || + prop->expr->type != E_SYMBOL) + continue; + name = conf_expand_value(prop->expr->left.sym->name); in = zconf_fopen(name); if (in) { printf(_("#\n" - "# using defaults found in %s\n" - "#\n"), name); - break; + "# using defaults found in %s\n" + "#\n"), name); + goto load; } } } if (!in) return 1; +load: conf_filename = name; conf_lineno = 0; conf_warnings = 0; conf_unsaved = 0; + def_flags = SYMBOL_DEF << def; for_all_symbols(i, sym) { - sym->flags |= SYMBOL_NEW | SYMBOL_CHANGED; + sym->flags |= SYMBOL_CHANGED; + sym->flags &= ~(def_flags|SYMBOL_VALID); if (sym_is_choice(sym)) - sym->flags &= ~SYMBOL_NEW; - sym->flags &= ~SYMBOL_VALID; + sym->flags |= def_flags; switch (sym->type) { case S_INT: case S_HEX: case S_STRING: - if (sym->user.val) - free(sym->user.val); + if (sym->def[def].val) + free(sym->def[def].val); default: - sym->user.val = NULL; - sym->user.tri = no; + sym->def[def].val = NULL; + sym->def[def].tri = no; } } @@ -143,19 +220,25 @@ *p++ = 0; if (strncmp(p, "is not set", 10)) continue; - sym = sym_find(line + 9); - if (!sym) { - conf_warning("trying to assign nonexistent symbol %s", line + 9); - break; - } else if (!(sym->flags & SYMBOL_NEW)) { - conf_warning("trying to reassign symbol %s", sym->name); - break; + if (def == S_DEF_USER) { + sym = sym_find(line + 9); + if (!sym) { + conf_warning("trying to assign nonexistent symbol %s", line + 9); + break; + } + } else { + sym = sym_lookup(line + 9, 0); + if (sym->type == S_UNKNOWN) + sym->type = S_BOOLEAN; } + if (sym->flags & def_flags) { + conf_warning("override: reassigning to symbol %s", sym->name); + } switch (sym->type) { case S_BOOLEAN: case S_TRISTATE: - sym->user.tri = no; - sym->flags &= ~SYMBOL_NEW; + sym->def[def].tri = no; + sym->flags |= def_flags; break; default: ; @@ -171,64 +254,29 @@ continue; *p++ = 0; p2 = strchr(p, '\n'); - if (p2) - *p2 = 0; - sym = sym_find(line + 7); - if (!sym) { - conf_warning("trying to assign nonexistent symbol %s", line + 7); - break; - } else if (!(sym->flags & SYMBOL_NEW)) { - conf_warning("trying to reassign symbol %s", sym->name); - break; + if (p2) { + *p2-- = 0; + if (*p2 == '\r') + *p2 = 0; } - switch (sym->type) { - case S_TRISTATE: - if (p[0] == 'm') { - sym->user.tri = mod; - sym->flags &= ~SYMBOL_NEW; + if (def == S_DEF_USER) { + sym = sym_find(line + 7); + if (!sym) { + conf_warning("trying to assign nonexistent symbol %s", line + 7); break; } - case S_BOOLEAN: - if (p[0] == 'y') { - sym->user.tri = yes; - sym->flags &= ~SYMBOL_NEW; - break; - } - if (p[0] == 'n') { - sym->user.tri = no; - sym->flags &= ~SYMBOL_NEW; - break; - } - conf_warning("symbol value '%s' invalid for %s", p, sym->name); - break; - case S_STRING: - if (*p++ != '"') - break; - for (p2 = p; (p2 = strpbrk(p2, "\"\\")); p2++) { - if (*p2 == '"') { - *p2 = 0; - break; - } - memmove(p2, p2 + 1, strlen(p2)); - } - if (!p2) { - conf_warning("invalid string found"); - continue; - } - case S_INT: - case S_HEX: - if (sym_string_valid(sym, p)) { - sym->user.val = strdup(p); - sym->flags &= ~SYMBOL_NEW; - } else { - conf_warning("symbol value '%s' invalid for %s", p, sym->name); - continue; - } - break; - default: - ; + } else { + sym = sym_lookup(line + 7, 0); + if (sym->type == S_UNKNOWN) + sym->type = S_OTHER; } + if (sym->flags & def_flags) { + conf_warning("override: reassigning to symbol %s", sym->name); + } + if (conf_set_sym_val(sym, def, def_flags, p)) + continue; break; + case '\r': case '\n': break; default: @@ -237,24 +285,22 @@ } if (sym && sym_is_choice_value(sym)) { struct symbol *cs = prop_get_symbol(sym_get_choice_prop(sym)); - switch (sym->user.tri) { + switch (sym->def[def].tri) { case no: break; case mod: - if (cs->user.tri == yes) { + if (cs->def[def].tri == yes) { conf_warning("%s creates inconsistent choice state", sym->name); - cs->flags |= SYMBOL_NEW; + cs->flags &= ~def_flags; } break; case yes: - if (cs->user.tri != no) { - conf_warning("%s creates inconsistent choice state", sym->name); - cs->flags |= SYMBOL_NEW; - } else - cs->user.val = sym; + if (cs->def[def].tri != no) + conf_warning("override: %s changes choice state", sym->name); + cs->def[def].val = sym; break; } - cs->user.tri = E_OR(cs->user.tri, sym->user.tri); + cs->def[def].tri = EXPR_OR(cs->def[def].tri, sym->def[def].tri); } } fclose(in); @@ -266,12 +312,14 @@ int conf_read(const char *name) { - struct symbol *sym; + struct symbol *sym, *choice_sym; struct property *prop; struct expr *e; - int i; + int i, flags; - if (conf_read_simple(name)) + sym_set_change_count(0); + + if (conf_read_simple(name, S_DEF_USER)) return 1; for_all_symbols(i, sym) { @@ -283,12 +331,12 @@ switch (sym->type) { case S_BOOLEAN: case S_TRISTATE: - if (sym->user.tri != sym_get_tristate_value(sym)) + if (sym->def[S_DEF_USER].tri != sym_get_tristate_value(sym)) break; if (!sym_is_choice(sym)) goto sym_ok; default: - if (!strcmp(sym->curr.val, sym->user.val)) + if (!strcmp(sym->curr.val, sym->def[S_DEF_USER].val)) goto sym_ok; break; } @@ -298,37 +346,52 @@ conf_unsaved++; /* maybe print value in verbose mode... */ sym_ok: + if (!sym_is_choice(sym)) + continue; + /* The choice symbol only has a set value (and thus is not new) + * if all its visible childs have values. + */ + prop = sym_get_choice_prop(sym); + flags = sym->flags; + expr_list_for_each_sym(prop->expr, e, choice_sym) + if (choice_sym->visible != no) + flags &= choice_sym->flags; + sym->flags &= flags | ~SYMBOL_DEF_USER; + } + + for_all_symbols(i, sym) { if (sym_has_value(sym) && !sym_is_choice_value(sym)) { - if (sym->visible == no) - sym->flags |= SYMBOL_NEW; + /* Reset values of generates values, so they'll appear + * as new, if they should become visible, but that + * doesn't quite work if the Kconfig and the saved + * configuration disagree. + */ + if (sym->visible == no && !conf_unsaved) + sym->flags &= ~SYMBOL_DEF_USER; switch (sym->type) { case S_STRING: case S_INT: case S_HEX: - if (!sym_string_within_range(sym, sym->user.val)) { - sym->flags |= SYMBOL_NEW; - sym->flags &= ~SYMBOL_VALID; - } + /* Reset a string value if it's out of range */ + if (sym_string_within_range(sym, sym->def[S_DEF_USER].val)) + break; + sym->flags &= ~(SYMBOL_VALID|SYMBOL_DEF_USER); + conf_unsaved++; + break; default: break; } } - if (!sym_is_choice(sym)) - continue; - prop = sym_get_choice_prop(sym); - for (e = prop->expr; e; e = e->left.expr) - if (e->right.sym->visible != no) - sym->flags |= e->right.sym->flags & SYMBOL_NEW; } - sym_change_count = conf_warnings || conf_unsaved; + sym_add_change_count(conf_warnings || conf_unsaved); return 0; } int conf_write(const char *name) { - FILE *out, *out_h; + FILE *out; struct symbol *sym; struct menu *menu; const char *basename; @@ -347,7 +410,7 @@ if (!stat(name, &st) && S_ISDIR(st.st_mode)) { strcpy(dirname, name); strcat(dirname, "/"); - basename = conf_def_filename; + basename = conf_get_configname(); } else if ((slash = strrchr(name, '/'))) { int size = slash - name + 1; memcpy(dirname, name, size); @@ -355,23 +418,24 @@ if (slash[1]) basename = slash + 1; else - basename = conf_def_filename; + basename = conf_get_configname(); } else basename = name; } else - basename = conf_def_filename; + basename = conf_get_configname(); - sprintf(newname, "%s.tmpconfig.%d", dirname, (int)getpid()); - out = fopen(newname, "w"); + sprintf(newname, "%s%s", dirname, basename); + env = getenv("KCONFIG_OVERWRITECONFIG"); + if (!env || !*env) { + sprintf(tmpname, "%s.tmpconfig.%d", dirname, (int)getpid()); + out = fopen(tmpname, "w"); + } else { + *tmpname = 0; + out = fopen(newname, "w"); + } if (!out) return 1; - out_h = NULL; - if (!name) { - out_h = fopen(".tmpconfig.h", "w"); - if (!out_h) - return 1; - file_write_dep(NULL); - } + sym = sym_lookup("KERNELVERSION", 0); sym_calc_value(sym); time(&now); @@ -381,38 +445,14 @@ fprintf(out, _("#\n" "# Automatically generated make config: don't edit\n" - "# Buildrom version: %s\n" + "# buildrom version: %s\n" "%s%s" "#\n"), - sym_get_string_value(sym), + getenv("KERNELVERSION"), use_timestamp ? "# " : "", use_timestamp ? ctime(&now) : ""); - if (out_h) { - char buf[sizeof("#define AUTOCONF_TIMESTAMP " - "\"YYYY-MM-DD HH:MM:SS some_timezone\"\n")]; - buf[0] = '\0'; - if (use_timestamp) { - size_t ret = \ - strftime(buf, sizeof(buf), "#define AUTOCONF_TIMESTAMP " - "\"%Y-%m-%d %H:%M:%S %Z\"\n", localtime(&now)); - /* if user has Factory timezone or some other odd install, the - * %Z above will overflow the string leaving us with undefined - * results ... so let's try again without the timezone. - */ - if (ret == 0) - strftime(buf, sizeof(buf), "#define AUTOCONF_TIMESTAMP " - "\"%Y-%m-%d %H:%M:%S\"\n", localtime(&now)); - } - fprintf(out_h, "/*\n" - " * Automatically generated C config: don't edit\n" - " * Buildrom version: %s\n" - " */\n" - "%s" - "\n", - sym_get_string_value(sym), - buf); - } - if (!sym_change_count) + + if (!conf_get_changed()) sym_clear_all_valid(); menu = rootmenu.list; @@ -426,17 +466,10 @@ "#\n" "# %s\n" "#\n", str); - if (out_h) - fprintf(out_h, "\n" - "/*\n" - " * %s\n" - " */\n", str); } else if (!(sym->flags & SYMBOL_CHOICE)) { sym_calc_value(sym); -/* bbox: we want to all syms if (!(sym->flags & SYMBOL_WRITE)) goto next; -*/ sym->flags &= ~SYMBOL_WRITE; type = sym->type; if (type == S_TRISTATE) { @@ -450,84 +483,39 @@ switch (sym_get_tristate_value(sym)) { case no: fprintf(out, "# CONFIG_%s is not set\n", sym->name); - if (out_h) { - fprintf(out_h, "#undef CONFIG_%s\n", sym->name); - /* bbox */ - fprintf(out_h, "#define ENABLE_%s 0\n", sym->name); - fprintf(out_h, "#define USE_%s(...)\n", sym->name); - fprintf(out_h, "#define SKIP_%s(...) __VA_ARGS__\n", sym->name); - } break; case mod: fprintf(out, "CONFIG_%s=m\n", sym->name); - if (out_h) - fprintf(out_h, "#define CONFIG_%s_MODULE 1\n", sym->name); break; case yes: fprintf(out, "CONFIG_%s=y\n", sym->name); - if (out_h) { - fprintf(out_h, "#define CONFIG_%s 1\n", sym->name); - /* bbox */ - fprintf(out_h, "#define ENABLE_%s 1\n", sym->name); - fprintf(out_h, "#define USE_%s(...) __VA_ARGS__\n", sym->name); - fprintf(out_h, "#define SKIP_%s(...)\n", sym->name); - } break; } break; case S_STRING: - // fix me str = sym_get_string_value(sym); fprintf(out, "CONFIG_%s=\"", sym->name); - if (out_h) - fprintf(out_h, "#define CONFIG_%s \"", sym->name); - do { + while (1) { l = strcspn(str, "\"\\"); if (l) { fwrite(str, l, 1, out); - if (out_h) - fwrite(str, l, 1, out_h); + str += l; } - str += l; - while (*str == '\\' || *str == '"') { - fprintf(out, "\\%c", *str); - if (out_h) - fprintf(out_h, "\\%c", *str); - str++; - } - } while (*str); + if (!*str) + break; + fprintf(out, "\\%c", *str++); + } fputs("\"\n", out); - if (out_h) { - fputs("\"\n", out_h); - /* bbox */ - fprintf(out_h, "#define ENABLE_%s 1\n", sym->name); - fprintf(out_h, "#define USE_%s(...) __VA_ARGS__\n", sym->name); - fprintf(out_h, "#define SKIP_%s(...)\n", sym->name); - } break; case S_HEX: str = sym_get_string_value(sym); if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) { fprintf(out, "CONFIG_%s=%s\n", sym->name, str); - if (out_h) { - fprintf(out_h, "#define CONFIG_%s 0x%s\n", sym->name, str); - /* bbox */ - fprintf(out_h, "#define ENABLE_%s 1\n", sym->name); - fprintf(out_h, "#define USE_%s(...) __VA_ARGS__\n", sym->name); - fprintf(out_h, "#define SKIP_%s(...)\n", sym->name); - } break; } case S_INT: str = sym_get_string_value(sym); fprintf(out, "CONFIG_%s=%s\n", sym->name, str); - if (out_h) { - fprintf(out_h, "#define CONFIG_%s %s\n", sym->name, str); - /* bbox */ - fprintf(out_h, "#define ENABLE_%s 1\n", sym->name); - fprintf(out_h, "#define USE_%s(...) __VA_ARGS__\n", sym->name); - fprintf(out_h, "#define SKIP_%s(...)\n", sym->name); - } break; } } @@ -547,21 +535,282 @@ } } fclose(out); - if (out_h) { - fclose(out_h); - rename(".tmpconfig.h", "include/autoconf.h"); + + if (*tmpname) { + strcat(dirname, basename); + strcat(dirname, ".old"); + rename(newname, dirname); + if (rename(tmpname, newname)) + return 1; } - if (!name || basename != conf_def_filename) { - if (!name) - name = conf_def_filename; - sprintf(tmpname, "%s.old", name); - rename(name, tmpname); + + printf(_("#\n" + "# configuration written to %s\n" + "#\n"), newname); + + sym_set_change_count(0); + + return 0; +} + +int conf_split_config(void) +{ + char *name, path[128]; + char *s, *d, c; + struct symbol *sym; + struct stat sb; + int res, i, fd; + + name = getenv("KCONFIG_AUTOCONFIG"); + if (!name) + name = "include/config/auto.conf"; + conf_read_simple(name, S_DEF_AUTO); + + if (chdir("build")) + return 1; + + res = 0; + for_all_symbols(i, sym) { + sym_calc_value(sym); + if ((sym->flags & SYMBOL_AUTO) || !sym->name) + continue; + if (sym->flags & SYMBOL_WRITE) { + if (sym->flags & SYMBOL_DEF_AUTO) { + /* + * symbol has old and new value, + * so compare them... + */ + switch (sym->type) { + case S_BOOLEAN: + case S_TRISTATE: + if (sym_get_tristate_value(sym) == + sym->def[S_DEF_AUTO].tri) + continue; + break; + case S_STRING: + case S_HEX: + case S_INT: + if (!strcmp(sym_get_string_value(sym), + sym->def[S_DEF_AUTO].val)) + continue; + break; + default: + break; + } + } else { + /* + * If there is no old value, only 'no' (unset) + * is allowed as new value. + */ + switch (sym->type) { + case S_BOOLEAN: + case S_TRISTATE: + if (sym_get_tristate_value(sym) == no) + continue; + break; + default: + break; + } + } + } else if (!(sym->flags & SYMBOL_DEF_AUTO)) + /* There is neither an old nor a new value. */ + continue; + /* else + * There is an old value, but no new value ('no' (unset) + * isn't saved in auto.conf, so the old value is always + * different from 'no'). + */ + + /* Replace all '_' and append ".h" */ + s = sym->name; + d = path; + while ((c = *s++)) { + c = tolower(c); + *d++ = (c == '_') ? '/' : c; + } + strcpy(d, ".h"); + + /* Assume directory path already exists. */ + fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644); + if (fd == -1) { + if (errno != ENOENT) { + res = 1; + break; + } + /* + * Create directory components, + * unless they exist already. + */ + d = path; + while ((d = strchr(d, '/'))) { + *d = 0; + if (stat(path, &sb) && mkdir(path, 0755)) { + res = 1; + goto out; + } + *d++ = '/'; + } + /* Try it again. */ + fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644); + if (fd == -1) { + res = 1; + break; + } + } + close(fd); } - sprintf(tmpname, "%s%s", dirname, basename); - if (rename(newname, tmpname)) +out: + if (chdir("../..")) return 1; - sym_change_count = 0; + return res; +} +int conf_write_autoconf(void) +{ + struct symbol *sym; + const char *str; + char *name; + FILE *out, *out_h; + time_t now; + int i, l; + + sym_clear_all_valid(); + + file_write_dep("build/auto.conf.cmd"); + +#if 0 + if (conf_split_config()) + return 1; +#endif + + out = fopen(".tmpconfig", "w"); + if (!out) + return 1; + + out_h = fopen(".tmpconfig.h", "w"); + if (!out_h) { + fclose(out); + return 1; + } + + sym = sym_lookup("KERNELVERSION", 0); + sym_calc_value(sym); + time(&now); + fprintf(out, "#\n" + "# Automatically generated make config: don't edit\n" + "# buildrom version: %s\n" + "# %s" + "#\n", + getenv("KERNELVERSION"), ctime(&now)); + fprintf(out_h, "/*\n" + " * Automatically generated C config: don't edit\n" + " * buildrom version: %s\n" + " * %s" + " */\n" + "#define AUTOCONF_INCLUDED\n", + getenv("KERNELVERSION"), ctime(&now)); + + for_all_symbols(i, sym) { + sym_calc_value(sym); + if (!(sym->flags & SYMBOL_WRITE) || !sym->name) + continue; + switch (sym->type) { + case S_BOOLEAN: + case S_TRISTATE: + switch (sym_get_tristate_value(sym)) { + case no: + break; + case mod: + fprintf(out, "CONFIG_%s=m\n", sym->name); + fprintf(out_h, "#define CONFIG_%s_MODULE 1\n", sym->name); + break; + case yes: + fprintf(out, "CONFIG_%s=y\n", sym->name); + fprintf(out_h, "#define CONFIG_%s 1\n", sym->name); + break; + } + break; + case S_STRING: + str = sym_get_string_value(sym); + fprintf(out, "CONFIG_%s=\"", sym->name); + fprintf(out_h, "#define CONFIG_%s \"", sym->name); + while (1) { + l = strcspn(str, "\"\\"); + if (l) { + fwrite(str, l, 1, out); + fwrite(str, l, 1, out_h); + str += l; + } + if (!*str) + break; + fprintf(out, "\\%c", *str); + fprintf(out_h, "\\%c", *str); + str++; + } + fputs("\"\n", out); + fputs("\"\n", out_h); + break; + case S_HEX: + str = sym_get_string_value(sym); + if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) { + fprintf(out, "CONFIG_%s=%s\n", sym->name, str); + fprintf(out_h, "#define CONFIG_%s 0x%s\n", sym->name, str); + break; + } + case S_INT: + str = sym_get_string_value(sym); + fprintf(out, "CONFIG_%s=%s\n", sym->name, str); + fprintf(out_h, "#define CONFIG_%s %s\n", sym->name, str); + break; + default: + break; + } + } + fclose(out); + fclose(out_h); + + name = getenv("KCONFIG_AUTOHEADER"); + if (!name) + name = "include/linux/autoconf.h"; + if (rename(".tmpconfig.h", name)) + return 1; + name = getenv("KCONFIG_AUTOCONFIG"); + if (!name) + name = "include/config/auto.conf"; + /* + * This must be the last step, kbuild has a dependency on auto.conf + * and this marks the successful completion of the previous steps. + */ + if (rename(".tmpconfig", name)) + return 1; + return 0; } + +static int sym_change_count; +static void (*conf_changed_callback)(void); + +void sym_set_change_count(int count) +{ + int _sym_change_count = sym_change_count; + sym_change_count = count; + if (conf_changed_callback && + (bool)_sym_change_count != (bool)count) + conf_changed_callback(); +} + +void sym_add_change_count(int count) +{ + sym_set_change_count(count + sym_change_count); +} + +bool conf_get_changed(void) +{ + return sym_change_count; +} + +void conf_set_changed_callback(void (*fn)(void)) +{ + conf_changed_callback = fn; +} Modified: buildrom-devel/scripts/kconfig/expr.c =================================================================== --- buildrom-devel/scripts/kconfig/expr.c 2008-07-01 21:13:46 UTC (rev 209) +++ buildrom-devel/scripts/kconfig/expr.c 2008-07-02 19:45:34 UTC (rev 210) @@ -87,7 +87,7 @@ break; case E_AND: case E_OR: - case E_CHOICE: + case E_LIST: e->left.expr = expr_copy(org->left.expr); e->right.expr = expr_copy(org->right.expr); break; @@ -145,7 +145,8 @@ return; } if (e1->type == E_SYMBOL && e2->type == E_SYMBOL && - e1->left.sym == e2->left.sym && (e1->left.sym->flags & (SYMBOL_YES|SYMBOL_NO))) + e1->left.sym == e2->left.sym && + (e1->left.sym == &symbol_yes || e1->left.sym == &symbol_no)) return; if (!expr_eq(e1, e2)) return; @@ -216,7 +217,7 @@ expr_free(e2); trans_count = old_count; return res; - case E_CHOICE: + case E_LIST: case E_RANGE: case E_NONE: /* panic */; @@ -647,7 +648,7 @@ case E_EQUAL: case E_UNEQUAL: case E_SYMBOL: - case E_CHOICE: + case E_LIST: break; default: e->left.expr = expr_transform(e->left.expr); @@ -931,7 +932,7 @@ break; case E_SYMBOL: return expr_alloc_comp(type, e->left.sym, sym); - case E_CHOICE: + case E_LIST: case E_RANGE: case E_NONE: /* panic */; @@ -954,14 +955,14 @@ case E_AND: val1 = expr_calc_value(e->left.expr); val2 = expr_calc_value(e->right.expr); - return E_AND(val1, val2); + return EXPR_AND(val1, val2); case E_OR: val1 = expr_calc_value(e->left.expr); val2 = expr_calc_value(e->right.expr); - return E_OR(val1, val2); + return EXPR_OR(val1, val2); case E_NOT: val1 = expr_calc_value(e->left.expr); - return E_NOT(val1); + return EXPR_NOT(val1); case E_EQUAL: sym_calc_value(e->left.sym); sym_calc_value(e->right.sym); @@ -999,9 +1000,9 @@ if (t2 == E_OR) return 1; case E_OR: - if (t2 == E_CHOICE) + if (t2 == E_LIST) return 1; - case E_CHOICE: + case E_LIST: if (t2 == 0) return 1; default: @@ -1012,73 +1013,79 @@ #endif } -void expr_print(struct expr *e, void (*fn)(void *, const char *), void *data, int prevtoken) +void expr_print(struct expr *e, void (*fn)(void *, struct symbol *, const char *), void *data, int prevtoken) { if (!e) { - fn(data, "y"); + fn(data, NULL, "y"); return; } if (expr_compare_type(prevtoken, e->type) > 0) - fn(data, "("); + fn(data, NULL, "("); switch (e->type) { case E_SYMBOL: if (e->left.sym->name) - fn(data, e->left.sym->name); + fn(data, e->left.sym, e->left.sym->name); else - fn(data, ""); + fn(data, NULL, ""); break; case E_NOT: - fn(data, "!"); + fn(data, NULL, "!"); expr_print(e->left.expr, fn, data, E_NOT); break; case E_EQUAL: - fn(data, e->left.sym->name); - fn(data, "="); - fn(data, e->right.sym->name); + if (e->left.sym->name) + fn(data, e->left.sym, e->left.sym->name); + else + fn(data, NULL, ""); + fn(data, NULL, "="); + fn(data, e->right.sym, e->right.sym->name); break; case E_UNEQUAL: - fn(data, e->left.sym->name); - fn(data, "!="); - fn(data, e->right.sym->name); + if (e->left.sym->name) + fn(data, e->left.sym, e->left.sym->name); + else + fn(data, NULL, ""); + fn(data, NULL, "!="); + fn(data, e->right.sym, e->right.sym->name); break; case E_OR: expr_print(e->left.expr, fn, data, E_OR); - fn(data, " || "); + fn(data, NULL, " || "); expr_print(e->right.expr, fn, data, E_OR); break; case E_AND: expr_print(e->left.expr, fn, data, E_AND); - fn(data, " && "); + fn(data, NULL, " && "); expr_print(e->right.expr, fn, data, E_AND); break; - case E_CHOICE: - fn(data, e->right.sym->name); + case E_LIST: + fn(data, e->right.sym, e->right.sym->name); if (e->left.expr) { - fn(data, " ^ "); - expr_print(e->left.expr, fn, data, E_CHOICE); + fn(data, NULL, " ^ "); + expr_print(e->left.expr, fn, data, E_LIST); } break; case E_RANGE: - fn(data, "["); - fn(data, e->left.sym->name); - fn(data, " "); - fn(data, e->right.sym->name); - fn(data, "]"); + fn(data, NULL, "["); + fn(data, e->left.sym, e->left.sym->name); + fn(data, NULL, " "); + fn(data, e->right.sym, e->right.sym->name); + fn(data, NULL, "]"); break; default: { char buf[32]; sprintf(buf, "", e->type); - fn(data, buf); + fn(data, NULL, buf); break; } } if (expr_compare_type(prevtoken, e->type) > 0) - fn(data, ")"); + fn(data, NULL, ")"); } -static void expr_print_file_helper(void *data, const char *str) +static void expr_print_file_helper(void *data, struct symbol *sym, const char *str) { fwrite(str, strlen(str), 1, data); } @@ -1088,7 +1095,7 @@ expr_print(e, expr_print_file_helper, out, E_NONE); } -static void expr_print_gstr_helper(void *data, const char *str) +static void expr_print_gstr_helper(void *data, struct symbol *sym, const char *str) { str_append((struct gstr*)data, str); } Modified: buildrom-devel/scripts/kconfig/expr.h =================================================================== --- buildrom-devel/scripts/kconfig/expr.h 2008-07-01 21:13:46 UTC (rev 209) +++ buildrom-devel/scripts/kconfig/expr.h 2008-07-02 19:45:34 UTC (rev 210) @@ -25,14 +25,13 @@ #define FILE_BUSY 0x0001 #define FILE_SCANNED 0x0002 -#define FILE_PRINTED 0x0004 typedef enum tristate { no, mod, yes } tristate; enum expr_type { - E_NONE, E_OR, E_AND, E_NOT, E_EQUAL, E_UNEQUAL, E_CHOICE, E_SYMBOL, E_RANGE + E_NONE, E_OR, E_AND, E_NOT, E_EQUAL, E_UNEQUAL, E_LIST, E_SYMBOL, E_RANGE }; union expr_data { @@ -45,10 +44,13 @@ union expr_data left, right; }; -#define E_OR(dep1, dep2) (((dep1)>(dep2))?(dep1):(dep2)) -#define E_AND(dep1, dep2) (((dep1)<(dep2))?(dep1):(dep2)) -#define E_NOT(dep) (2-(dep)) +#define EXPR_OR(dep1, dep2) (((dep1)>(dep2))?(dep1):(dep2)) +#define EXPR_AND(dep1, dep2) (((dep1)<(dep2))?(dep1):(dep2)) +#define EXPR_NOT(dep) (2-(dep)) +#define expr_list_for_each_sym(l, e, s) \ + for (e = (l); e && (s = e->right.sym); e = e->left.expr) + struct expr_value { struct expr *expr; tristate tri; @@ -63,44 +65,49 @@ S_UNKNOWN, S_BOOLEAN, S_TRISTATE, S_INT, S_HEX, S_STRING, S_OTHER }; +enum { + S_DEF_USER, /* main user value */ + S_DEF_AUTO, +}; + struct symbol { struct symbol *next; char *name; - char *help; enum symbol_type type; - struct symbol_value curr, user; + struct symbol_value curr; + struct symbol_value def[4]; tristate visible; int flags; struct property *prop; - struct expr *dep, *dep2; struct expr_value rev_dep; }; #define for_all_symbols(i, sym) for (i = 0; i < 257; i++) for (sym = symbol_hash[i]; sym; sym = sym->next) if (sym->type != S_OTHER) -#define SYMBOL_YES 0x0001 -#define SYMBOL_MOD 0x0002 -#define SYMBOL_NO 0x0004 -#define SYMBOL_CONST 0x0007 +#define SYMBOL_CONST 0x0001 #define SYMBOL_CHECK 0x0008 #define SYMBOL_CHOICE 0x0010 #define SYMBOL_CHOICEVAL 0x0020 -#define SYMBOL_PRINTED 0x0040 #define SYMBOL_VALID 0x0080 #define SYMBOL_OPTIONAL 0x0100 #define SYMBOL_WRITE 0x0200 #define SYMBOL_CHANGED 0x0400 -#define SYMBOL_NEW 0x0800 #define SYMBOL_AUTO 0x1000 #define SYMBOL_CHECKED 0x2000 #define SYMBOL_WARNED 0x8000 +#define SYMBOL_DEF 0x10000 +#define SYMBOL_DEF_USER 0x10000 +#define SYMBOL_DEF_AUTO 0x20000 +#define SYMBOL_DEF3 0x40000 +#define SYMBOL_DEF4 0x80000 #define SYMBOL_MAXLENGTH 256 #define SYMBOL_HASHSIZE 257 #define SYMBOL_HASHMASK 0xff enum prop_type { - P_UNKNOWN, P_PROMPT, P_COMMENT, P_MENU, P_DEFAULT, P_CHOICE, P_SELECT, P_RANGE + P_UNKNOWN, P_PROMPT, P_COMMENT, P_MENU, P_DEFAULT, P_CHOICE, + P_SELECT, P_RANGE, P_ENV }; struct property { @@ -132,7 +139,7 @@ struct property *prompt; struct expr *dep; unsigned int flags; - //char *help; + char *help; struct file *file; int lineno; void *data; @@ -149,6 +156,7 @@ extern struct symbol symbol_yes, symbol_no, symbol_mod; extern struct symbol *modules_sym; +extern struct symbol *sym_defconfig_list; extern int cdebug; struct expr *expr_alloc_symbol(struct symbol *sym); struct expr *expr_alloc_one(enum expr_type type, struct expr *ce); Added: buildrom-devel/scripts/kconfig/gconf.c =================================================================== --- buildrom-devel/scripts/kconfig/gconf.c (rev 0) +++ buildrom-devel/scripts/kconfig/gconf.c 2008-07-02 19:45:34 UTC (rev 210) @@ -0,0 +1,1636 @@ +/* Hey EMACS -*- linux-c -*- */ +/* + * + * Copyright (C) 2002-2003 Romain Lievin + * Released under the terms of the GNU GPL v2.0. + * + */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "lkc.h" +#include "images.c" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +//#define DEBUG + +enum { + SINGLE_VIEW, SPLIT_VIEW, FULL_VIEW +}; + +static gint view_mode = FULL_VIEW; +static gboolean show_name = TRUE; +static gboolean show_range = TRUE; +static gboolean show_value = TRUE; +static gboolean show_all = FALSE; +static gboolean show_debug = FALSE; +static gboolean resizeable = FALSE; + +GtkWidget *main_wnd = NULL; +GtkWidget *tree1_w = NULL; // left frame +GtkWidget *tree2_w = NULL; // right frame +GtkWidget *text_w = NULL; +GtkWidget *hpaned = NULL; +GtkWidget *vpaned = NULL; +GtkWidget *back_btn = NULL; +GtkWidget *save_btn = NULL; +GtkWidget *save_menu_item = NULL; + +GtkTextTag *tag1, *tag2; +GdkColor color; + +GtkTreeStore *tree1, *tree2, *tree; +GtkTreeModel *model1, *model2; +static GtkTreeIter *parents[256]; +static gint indent; + +static struct menu *current; // current node for SINGLE view +static struct menu *browsed; // browsed node for SPLIT view + +enum { + COL_OPTION, COL_NAME, COL_NO, COL_MOD, COL_YES, COL_VALUE, + COL_MENU, COL_COLOR, COL_EDIT, COL_PIXBUF, + COL_PIXVIS, COL_BTNVIS, COL_BTNACT, COL_BTNINC, COL_BTNRAD, + COL_NUMBER +}; + +static void display_list(void); +static void display_tree(struct menu *menu); +static void display_tree_part(void); +static void update_tree(struct menu *src, GtkTreeIter * dst); +static void set_node(GtkTreeIter * node, struct menu *menu, gchar ** row); +static gchar **fill_row(struct menu *menu); +static void conf_changed(void); + +/* Helping/Debugging Functions */ + + +const char *dbg_print_stype(int val) +{ + static char buf[256]; + + bzero(buf, 256); + + if (val == S_UNKNOWN) + strcpy(buf, "unknown"); + if (val == S_BOOLEAN) + strcpy(buf, "boolean"); + if (val == S_TRISTATE) + strcpy(buf, "tristate"); + if (val == S_INT) + strcpy(buf, "int"); + if (val == S_HEX) + strcpy(buf, "hex"); + if (val == S_STRING) + strcpy(buf, "string"); + if (val == S_OTHER) + strcpy(buf, "other"); + +#ifdef DEBUG + printf("%s", buf); +#endif + + return buf; +} + +const char *dbg_print_flags(int val) +{ + static char buf[256]; + + bzero(buf, 256); + + if (val & SYMBOL_CONST) + strcat(buf, "const/"); + if (val & SYMBOL_CHECK) + strcat(buf, "check/"); + if (val & SYMBOL_CHOICE) + strcat(buf, "choice/"); + if (val & SYMBOL_CHOICEVAL) + strcat(buf, "choiceval/"); + if (val & SYMBOL_VALID) + strcat(buf, "valid/"); + if (val & SYMBOL_OPTIONAL) + strcat(buf, "optional/"); + if (val & SYMBOL_WRITE) + strcat(buf, "write/"); + if (val & SYMBOL_CHANGED) + strcat(buf, "changed/"); + if (val & SYMBOL_AUTO) + strcat(buf, "auto/"); + + buf[strlen(buf) - 1] = '\0'; +#ifdef DEBUG + printf("%s", buf); +#endif + + return buf; +} + +const char *dbg_print_ptype(int val) +{ + static char buf[256]; + + bzero(buf, 256); + + if (val == P_UNKNOWN) + strcpy(buf, "unknown"); + if (val == P_PROMPT) + strcpy(buf, "prompt"); + if (val == P_COMMENT) + strcpy(buf, "comment"); + if (val == P_MENU) + strcpy(buf, "menu"); + if (val == P_DEFAULT) + strcpy(buf, "default"); + if (val == P_CHOICE) + strcpy(buf, "choice"); + +#ifdef DEBUG + printf("%s", buf); +#endif + + return buf; +} + + +void replace_button_icon(GladeXML * xml, GdkDrawable * window, + GtkStyle * style, gchar * btn_name, gchar ** xpm) +{ + GdkPixmap *pixmap; + GdkBitmap *mask; + GtkToolButton *button; + GtkWidget *image; + + pixmap = gdk_pixmap_create_from_xpm_d(window, &mask, + &style->bg[GTK_STATE_NORMAL], + xpm); + + button = GTK_TOOL_BUTTON(glade_xml_get_widget(xml, btn_name)); + image = gtk_image_new_from_pixmap(pixmap, mask); + gtk_widget_show(image); + gtk_tool_button_set_icon_widget(button, image); +} + +/* Main Window Initialization */ +void init_main_window(const gchar * glade_file) +{ + GladeXML *xml; + GtkWidget *widget; + GtkTextBuffer *txtbuf; + char title[256]; + GtkStyle *style; + + xml = glade_xml_new(glade_file, "window1", NULL); + if (!xml) + g_error(_("GUI loading failed !\n")); + glade_xml_signal_autoconnect(xml); + + main_wnd = glade_xml_get_widget(xml, "window1"); + hpaned = glade_xml_get_widget(xml, "hpaned1"); + vpaned = glade_xml_get_widget(xml, "vpaned1"); + tree1_w = glade_xml_get_widget(xml, "treeview1"); + tree2_w = glade_xml_get_widget(xml, "treeview2"); + text_w = glade_xml_get_widget(xml, "textview3"); + + back_btn = glade_xml_get_widget(xml, "button1"); + gtk_widget_set_sensitive(back_btn, FALSE); + + widget = glade_xml_get_widget(xml, "show_name1"); + gtk_check_menu_item_set_active((GtkCheckMenuItem *) widget, + show_name); + + widget = glade_xml_get_widget(xml, "show_range1"); + gtk_check_menu_item_set_active((GtkCheckMenuItem *) widget, + show_range); + + widget = glade_xml_get_widget(xml, "show_data1"); + gtk_check_menu_item_set_active((GtkCheckMenuItem *) widget, + show_value); + + save_btn = glade_xml_get_widget(xml, "button3"); + save_menu_item = glade_xml_get_widget(xml, "save1"); + conf_set_changed_callback(conf_changed); + + style = gtk_widget_get_style(main_wnd); + widget = glade_xml_get_widget(xml, "toolbar1"); + +#if 0 /* Use stock Gtk icons instead */ + replace_button_icon(xml, main_wnd->window, style, + "button1", (gchar **) xpm_back); + replace_button_icon(xml, main_wnd->window, style, + "button2", (gchar **) xpm_load); + replace_button_icon(xml, main_wnd->window, style, + "button3", (gchar **) xpm_save); +#endif + replace_button_icon(xml, main_wnd->window, style, + "button4", (gchar **) xpm_single_view); + replace_button_icon(xml, main_wnd->window, style, + "button5", (gchar **) xpm_split_view); + replace_button_icon(xml, main_wnd->window, style, + "button6", (gchar **) xpm_tree_view); + +#if 0 + switch (view_mode) { + case SINGLE_VIEW: + widget = glade_xml_get_widget(xml, "button4"); + g_signal_emit_by_name(widget, "clicked"); + break; + case SPLIT_VIEW: + widget = glade_xml_get_widget(xml, "button5"); + g_signal_emit_by_name(widget, "clicked"); + break; + case FULL_VIEW: + widget = glade_xml_get_widget(xml, "button6"); + g_signal_emit_by_name(widget, "clicked"); + break; + } +#endif + txtbuf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_w)); + tag1 = gtk_text_buffer_create_tag(txtbuf, "mytag1", + "foreground", "red", + "weight", PANGO_WEIGHT_BOLD, + NULL); + tag2 = gtk_text_buffer_create_tag(txtbuf, "mytag2", + /*"style", PANGO_STYLE_OBLIQUE, */ + NULL); + + sprintf(title, _("buildrom v%s Configuration"), + getenv("KERNELVERSION")); + gtk_window_set_title(GTK_WINDOW(main_wnd), title); + + gtk_widget_show(main_wnd); +} + +void init_tree_model(void) +{ + gint i; + + tree = tree2 = gtk_tree_store_new(COL_NUMBER, + G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_POINTER, GDK_TYPE_COLOR, + G_TYPE_BOOLEAN, GDK_TYPE_PIXBUF, + G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, + G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, + G_TYPE_BOOLEAN); + model2 = GTK_TREE_MODEL(tree2); + + for (parents[0] = NULL, i = 1; i < 256; i++) + parents[i] = (GtkTreeIter *) g_malloc(sizeof(GtkTreeIter)); + + tree1 = gtk_tree_store_new(COL_NUMBER, + G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_POINTER, GDK_TYPE_COLOR, + G_TYPE_BOOLEAN, GDK_TYPE_PIXBUF, + G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, + G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, + G_TYPE_BOOLEAN); + model1 = GTK_TREE_MODEL(tree1); +} + +void init_left_tree(void) +{ + GtkTreeView *view = GTK_TREE_VIEW(tree1_w); + GtkCellRenderer *renderer; + GtkTreeSelection *sel; + GtkTreeViewColumn *column; + + gtk_tree_view_set_model(view, model1); + gtk_tree_view_set_headers_visible(view, TRUE); + gtk_tree_view_set_rules_hint(view, FALSE); + + column = gtk_tree_view_column_new(); + gtk_tree_view_append_column(view, column); + gtk_tree_view_column_set_title(column, _("Options")); + + renderer = gtk_cell_renderer_toggle_new(); + gtk_tree_view_column_pack_start(GTK_TREE_VIEW_COLUMN(column), + renderer, FALSE); + gtk_tree_view_column_set_attributes(GTK_TREE_VIEW_COLUMN(column), + renderer, + "active", COL_BTNACT, + "inconsistent", COL_BTNINC, + "visible", COL_BTNVIS, + "radio", COL_BTNRAD, NULL); + renderer = gtk_cell_renderer_text_new(); + gtk_tree_view_column_pack_start(GTK_TREE_VIEW_COLUMN(column), + renderer, FALSE); + gtk_tree_view_column_set_attributes(GTK_TREE_VIEW_COLUMN(column), + renderer, + "text", COL_OPTION, + "foreground-gdk", + COL_COLOR, NULL); + + sel = gtk_tree_view_get_selection(view); + gtk_tree_selection_set_mode(sel, GTK_SELECTION_SINGLE); + gtk_widget_realize(tree1_w); +} + +static void renderer_edited(GtkCellRendererText * cell, + const gchar * path_string, + const gchar * new_text, gpointer user_data); +static void renderer_toggled(GtkCellRendererToggle * cellrenderertoggle, + gchar * arg1, gpointer user_data); + +void init_right_tree(void) +{ + GtkTreeView *view = GTK_TREE_VIEW(tree2_w); + GtkCellRenderer *renderer; + GtkTreeSelection *sel; + GtkTreeViewColumn *column; + gint i; + + gtk_tree_view_set_model(view, model2); + gtk_tree_view_set_headers_visible(view, TRUE); + gtk_tree_view_set_rules_hint(view, FALSE); + + column = gtk_tree_view_column_new(); + gtk_tree_view_append_column(view, column); + gtk_tree_view_column_set_title(column, _("Options")); + + renderer = gtk_cell_renderer_pixbuf_new(); + gtk_tree_view_column_pack_start(GTK_TREE_VIEW_COLUMN(column), + renderer, FALSE); + gtk_tree_view_column_set_attributes(GTK_TREE_VIEW_COLUMN(column), + renderer, + "pixbuf", COL_PIXBUF, + "visible", COL_PIXVIS, NULL); + renderer = gtk_cell_renderer_toggle_new(); + gtk_tree_view_column_pack_start(GTK_TREE_VIEW_COLUMN(column), + renderer, FALSE); + gtk_tree_view_column_set_attributes(GTK_TREE_VIEW_COLUMN(column), + renderer, + "active", COL_BTNACT, + "inconsistent", COL_BTNINC, + "visible", COL_BTNVIS, + "radio", COL_BTNRAD, NULL); + /*g_signal_connect(G_OBJECT(renderer), "toggled", + G_CALLBACK(renderer_toggled), NULL); */ + renderer = gtk_cell_renderer_text_new(); + gtk_tree_view_column_pack_start(GTK_TREE_VIEW_COLUMN(column), + renderer, FALSE); + gtk_tree_view_column_set_attributes(GTK_TREE_VIEW_COLUMN(column), + renderer, + "text", COL_OPTION, + "foreground-gdk", + COL_COLOR, NULL); + + renderer = gtk_cell_renderer_text_new(); + gtk_tree_view_insert_column_with_attributes(view, -1, + _("Name"), renderer, + "text", COL_NAME, + "foreground-gdk", + COL_COLOR, NULL); + renderer = gtk_cell_renderer_text_new(); + gtk_tree_view_insert_column_with_attributes(view, -1, + "N", renderer, + "text", COL_NO, + "foreground-gdk", + COL_COLOR, NULL); + renderer = gtk_cell_renderer_text_new(); + gtk_tree_view_insert_column_with_attributes(view, -1, + "M", renderer, + "text", COL_MOD, + "foreground-gdk", + COL_COLOR, NULL); + renderer = gtk_cell_renderer_text_new(); + gtk_tree_view_insert_column_with_attributes(view, -1, + "Y", renderer, + "text", COL_YES, + "foreground-gdk", + COL_COLOR, NULL); + renderer = gtk_cell_renderer_text_new(); + gtk_tree_view_insert_column_with_attributes(view, -1, + _("Value"), renderer, + "text", COL_VALUE, + "editable", + COL_EDIT, + "foreground-gdk", + COL_COLOR, NULL); + g_signal_connect(G_OBJECT(renderer), "edited", + G_CALLBACK(renderer_edited), NULL); + + column = gtk_tree_view_get_column(view, COL_NAME); + gtk_tree_view_column_set_visible(column, show_name); + column = gtk_tree_view_get_column(view, COL_NO); + gtk_tree_view_column_set_visible(column, show_range); + column = gtk_tree_view_get_column(view, COL_MOD); + gtk_tree_view_column_set_visible(column, show_range); + column = gtk_tree_view_get_column(view, COL_YES); + gtk_tree_view_column_set_visible(column, show_range); + column = gtk_tree_view_get_column(view, COL_VALUE); + gtk_tree_view_column_set_visible(column, show_value); + + if (resizeable) { + for (i = 0; i < COL_VALUE; i++) { + column = gtk_tree_view_get_column(view, i); + gtk_tree_view_column_set_resizable(column, TRUE); + } + } + + sel = gtk_tree_view_get_selection(view); + gtk_tree_selection_set_mode(sel, GTK_SELECTION_SINGLE); +} + + +/* Utility Functions */ + + +static void text_insert_help(struct menu *menu) +{ + GtkTextBuffer *buffer; + GtkTextIter start, end; + const char *prompt = _(menu_get_prompt(menu)); + gchar *name; + const char *help; + + help = menu_get_help(menu); + + /* Gettextize if the help text not empty */ + if ((help != 0) && (help[0] != 0)) + help = _(help); + + if (menu->sym && menu->sym->name) + name = g_strdup_printf(menu->sym->name); + else + name = g_strdup(""); + + buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_w)); + gtk_text_buffer_get_bounds(buffer, &start, &end); + gtk_text_buffer_delete(buffer, &start, &end); + gtk_text_view_set_left_margin(GTK_TEXT_VIEW(text_w), 15); + + gtk_text_buffer_get_end_iter(buffer, &end); + gtk_text_buffer_insert_with_tags(buffer, &end, prompt, -1, tag1, + NULL); + gtk_text_buffer_insert_at_cursor(buffer, " ", 1); + gtk_text_buffer_get_end_iter(buffer, &end); + gtk_text_buffer_insert_with_tags(buffer, &end, name, -1, tag1, + NULL); + gtk_text_buffer_insert_at_cursor(buffer, "\n\n", 2); + gtk_text_buffer_get_end_iter(buffer, &end); + gtk_text_buffer_insert_with_tags(buffer, &end, help, -1, tag2, + NULL); +} + + +static void text_insert_msg(const char *title, const char *message) +{ + GtkTextBuffer *buffer; + GtkTextIter start, end; + const char *msg = message; + + buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_w)); + gtk_text_buffer_get_bounds(buffer, &start, &end); + gtk_text_buffer_delete(buffer, &start, &end); + gtk_text_view_set_left_margin(GTK_TEXT_VIEW(text_w), 15); + + gtk_text_buffer_get_end_iter(buffer, &end); + gtk_text_buffer_insert_with_tags(buffer, &end, title, -1, tag1, + NULL); + gtk_text_buffer_insert_at_cursor(buffer, "\n\n", 2); + gtk_text_buffer_get_end_iter(buffer, &end); + gtk_text_buffer_insert_with_tags(buffer, &end, msg, -1, tag2, + NULL); +} + + +/* Main Windows Callbacks */ + +void on_save_activate(GtkMenuItem * menuitem, gpointer user_data); +gboolean on_window1_delete_event(GtkWidget * widget, GdkEvent * event, + gpointer user_data) +{ + GtkWidget *dialog, *label; + gint result; + + if (!conf_get_changed()) + return FALSE; + + dialog = gtk_dialog_new_with_buttons(_("Warning !"), + GTK_WINDOW(main_wnd), + (GtkDialogFlags) + (GTK_DIALOG_MODAL | + GTK_DIALOG_DESTROY_WITH_PARENT), + GTK_STOCK_OK, + GTK_RESPONSE_YES, + GTK_STOCK_NO, + GTK_RESPONSE_NO, + GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL, NULL); + gtk_dialog_set_default_response(GTK_DIALOG(dialog), + GTK_RESPONSE_CANCEL); + + label = gtk_label_new(_("\nSave configuration ?\n")); + gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), label); + gtk_widget_show(label); + + result = gtk_dialog_run(GTK_DIALOG(dialog)); + switch (result) { + case GTK_RESPONSE_YES: + on_save_activate(NULL, NULL); + return FALSE; + case GTK_RESPONSE_NO: + return FALSE; + case GTK_RESPONSE_CANCEL: + case GTK_RESPONSE_DELETE_EVENT: + default: + gtk_widget_destroy(dialog); + return TRUE; + } + + return FALSE; +} + + +void on_window1_destroy(GtkObject * object, gpointer user_data) +{ + gtk_main_quit(); +} + + +void +on_window1_size_request(GtkWidget * widget, + GtkRequisition * requisition, gpointer user_data) +{ + static gint old_h; + gint w, h; + + if (widget->window == NULL) + gtk_window_get_default_size(GTK_WINDOW(main_wnd), &w, &h); + else + gdk_window_get_size(widget->window, &w, &h); + + if (h == old_h) + return; + old_h = h; + + gtk_paned_set_position(GTK_PANED(vpaned), 2 * h / 3); +} + + +/* Menu & Toolbar Callbacks */ + + +static void +load_filename(GtkFileSelection * file_selector, gpointer user_data) +{ + const gchar *fn; + + fn = gtk_file_selection_get_filename(GTK_FILE_SELECTION + (user_data)); + + if (conf_read(fn)) + text_insert_msg(_("Error"), _("Unable to load configuration !")); + else + display_tree(&rootmenu); +} + +void on_load1_activate(GtkMenuItem * menuitem, gpointer user_data) +{ + GtkWidget *fs; + + fs = gtk_file_selection_new(_("Load file...")); + g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(fs)->ok_button), + "clicked", + G_CALLBACK(load_filename), (gpointer) fs); + g_signal_connect_swapped(GTK_OBJECT + (GTK_FILE_SELECTION(fs)->ok_button), + "clicked", G_CALLBACK(gtk_widget_destroy), + (gpointer) fs); + g_signal_connect_swapped(GTK_OBJECT + (GTK_FILE_SELECTION(fs)->cancel_button), + "clicked", G_CALLBACK(gtk_widget_destroy), + (gpointer) fs); + gtk_widget_show(fs); +} + + +void on_save_activate(GtkMenuItem * menuitem, gpointer user_data) +{ + if (conf_write(NULL)) + text_insert_msg(_("Error"), _("Unable to save configuration !")); + if (conf_write_autoconf()) + text_insert_msg(_("Error"), _("Unable to save configuration !")); +} + + +static void +store_filename(GtkFileSelection * file_selector, gpointer user_data) +{ + const gchar *fn; + + fn = gtk_file_selection_get_filename(GTK_FILE_SELECTION + (user_data)); + + if (conf_write(fn)) + text_insert_msg(_("Error"), _("Unable to save configuration !")); + if (conf_write_autoconf()) + text_insert_msg(_("Error"), _("Unable to save configuration !")); + + gtk_widget_destroy(GTK_WIDGET(user_data)); +} + +void on_save_as1_activate(GtkMenuItem * menuitem, gpointer user_data) +{ + GtkWidget *fs; + + fs = gtk_file_selection_new(_("Save file as...")); + g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(fs)->ok_button), + "clicked", + G_CALLBACK(store_filename), (gpointer) fs); + g_signal_connect_swapped(GTK_OBJECT + (GTK_FILE_SELECTION(fs)->ok_button), + "clicked", G_CALLBACK(gtk_widget_destroy), + (gpointer) fs); + g_signal_connect_swapped(GTK_OBJECT + (GTK_FILE_SELECTION(fs)->cancel_button), + "clicked", G_CALLBACK(gtk_widget_destroy), + (gpointer) fs); + gtk_widget_show(fs); +} + + +void on_quit1_activate(GtkMenuItem * menuitem, gpointer user_data) +{ + if (!on_window1_delete_event(NULL, NULL, NULL)) + gtk_widget_destroy(GTK_WIDGET(main_wnd)); +} + + +void on_show_name1_activate(GtkMenuItem * menuitem, gpointer user_data) +{ + GtkTreeViewColumn *col; + + show_name = GTK_CHECK_MENU_ITEM(menuitem)->active; + col = gtk_tree_view_get_column(GTK_TREE_VIEW(tree2_w), COL_NAME); + if (col) + gtk_tree_view_column_set_visible(col, show_name); +} + + +void on_show_range1_activate(GtkMenuItem * menuitem, gpointer user_data) +{ + GtkTreeViewColumn *col; + + show_range = GTK_CHECK_MENU_ITEM(menuitem)->active; + col = gtk_tree_view_get_column(GTK_TREE_VIEW(tree2_w), COL_NO); + if (col) + gtk_tree_view_column_set_visible(col, show_range); + col = gtk_tree_view_get_column(GTK_TREE_VIEW(tree2_w), COL_MOD); + if (col) + gtk_tree_view_column_set_visible(col, show_range); + col = gtk_tree_view_get_column(GTK_TREE_VIEW(tree2_w), COL_YES); + if (col) + gtk_tree_view_column_set_visible(col, show_range); + +} + + +void on_show_data1_activate(GtkMenuItem * menuitem, gpointer user_data) +{ + GtkTreeViewColumn *col; + + show_value = GTK_CHECK_MENU_ITEM(menuitem)->active; + col = gtk_tree_view_get_column(GTK_TREE_VIEW(tree2_w), COL_VALUE); + if (col) + gtk_tree_view_column_set_visible(col, show_value); +} + + +void +on_show_all_options1_activate(GtkMenuItem * menuitem, gpointer user_data) +{ + show_all = GTK_CHECK_MENU_ITEM(menuitem)->active; + + gtk_tree_store_clear(tree2); + display_tree(&rootmenu); // instead of update_tree to speed-up +} + + +void +on_show_debug_info1_activate(GtkMenuItem * menuitem, gpointer user_data) +{ + show_debug = GTK_CHECK_MENU_ITEM(menuitem)->active; + update_tree(&rootmenu, NULL); +} + + +void on_introduction1_activate(GtkMenuItem * menuitem, gpointer user_data) +{ + GtkWidget *dialog; + const gchar *intro_text = _( + "Welcome to gkc, the GTK+ graphical configuration tool\n" + "for buildrom.\n" + "For each option, a blank box indicates the feature is disabled, a\n" + "check indicates it is enabled, and a dot indicates that it is to\n" + "be compiled as a module. Clicking on the box will cycle through the three states.\n" + "\n" + "If you do not see an option (e.g., a device driver) that you\n" + "believe should be present, try turning on Show All Options\n" + "under the Options menu.\n" + "Although there is no cross reference yet to help you figure out\n" + "what other options must be enabled to support the option you\n" + "are interested in, you can still view the help of a grayed-out\n" + "option.\n" + "\n" + "Toggling Show Debug Info under the Options menu will show \n" + "the dependencies, which you can then match by examining other options."); + + dialog = gtk_message_dialog_new(GTK_WINDOW(main_wnd), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_INFO, + GTK_BUTTONS_CLOSE, intro_text); + g_signal_connect_swapped(GTK_OBJECT(dialog), "response", + G_CALLBACK(gtk_widget_destroy), + GTK_OBJECT(dialog)); + gtk_widget_show_all(dialog); +} + + +void on_about1_activate(GtkMenuItem * menuitem, gpointer user_data) +{ + GtkWidget *dialog; + const gchar *about_text = + _("gkc is copyright (c) 2002 Romain Lievin .\n" + "Based on the source code from Roman Zippel.\n"); + + dialog = gtk_message_dialog_new(GTK_WINDOW(main_wnd), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_INFO, + GTK_BUTTONS_CLOSE, about_text); + g_signal_connect_swapped(GTK_OBJECT(dialog), "response", + G_CALLBACK(gtk_widget_destroy), + GTK_OBJECT(dialog)); + gtk_widget_show_all(dialog); +} + + +void on_license1_activate(GtkMenuItem * menuitem, gpointer user_data) +{ + GtkWidget *dialog; + const gchar *license_text = + _("gkc is released under the terms of the GNU GPL v2.\n" + "For more information, please see the source code or\n" + "visit http://www.fsf.org/licenses/licenses.html\n"); + + dialog = gtk_message_dialog_new(GTK_WINDOW(main_wnd), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_INFO, + GTK_BUTTONS_CLOSE, license_text); + g_signal_connect_swapped(GTK_OBJECT(dialog), "response", + G_CALLBACK(gtk_widget_destroy), + GTK_OBJECT(dialog)); + gtk_widget_show_all(dialog); +} + + +void on_back_clicked(GtkButton * button, gpointer user_data) +{ + enum prop_type ptype; + + current = current->parent; + ptype = current->prompt ? current->prompt->type : P_UNKNOWN; + if (ptype != P_MENU) + current = current->parent; + display_tree_part(); + + if (current == &rootmenu) + gtk_widget_set_sensitive(back_btn, FALSE); +} + + +void on_load_clicked(GtkButton * button, gpointer user_data) +{ + on_load1_activate(NULL, user_data); +} + + +void on_single_clicked(GtkButton * button, gpointer user_data) +{ + view_mode = SINGLE_VIEW; + gtk_paned_set_position(GTK_PANED(hpaned), 0); + gtk_widget_hide(tree1_w); + current = &rootmenu; + display_tree_part(); +} + + +void on_split_clicked(GtkButton * button, gpointer user_data) +{ + gint w, h; + view_mode = SPLIT_VIEW; + gtk_widget_show(tree1_w); + gtk_window_get_default_size(GTK_WINDOW(main_wnd), &w, &h); + gtk_paned_set_position(GTK_PANED(hpaned), w / 2); + if (tree2) + gtk_tree_store_clear(tree2); + display_list(); + + /* Disable back btn, like in full mode. */ + gtk_widget_set_sensitive(back_btn, FALSE); +} + + +void on_full_clicked(GtkButton * button, gpointer user_data) +{ + view_mode = FULL_VIEW; + gtk_paned_set_position(GTK_PANED(hpaned), 0); + gtk_widget_hide(tree1_w); + if (tree2) + gtk_tree_store_clear(tree2); + display_tree(&rootmenu); + gtk_widget_set_sensitive(back_btn, FALSE); +} + + +void on_collapse_clicked(GtkButton * button, gpointer user_data) +{ + gtk_tree_view_collapse_all(GTK_TREE_VIEW(tree2_w)); +} + + +void on_expand_clicked(GtkButton * button, gpointer user_data) +{ + gtk_tree_view_expand_all(GTK_TREE_VIEW(tree2_w)); +} + + +/* CTree Callbacks */ + +/* Change hex/int/string value in the cell */ +static void renderer_edited(GtkCellRendererText * cell, + const gchar * path_string, + const gchar * new_text, gpointer user_data) +{ + GtkTreePath *path = gtk_tree_path_new_from_string(path_string); + GtkTreeIter iter; + const char *old_def, *new_def; + struct menu *menu; + struct symbol *sym; + + if (!gtk_tree_model_get_iter(model2, &iter, path)) + return; + + gtk_tree_model_get(model2, &iter, COL_MENU, &menu, -1); + sym = menu->sym; + + gtk_tree_model_get(model2, &iter, COL_VALUE, &old_def, -1); + new_def = new_text; + + sym_set_string_value(sym, new_def); + + update_tree(&rootmenu, NULL); + + gtk_tree_path_free(path); +} + +/* Change the value of a symbol and update the tree */ +static void change_sym_value(struct menu *menu, gint col) +{ + struct symbol *sym = menu->sym; + tristate oldval, newval; + + if (!sym) + return; + + if (col == COL_NO) + newval = no; + else if (col == COL_MOD) + newval = mod; + else if (col == COL_YES) + newval = yes; + else + return; + + switch (sym_get_type(sym)) { + case S_BOOLEAN: + case S_TRISTATE: + oldval = sym_get_tristate_value(sym); + if (!sym_tristate_within_range(sym, newval)) + newval = yes; + sym_set_tristate_value(sym, newval); + if (view_mode == FULL_VIEW) + update_tree(&rootmenu, NULL); + else if (view_mode == SPLIT_VIEW) { + update_tree(browsed, NULL); + display_list(); + } + else if (view_mode == SINGLE_VIEW) + display_tree_part(); //fixme: keep exp/coll + break; + case S_INT: + case S_HEX: + case S_STRING: + default: + break; + } +} + +static void toggle_sym_value(struct menu *menu) +{ + if (!menu->sym) + return; + + sym_toggle_tristate_value(menu->sym); + if (view_mode == FULL_VIEW) + update_tree(&rootmenu, NULL); + else if (view_mode == SPLIT_VIEW) { + update_tree(browsed, NULL); + display_list(); + } + else if (view_mode == SINGLE_VIEW) + display_tree_part(); //fixme: keep exp/coll +} + +static void renderer_toggled(GtkCellRendererToggle * cell, + gchar * path_string, gpointer user_data) +{ + GtkTreePath *path, *sel_path = NULL; + GtkTreeIter iter, sel_iter; + GtkTreeSelection *sel; + struct menu *menu; + + path = gtk_tree_path_new_from_string(path_string); + if (!gtk_tree_model_get_iter(model2, &iter, path)) + return; + + sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree2_w)); + if (gtk_tree_selection_get_selected(sel, NULL, &sel_iter)) + sel_path = gtk_tree_model_get_path(model2, &sel_iter); + if (!sel_path) + goto out1; + if (gtk_tree_path_compare(path, sel_path)) + goto out2; + + gtk_tree_model_get(model2, &iter, COL_MENU, &menu, -1); + toggle_sym_value(menu); + + out2: + gtk_tree_path_free(sel_path); + out1: + gtk_tree_path_free(path); +} + +static gint column2index(GtkTreeViewColumn * column) +{ + gint i; + + for (i = 0; i < COL_NUMBER; i++) { + GtkTreeViewColumn *col; + + col = gtk_tree_view_get_column(GTK_TREE_VIEW(tree2_w), i); + if (col == column) + return i; + } + + return -1; +} + + +/* User click: update choice (full) or goes down (single) */ +gboolean +on_treeview2_button_press_event(GtkWidget * widget, + GdkEventButton * event, gpointer user_data) +{ + GtkTreeView *view = GTK_TREE_VIEW(widget); + GtkTreePath *path; + GtkTreeViewColumn *column; + GtkTreeIter iter; + struct menu *menu; + gint col; + +#if GTK_CHECK_VERSION(2,1,4) // bug in ctree with earlier version of GTK + gint tx = (gint) event->x; + gint ty = (gint) event->y; + gint cx, cy; + + gtk_tree_view_get_path_at_pos(view, tx, ty, &path, &column, &cx, + &cy); +#else + gtk_tree_view_get_cursor(view, &path, &column); +#endif + if (path == NULL) + return FALSE; + + if (!gtk_tree_model_get_iter(model2, &iter, path)) + return FALSE; + gtk_tree_model_get(model2, &iter, COL_MENU, &menu, -1); + + col = column2index(column); + if (event->type == GDK_2BUTTON_PRESS) { + enum prop_type ptype; + ptype = menu->prompt ? menu->prompt->type : P_UNKNOWN; + + if (ptype == P_MENU && view_mode != FULL_VIEW && col == COL_OPTION) { + // goes down into menu + current = menu; + display_tree_part(); + gtk_widget_set_sensitive(back_btn, TRUE); + } else if ((col == COL_OPTION)) { + toggle_sym_value(menu); + gtk_tree_view_expand_row(view, path, TRUE); + } + } else { + if (col == COL_VALUE) { + toggle_sym_value(menu); + gtk_tree_view_expand_row(view, path, TRUE); + } else if (col == COL_NO || col == COL_MOD + || col == COL_YES) { + change_sym_value(menu, col); + gtk_tree_view_expand_row(view, path, TRUE); + } + } + + return FALSE; +} + +/* Key pressed: update choice */ +gboolean +on_treeview2_key_press_event(GtkWidget * widget, + GdkEventKey * event, gpointer user_data) +{ + GtkTreeView *view = GTK_TREE_VIEW(widget); + GtkTreePath *path; + GtkTreeViewColumn *column; + GtkTreeIter iter; + struct menu *menu; + gint col; + + gtk_tree_view_get_cursor(view, &path, &column); + if (path == NULL) + return FALSE; + + if (event->keyval == GDK_space) { + if (gtk_tree_view_row_expanded(view, path)) + gtk_tree_view_collapse_row(view, path); + else + gtk_tree_view_expand_row(view, path, FALSE); + return TRUE; + } + if (event->keyval == GDK_KP_Enter) { + } + if (widget == tree1_w) + return FALSE; + + gtk_tree_model_get_iter(model2, &iter, path); + gtk_tree_model_get(model2, &iter, COL_MENU, &menu, -1); + + if (!strcasecmp(event->string, "n")) + col = COL_NO; + else if (!strcasecmp(event->string, "m")) + col = COL_MOD; + else if (!strcasecmp(event->string, "y")) + col = COL_YES; + else + col = -1; + change_sym_value(menu, col); + + return FALSE; +} + + +/* Row selection changed: update help */ +void +on_treeview2_cursor_changed(GtkTreeView * treeview, gpointer user_data) +{ + GtkTreeSelection *selection; + GtkTreeIter iter; + struct menu *menu; + + selection = gtk_tree_view_get_selection(treeview); + if (gtk_tree_selection_get_selected(selection, &model2, &iter)) { + gtk_tree_model_get(model2, &iter, COL_MENU, &menu, -1); + text_insert_help(menu); + } +} + + +/* User click: display sub-tree in the right frame. */ +gboolean +on_treeview1_button_press_event(GtkWidget * widget, + GdkEventButton * event, gpointer user_data) +{ + GtkTreeView *view = GTK_TREE_VIEW(widget); + GtkTreePath *path; + GtkTreeViewColumn *column; + GtkTreeIter iter; + struct menu *menu; + + gint tx = (gint) event->x; + gint ty = (gint) event->y; + gint cx, cy; + + gtk_tree_view_get_path_at_pos(view, tx, ty, &path, &column, &cx, + &cy); + if (path == NULL) + return FALSE; + + gtk_tree_model_get_iter(model1, &iter, path); + gtk_tree_model_get(model1, &iter, COL_MENU, &menu, -1); + + if (event->type == GDK_2BUTTON_PRESS) { + toggle_sym_value(menu); + current = menu; + display_tree_part(); + } else { + browsed = menu; + display_tree_part(); + } + + gtk_widget_realize(tree2_w); + gtk_tree_view_set_cursor(view, path, NULL, FALSE); + gtk_widget_grab_focus(tree2_w); + + return FALSE; +} + + +/* Fill a row of strings */ +static gchar **fill_row(struct menu *menu) +{ + static gchar *row[COL_NUMBER]; + struct symbol *sym = menu->sym; + const char *def; + int stype; + tristate val; + enum prop_type ptype; + int i; + + for (i = COL_OPTION; i <= COL_COLOR; i++) + g_free(row[i]); + bzero(row, sizeof(row)); + + row[COL_OPTION] = + g_strdup_printf("%s %s", _(menu_get_prompt(menu)), + sym && sym_has_value(sym) ? "(NEW)" : ""); + + if (show_all && !menu_is_visible(menu)) + row[COL_COLOR] = g_strdup("DarkGray"); + else + row[COL_COLOR] = g_strdup("Black"); + + ptype = menu->prompt ? menu->prompt->type : P_UNKNOWN; + switch (ptype) { + case P_MENU: + row[COL_PIXBUF] = (gchar *) xpm_menu; + if (view_mode == SINGLE_VIEW) + row[COL_PIXVIS] = GINT_TO_POINTER(TRUE); + row[COL_BTNVIS] = GINT_TO_POINTER(FALSE); + break; + case P_COMMENT: + row[COL_PIXBUF] = (gchar *) xpm_void; + row[COL_PIXVIS] = GINT_TO_POINTER(FALSE); + row[COL_BTNVIS] = GINT_TO_POINTER(FALSE); + break; + default: + row[COL_PIXBUF] = (gchar *) xpm_void; + row[COL_PIXVIS] = GINT_TO_POINTER(FALSE); + row[COL_BTNVIS] = GINT_TO_POINTER(TRUE); + break; + } + + if (!sym) + return row; + row[COL_NAME] = g_strdup(sym->name); + + sym_calc_value(sym); + sym->flags &= ~SYMBOL_CHANGED; + + if (sym_is_choice(sym)) { // parse childs for getting final value + struct menu *child; + struct symbol *def_sym = sym_get_choice_value(sym); + struct menu *def_menu = NULL; + + row[COL_BTNVIS] = GINT_TO_POINTER(FALSE); + + for (child = menu->list; child; child = child->next) { + if (menu_is_visible(child) + && child->sym == def_sym) + def_menu = child; + } + + if (def_menu) + row[COL_VALUE] = + g_strdup(_(menu_get_prompt(def_menu))); + } + if (sym->flags & SYMBOL_CHOICEVAL) + row[COL_BTNRAD] = GINT_TO_POINTER(TRUE); + + stype = sym_get_type(sym); + switch (stype) { + case S_BOOLEAN: + if (GPOINTER_TO_INT(row[COL_PIXVIS]) == FALSE) + row[COL_BTNVIS] = GINT_TO_POINTER(TRUE); + if (sym_is_choice(sym)) + break; + case S_TRISTATE: + val = sym_get_tristate_value(sym); + switch (val) { + case no: + row[COL_NO] = g_strdup("N"); + row[COL_VALUE] = g_strdup("N"); + row[COL_BTNACT] = GINT_TO_POINTER(FALSE); + row[COL_BTNINC] = GINT_TO_POINTER(FALSE); + break; + case mod: + row[COL_MOD] = g_strdup("M"); + row[COL_VALUE] = g_strdup("M"); + row[COL_BTNINC] = GINT_TO_POINTER(TRUE); + break; + case yes: + row[COL_YES] = g_strdup("Y"); + row[COL_VALUE] = g_strdup("Y"); + row[COL_BTNACT] = GINT_TO_POINTER(TRUE); + row[COL_BTNINC] = GINT_TO_POINTER(FALSE); + break; + } + + if (val != no && sym_tristate_within_range(sym, no)) + row[COL_NO] = g_strdup("_"); + if (val != mod && sym_tristate_within_range(sym, mod)) + row[COL_MOD] = g_strdup("_"); + if (val != yes && sym_tristate_within_range(sym, yes)) + row[COL_YES] = g_strdup("_"); + break; + case S_INT: + case S_HEX: + case S_STRING: + def = sym_get_string_value(sym); + row[COL_VALUE] = g_strdup(def); + row[COL_EDIT] = GINT_TO_POINTER(TRUE); + row[COL_BTNVIS] = GINT_TO_POINTER(FALSE); + break; + } + + return row; +} + + +/* Set the node content with a row of strings */ +static void set_node(GtkTreeIter * node, struct menu *menu, gchar ** row) +{ + GdkColor color; + gboolean success; + GdkPixbuf *pix; + + pix = gdk_pixbuf_new_from_xpm_data((const char **) + row[COL_PIXBUF]); + + gdk_color_parse(row[COL_COLOR], &color); + gdk_colormap_alloc_colors(gdk_colormap_get_system(), &color, 1, + FALSE, FALSE, &success); + + gtk_tree_store_set(tree, node, + COL_OPTION, row[COL_OPTION], + COL_NAME, row[COL_NAME], + COL_NO, row[COL_NO], + COL_MOD, row[COL_MOD], + COL_YES, row[COL_YES], + COL_VALUE, row[COL_VALUE], + COL_MENU, (gpointer) menu, + COL_COLOR, &color, + COL_EDIT, GPOINTER_TO_INT(row[COL_EDIT]), + COL_PIXBUF, pix, + COL_PIXVIS, GPOINTER_TO_INT(row[COL_PIXVIS]), + COL_BTNVIS, GPOINTER_TO_INT(row[COL_BTNVIS]), + COL_BTNACT, GPOINTER_TO_INT(row[COL_BTNACT]), + COL_BTNINC, GPOINTER_TO_INT(row[COL_BTNINC]), + COL_BTNRAD, GPOINTER_TO_INT(row[COL_BTNRAD]), + -1); + + g_object_unref(pix); +} + + +/* Add a node to the tree */ +static void place_node(struct menu *menu, char **row) +{ + GtkTreeIter *parent = parents[indent - 1]; + GtkTreeIter *node = parents[indent]; + + gtk_tree_store_append(tree, node, parent); + set_node(node, menu, row); +} + + +/* Find a node in the GTK+ tree */ +static GtkTreeIter found; + +/* + * Find a menu in the GtkTree starting at parent. + */ +GtkTreeIter *gtktree_iter_find_node(GtkTreeIter * parent, + struct menu *tofind) +{ + GtkTreeIter iter; + GtkTreeIter *child = &iter; + gboolean valid; + GtkTreeIter *ret; + + valid = gtk_tree_model_iter_children(model2, child, parent); + while (valid) { + struct menu *menu; + + gtk_tree_model_get(model2, child, 6, &menu, -1); + + if (menu == tofind) { + memcpy(&found, child, sizeof(GtkTreeIter)); + return &found; + } + + ret = gtktree_iter_find_node(child, tofind); + if (ret) + return ret; + + valid = gtk_tree_model_iter_next(model2, child); + } + + return NULL; +} + + +/* + * Update the tree by adding/removing entries + * Does not change other nodes + */ +static void update_tree(struct menu *src, GtkTreeIter * dst) +{ + struct menu *child1; + GtkTreeIter iter, tmp; + GtkTreeIter *child2 = &iter; + gboolean valid; + GtkTreeIter *sibling; + struct symbol *sym; + struct property *prop; + struct menu *menu1, *menu2; + + if (src == &rootmenu) + indent = 1; + + valid = gtk_tree_model_iter_children(model2, child2, dst); + for (child1 = src->list; child1; child1 = child1->next) { + + prop = child1->prompt; + sym = child1->sym; + + reparse: + menu1 = child1; + if (valid) + gtk_tree_model_get(model2, child2, COL_MENU, + &menu2, -1); + else + menu2 = NULL; // force adding of a first child + +#ifdef DEBUG + printf("%*c%s | %s\n", indent, ' ', + menu1 ? menu_get_prompt(menu1) : "nil", + menu2 ? menu_get_prompt(menu2) : "nil"); +#endif + + if (!menu_is_visible(child1) && !show_all) { // remove node + if (gtktree_iter_find_node(dst, menu1) != NULL) { + memcpy(&tmp, child2, sizeof(GtkTreeIter)); + valid = gtk_tree_model_iter_next(model2, + child2); + gtk_tree_store_remove(tree2, &tmp); + if (!valid) + return; // next parent + else + goto reparse; // next child + } else + continue; + } + + if (menu1 != menu2) { + if (gtktree_iter_find_node(dst, menu1) == NULL) { // add node + if (!valid && !menu2) + sibling = NULL; + else + sibling = child2; + gtk_tree_store_insert_before(tree2, + child2, + dst, sibling); + set_node(child2, menu1, fill_row(menu1)); + if (menu2 == NULL) + valid = TRUE; + } else { // remove node + memcpy(&tmp, child2, sizeof(GtkTreeIter)); + valid = gtk_tree_model_iter_next(model2, + child2); + gtk_tree_store_remove(tree2, &tmp); + if (!valid) + return; // next parent + else + goto reparse; // next child + } + } else if (sym && (sym->flags & SYMBOL_CHANGED)) { + set_node(child2, menu1, fill_row(menu1)); + } + + indent++; + update_tree(child1, child2); + indent--; + + valid = gtk_tree_model_iter_next(model2, child2); + } +} + + +/* Display the whole tree (single/split/full view) */ +static void display_tree(struct menu *menu) +{ + struct symbol *sym; + struct property *prop; + struct menu *child; + enum prop_type ptype; + + if (menu == &rootmenu) { + indent = 1; + current = &rootmenu; + } + + for (child = menu->list; child; child = child->next) { + prop = child->prompt; + sym = child->sym; + ptype = prop ? prop->type : P_UNKNOWN; + + if (sym) + sym->flags &= ~SYMBOL_CHANGED; + + if ((view_mode == SPLIT_VIEW) + && !(child->flags & MENU_ROOT) && (tree == tree1)) + continue; + + if ((view_mode == SPLIT_VIEW) && (child->flags & MENU_ROOT) + && (tree == tree2)) + continue; + + if (menu_is_visible(child) || show_all) + place_node(child, fill_row(child)); +#ifdef DEBUG + printf("%*c%s: ", indent, ' ', menu_get_prompt(child)); + printf("%s", child->flags & MENU_ROOT ? "rootmenu | " : ""); + dbg_print_ptype(ptype); + printf(" | "); + if (sym) { + dbg_print_stype(sym->type); + printf(" | "); + dbg_print_flags(sym->flags); + printf("\n"); + } else + printf("\n"); +#endif + if ((view_mode != FULL_VIEW) && (ptype == P_MENU) + && (tree == tree2)) + continue; +/* + if (((menu != &rootmenu) && !(menu->flags & MENU_ROOT)) + || (view_mode == FULL_VIEW) + || (view_mode == SPLIT_VIEW))*/ + if (((view_mode == SINGLE_VIEW) && (menu->flags & MENU_ROOT)) + || (view_mode == FULL_VIEW) + || (view_mode == SPLIT_VIEW)) { + indent++; + display_tree(child); + indent--; + } + } +} + +/* Display a part of the tree starting at current node (single/split view) */ +static void display_tree_part(void) +{ + if (tree2) + gtk_tree_store_clear(tree2); + if (view_mode == SINGLE_VIEW) + display_tree(current); + else if (view_mode == SPLIT_VIEW) + display_tree(browsed); + gtk_tree_view_expand_all(GTK_TREE_VIEW(tree2_w)); +} + +/* Display the list in the left frame (split view) */ +static void display_list(void) +{ + if (tree1) + gtk_tree_store_clear(tree1); + + tree = tree1; + display_tree(&rootmenu); + gtk_tree_view_expand_all(GTK_TREE_VIEW(tree1_w)); + tree = tree2; +} + +void fixup_rootmenu(struct menu *menu) +{ + struct menu *child; + static int menu_cnt = 0; + + menu->flags |= MENU_ROOT; + for (child = menu->list; child; child = child->next) { + if (child->prompt && child->prompt->type == P_MENU) { + menu_cnt++; + fixup_rootmenu(child); + menu_cnt--; + } else if (!menu_cnt) + fixup_rootmenu(child); + } +} + + +/* Main */ +int main(int ac, char *av[]) +{ + const char *name; + char *env; + gchar *glade_file; + +#ifndef LKC_DIRECT_LINK + kconfig_load(); +#endif + + bindtextdomain(PACKAGE, LOCALEDIR); + bind_textdomain_codeset(PACKAGE, "UTF-8"); + textdomain(PACKAGE); + + /* GTK stuffs */ + gtk_set_locale(); + gtk_init(&ac, &av); + glade_init(); + + //add_pixmap_directory (PACKAGE_DATA_DIR "/" PACKAGE "/pixmaps"); + //add_pixmap_directory (PACKAGE_SOURCE_DIR "/pixmaps"); + + /* Determine GUI path */ + env = getenv(SRCTREE); + if (env) + glade_file = g_strconcat(env, "/scripts/kconfig/gconf.glade", NULL); + else if (av[0][0] == '/') + glade_file = g_strconcat(av[0], ".glade", NULL); + else + glade_file = g_strconcat(g_get_current_dir(), "/", av[0], ".glade", NULL); + + /* Load the interface and connect signals */ + init_main_window(glade_file); + init_tree_model(); + init_left_tree(); + init_right_tree(); + + /* Conf stuffs */ + if (ac > 1 && av[1][0] == '-') { + switch (av[1][1]) { + case 'a': + //showAll = 1; + break; + case 'h': + case '?': + printf("%s \n", av[0]); + exit(0); + } + name = av[2]; + } else + name = av[1]; + + conf_parse(name); + fixup_rootmenu(&rootmenu); + conf_read(NULL); + + switch (view_mode) { + case SINGLE_VIEW: + display_tree_part(); + break; + case SPLIT_VIEW: + display_list(); + break; + case FULL_VIEW: + display_tree(&rootmenu); + break; + } + + gtk_main(); + + return 0; +} + +static void conf_changed(void) +{ + bool changed = conf_get_changed(); + gtk_widget_set_sensitive(save_btn, changed); + gtk_widget_set_sensitive(save_menu_item, changed); +} Added: buildrom-devel/scripts/kconfig/gconf.glade =================================================================== --- buildrom-devel/scripts/kconfig/gconf.glade (rev 0) +++ buildrom-devel/scripts/kconfig/gconf.glade 2008-07-02 19:45:34 UTC (rev 210) @@ -0,0 +1,648 @@ + + + + + + + True + Gtk buildrom Configurator + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + 640 + 480 + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + + + + + + + True + False + 0 + + + + True + + + + True + _File + True + + + + + + + True + Load a config file + _Load + True + + + + + + True + gtk-open + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + Save the config in .config + _Save + True + + + + + + True + gtk-save + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + Save the config in a file + Save _as + True + + + + + True + gtk-save-as + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + + + + + + True + _Quit + True + + + + + + True + gtk-quit + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + + + + + True + _Options + True + + + + + + + True + Show name + Show _name + True + False + + + + + + + True + Show range (Y/M/N) + Show _range + True + False + + + + + + + True + Show value of the option + Show _data + True + False + + + + + + + True + + + + + + True + Show all options + Show all _options + True + False + + + + + + + True + Show masked options + Show _debug info + True + False + + + + + + + + + + + True + _Help + True + + + + + + + True + _Introduction + True + + + + + + True + gtk-dialog-question + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + _About + True + + + + + + True + gtk-properties + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + _License + True + + + + + True + gtk-justify-fill + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + + + + 0 + False + False + + + + + + True + GTK_SHADOW_OUT + GTK_POS_LEFT + GTK_POS_TOP + + + + True + GTK_ORIENTATION_HORIZONTAL + GTK_TOOLBAR_BOTH + True + True + + + + True + Goes up of one level (single view) + Back + True + gtk-undo + True + True + False + + + + False + True + + + + + + True + True + True + False + + + + True + + + + + False + False + + + + + + True + Load a config file + Load + True + gtk-open + True + True + False + + + + False + True + + + + + + True + Save a config file + Save + True + gtk-save + True + True + False + + + + False + True + + + + + + True + True + True + False + + + + True + + + + + False + False + + + + + + True + Single view + Single + True + gtk-missing-image + True + True + False + + + + False + True + + + + + + True + Split view + Split + True + gtk-missing-image + True + True + False + + + + False + True + + + + + + True + Full view + Full + True + gtk-missing-image + True + True + False + + + + False + True + + + + + + True + True + True + False + + + + True + + + + + False + False + + + + + + True + Collapse the whole tree in the right frame + Collapse + True + gtk-remove + True + True + False + + + + False + True + + + + + + True + Expand the whole tree in the right frame + Expand + True + gtk-add + True + True + False + + + + False + True + + + + + + + 0 + False + False + + + + + + 1 + True + True + 0 + + + + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + True + False + False + True + + + + + + + + True + False + + + + + + True + True + 0 + + + + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + True + True + False + False + True + + + + + + + + True + False + + + + + + True + GTK_POLICY_NEVER + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + False + False + True + GTK_JUSTIFY_LEFT + GTK_WRAP_WORD + True + 0 + 0 + 0 + 0 + 0 + 0 + Sorry, no help available for this option yet. + + + + + True + True + + + + + True + True + + + + + 0 + True + True + + + + + + + Added: buildrom-devel/scripts/kconfig/images.c =================================================================== --- buildrom-devel/scripts/kconfig/images.c (rev 0) +++ buildrom-devel/scripts/kconfig/images.c 2008-07-02 19:45:34 UTC (rev 210) @@ -0,0 +1,326 @@ +/* + * Copyright (C) 2002 Roman Zippel + * Released under the terms of the GNU GPL v2.0. + */ + +static const char *xpm_load[] = { +"22 22 5 1", +". c None", +"# c #000000", +"c c #838100", +"a c #ffff00", +"b c #ffffff", +"......................", +"......................", +"......................", +"............####....#.", +"...........#....##.##.", +"..................###.", +".................####.", +".####...........#####.", +"#abab##########.......", +"#babababababab#.......", +"#ababababababa#.......", +"#babababababab#.......", +"#ababab###############", +"#babab##cccccccccccc##", +"#abab##cccccccccccc##.", +"#bab##cccccccccccc##..", +"#ab##cccccccccccc##...", +"#b##cccccccccccc##....", +"###cccccccccccc##.....", +"##cccccccccccc##......", +"###############.......", +"......................"}; + +static const char *xpm_save[] = { +"22 22 5 1", +". c None", +"# c #000000", +"a c #838100", +"b c #c5c2c5", +"c c #cdb6d5", +"......................", +".####################.", +".#aa#bbbbbbbbbbbb#bb#.", +".#aa#bbbbbbbbbbbb#bb#.", +".#aa#bbbbbbbbbcbb####.", +".#aa#bbbccbbbbbbb#aa#.", +".#aa#bbbccbbbbbbb#aa#.", +".#aa#bbbbbbbbbbbb#aa#.", +".#aa#bbbbbbbbbbbb#aa#.", +".#aa#bbbbbbbbbbbb#aa#.", +".#aa#bbbbbbbbbbbb#aa#.", +".#aaa############aaa#.", +".#aaaaaaaaaaaaaaaaaa#.", +".#aaaaaaaaaaaaaaaaaa#.", +".#aaa#############aa#.", +".#aaa#########bbb#aa#.", +".#aaa#########bbb#aa#.", +".#aaa#########bbb#aa#.", +".#aaa#########bbb#aa#.", +".#aaa#########bbb#aa#.", +"..##################..", +"......................"}; + +static const char *xpm_back[] = { +"22 22 3 1", +". c None", +"# c #000083", +"a c #838183", +"......................", +"......................", +"......................", +"......................", +"......................", +"...........######a....", +"..#......##########...", +"..##...####......##a..", +"..###.###.........##..", +"..######..........##..", +"..#####...........##..", +"..######..........##..", +"..#######.........##..", +"..########.......##a..", +"...............a###...", +"...............###....", +"......................", +"......................", +"......................", +"......................", +"......................", +"......................"}; + +static const char *xpm_tree_view[] = { +"22 22 2 1", +". c None", +"# c #000000", +"......................", +"......................", +"......#...............", +"......#...............", +"......#...............", +"......#...............", +"......#...............", +"......########........", +"......#...............", +"......#...............", +"......#...............", +"......#...............", +"......#...............", +"......########........", +"......#...............", +"......#...............", +"......#...............", +"......#...............", +"......#...............", +"......########........", +"......................", +"......................"}; + +static const char *xpm_single_view[] = { +"22 22 2 1", +". c None", +"# c #000000", +"......................", +"......................", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"......................", +"......................"}; + +static const char *xpm_split_view[] = { +"22 22 2 1", +". c None", +"# c #000000", +"......................", +"......................", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......................", +"......................"}; + +static const char *xpm_symbol_no[] = { +"12 12 2 1", +" c white", +". c black", +" ", +" .......... ", +" . . ", +" . . ", +" . . ", +" . . ", +" . . ", +" . . ", +" . . ", +" . . ", +" .......... ", +" "}; + +static const char *xpm_symbol_mod[] = { +"12 12 2 1", +" c white", +". c black", +" ", +" .......... ", +" . . ", +" . . ", +" . .. . ", +" . .... . ", +" . .... . ", +" . .. . ", +" . . ", +" . . ", +" .......... ", +" "}; + +static const char *xpm_symbol_yes[] = { +"12 12 2 1", +" c white", +". c black", +" ", +" .......... ", +" . . ", +" . . ", +" . . . ", +" . .. . ", +" . . .. . ", +" . .... . ", +" . .. . ", +" . . ", +" .......... ", +" "}; + +static const char *xpm_choice_no[] = { +"12 12 2 1", +" c white", +". c black", +" ", +" .... ", +" .. .. ", +" . . ", +" . . ", +" . . ", +" . . ", +" . . ", +" . . ", +" .. .. ", +" .... ", +" "}; + +static const char *xpm_choice_yes[] = { +"12 12 2 1", +" c white", +". c black", +" ", +" .... ", +" .. .. ", +" . . ", +" . .. . ", +" . .... . ", +" . .... . ", +" . .. . ", +" . . ", +" .. .. ", +" .... ", +" "}; + +static const char *xpm_menu[] = { +"12 12 2 1", +" c white", +". c black", +" ", +" .......... ", +" . . ", +" . .. . ", +" . .... . ", +" . ...... . ", +" . ...... . ", +" . .... . ", +" . .. . ", +" . . ", +" .......... ", +" "}; + +static const char *xpm_menu_inv[] = { +"12 12 2 1", +" c white", +". c black", +" ", +" .......... ", +" .......... ", +" .. ...... ", +" .. .... ", +" .. .. ", +" .. .. ", +" .. .... ", +" .. ...... ", +" .......... ", +" .......... ", +" "}; + +static const char *xpm_menuback[] = { +"12 12 2 1", +" c white", +". c black", +" ", +" .......... ", +" . . ", +" . .. . ", +" . .... . ", +" . ...... . ", +" . ...... . ", +" . .... . ", +" . .. . ", +" . . ", +" .......... ", +" "}; + +static const char *xpm_void[] = { +"12 12 2 1", +" c white", +". c black", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" "}; Modified: buildrom-devel/scripts/kconfig/kxgettext.c =================================================================== --- buildrom-devel/scripts/kconfig/kxgettext.c 2008-07-01 21:13:46 UTC (rev 209) +++ buildrom-devel/scripts/kconfig/kxgettext.c 2008-07-02 19:45:34 UTC (rev 210) @@ -170,8 +170,8 @@ menu->file == NULL ? "Root Menu" : menu->file->name, menu->lineno); - if (menu->sym != NULL && menu->sym->help != NULL) - message__add(menu->sym->help, menu->sym->name, + if (menu->sym != NULL && menu_has_help(menu)) + message__add(menu_get_help(menu), menu->sym->name, menu->file == NULL ? "Root Menu" : menu->file->name, menu->lineno); @@ -212,7 +212,9 @@ struct message *m = message__list; while (m != NULL) { - message__print_gettext_msgid_msgstr(m); + /* skip empty lines ("") */ + if (strlen(m->msg) > sizeof("\"\"")) + message__print_gettext_msgid_msgstr(m); m = m->next; } } Modified: buildrom-devel/scripts/kconfig/lex.zconf.c_shipped =================================================================== --- buildrom-devel/scripts/kconfig/lex.zconf.c_shipped 2008-07-01 21:13:46 UTC (rev 209) +++ buildrom-devel/scripts/kconfig/lex.zconf.c_shipped 2008-07-02 19:45:34 UTC (rev 210) @@ -5,10 +5,29 @@ /* A lexical scanner generated by flex */ +#define yy_create_buffer zconf_create_buffer +#define yy_delete_buffer zconf_delete_buffer +#define yy_flex_debug zconf_flex_debug +#define yy_init_buffer zconf_init_buffer +#define yy_flush_buffer zconf_flush_buffer +#define yy_load_buffer_state zconf_load_buffer_state +#define yy_switch_to_buffer zconf_switch_to_buffer +#define yyin zconfin +#define yyleng zconfleng +#define yylex zconflex +#define yylineno zconflineno +#define yyout zconfout +#define yyrestart zconfrestart +#define yytext zconftext +#define yywrap zconfwrap +#define yyalloc zconfalloc +#define yyrealloc zconfrealloc +#define yyfree zconffree + #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 31 +#define YY_FLEX_SUBMINOR_VERSION 33 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -30,7 +49,15 @@ /* C99 systems have . Non-C99 systems may or may not. */ -#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L +#if __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + #include typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; @@ -42,7 +69,7 @@ typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; #endif /* ! C99 */ @@ -134,6 +161,10 @@ #define YY_BUF_SIZE 16384 #endif +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; @@ -148,7 +179,7 @@ #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) - + /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ @@ -215,7 +246,7 @@ int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -267,7 +298,7 @@ /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ +static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow zconfwrap()'s to do buffer switches @@ -323,7 +354,7 @@ /* Begin user sect3 */ -#define zconfwrap() 1 +#define zconfwrap(n) 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; @@ -820,6 +851,8 @@ #define YY_EXTRA_TYPE void * #endif +static int yy_init_globals (void ); + /* Macros after this point can all be overridden by user definitions in * section 1. */ @@ -833,7 +866,7 @@ #endif static void yyunput (int c,char *buf_ptr ); - + #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif @@ -938,13 +971,13 @@ register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; - + int str = 0; int ts, i; - if ( (yy_init) ) + if ( !(yy_init) ) { - (yy_init) = 0; + (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; @@ -1242,6 +1275,11 @@ case 32: YY_RULE_SETUP { + while (zconfleng) { + if ((zconftext[zconfleng-1] != ' ') && (zconftext[zconfleng-1] != '\t')) + break; + zconfleng--; + } append_string(zconftext, zconfleng); if (!first_ts) first_ts = last_ts; @@ -1452,7 +1490,7 @@ else { - size_t num_to_read = + int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) @@ -1536,7 +1574,7 @@ { register yy_state_type yy_current_state; register char *yy_cp; - + yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) @@ -1555,7 +1593,7 @@ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { register int yy_is_jam; - + yy_current_state = yy_nxt[yy_current_state][1]; yy_is_jam = (yy_current_state <= 0); @@ -1565,7 +1603,7 @@ static void yyunput (int c, register char * yy_bp ) { register char *yy_cp; - + yy_cp = (yy_c_buf_p); /* undo effects of setting up zconftext */ @@ -1608,7 +1646,7 @@ { int c; - + *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) @@ -1675,12 +1713,12 @@ /** Immediately switch to a different input stream. * @param input_file A readable stream. - * + * * @note This function does not reset the start condition to @c INITIAL . */ void zconfrestart (FILE * input_file ) { - + if ( ! YY_CURRENT_BUFFER ){ zconfensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = @@ -1693,11 +1731,11 @@ /** Switch to a different input buffer. * @param new_buffer The new input buffer. - * + * */ void zconf_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { - + /* TODO. We should be able to replace this entire function body * with * zconfpop_buffer_state(); @@ -1737,13 +1775,13 @@ /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * + * * @return the allocated buffer state. */ YY_BUFFER_STATE zconf_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; - + b = (YY_BUFFER_STATE) zconfalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in zconf_create_buffer()" ); @@ -1766,11 +1804,11 @@ /** Destroy the buffer. * @param b a buffer created with zconf_create_buffer() - * + * */ void zconf_delete_buffer (YY_BUFFER_STATE b ) { - + if ( ! b ) return; @@ -1791,7 +1829,7 @@ { int oerrno = errno; - + zconf_flush_buffer(b ); b->yy_input_file = file; @@ -1807,13 +1845,13 @@ } b->yy_is_interactive = 0; - + errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * + * */ void zconf_flush_buffer (YY_BUFFER_STATE b ) { @@ -1842,7 +1880,7 @@ * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. - * + * */ void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer ) { @@ -1872,7 +1910,7 @@ /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. - * + * */ void zconfpop_buffer_state (void) { @@ -1896,7 +1934,7 @@ static void zconfensure_buffer_stack (void) { int num_to_alloc; - + if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this @@ -1907,9 +1945,9 @@ (yy_buffer_stack) = (struct yy_buffer_state**)zconfalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); - + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - + (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; @@ -1935,13 +1973,13 @@ /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer - * - * @return the newly allocated buffer state object. + * + * @return the newly allocated buffer state object. */ YY_BUFFER_STATE zconf_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; - + if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) @@ -1969,42 +2007,42 @@ /** Setup the input buffer state to scan a string. The next call to zconflex() will * scan from a @e copy of @a str. - * @param yy_str a NUL-terminated string to scan - * + * @param str a NUL-terminated string to scan + * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * zconf_scan_bytes() instead. */ -YY_BUFFER_STATE zconf_scan_string (yyconst char * yy_str ) +YY_BUFFER_STATE zconf_scan_string (yyconst char * yystr ) { - - return zconf_scan_bytes(yy_str,strlen(yy_str) ); + + return zconf_scan_bytes(yystr,strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to zconflex() will * scan from a @e copy of @a bytes. * @param bytes the byte buffer to scan * @param len the number of bytes in the buffer pointed to by @a bytes. - * + * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE zconf_scan_bytes (yyconst char * bytes, int len ) +YY_BUFFER_STATE zconf_scan_bytes (yyconst char * yybytes, int _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; - + /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; + n = _yybytes_len + 2; buf = (char *) zconfalloc(n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in zconf_scan_bytes()" ); - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; b = zconf_scan_buffer(buf,n ); if ( ! b ) @@ -2048,16 +2086,16 @@ /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. - * + * */ int zconfget_lineno (void) { - + return zconflineno; } /** Get the input stream. - * + * */ FILE *zconfget_in (void) { @@ -2065,7 +2103,7 @@ } /** Get the output stream. - * + * */ FILE *zconfget_out (void) { @@ -2073,7 +2111,7 @@ } /** Get the length of the current token. - * + * */ int zconfget_leng (void) { @@ -2081,7 +2119,7 @@ } /** Get the current token. - * + * */ char *zconfget_text (void) @@ -2091,18 +2129,18 @@ /** Set the current line number. * @param line_number - * + * */ void zconfset_lineno (int line_number ) { - + zconflineno = line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param in_str A readable stream. - * + * * @see zconf_switch_to_buffer */ void zconfset_in (FILE * in_str ) @@ -2125,10 +2163,38 @@ zconf_flex_debug = bdebug ; } +static int yy_init_globals (void) +{ + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from zconflex_destroy(), so don't allocate here. + */ + + (yy_buffer_stack) = 0; + (yy_buffer_stack_top) = 0; + (yy_buffer_stack_max) = 0; + (yy_c_buf_p) = (char *) 0; + (yy_init) = 0; + (yy_start) = 0; + +/* Defined in main.c */ +#ifdef YY_STDINIT + zconfin = stdin; + zconfout = stdout; +#else + zconfin = (FILE *) 0; + zconfout = (FILE *) 0; +#endif + + /* For future reference: Set errno on error, since we are called by + * zconflex_init() + */ + return 0; +} + /* zconflex_destroy is for both reentrant and non-reentrant scanners. */ int zconflex_destroy (void) { - + /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ zconf_delete_buffer(YY_CURRENT_BUFFER ); @@ -2140,6 +2206,10 @@ zconffree((yy_buffer_stack) ); (yy_buffer_stack) = NULL; + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * zconflex() is called, initialization will occur. */ + yy_init_globals( ); + return 0; } @@ -2151,7 +2221,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { register int i; - for ( i = 0; i < n; ++i ) + for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif @@ -2160,7 +2230,7 @@ static int yy_flex_strlen (yyconst char * s ) { register int n; - for ( n = 0; s[n]; ++n ) + for ( n = 0; s[n]; ++n ) ; return n; @@ -2191,19 +2261,6 @@ #define YYTABLES_NAME "yytables" -#undef YY_NEW_FILE -#undef YY_FLUSH_BUFFER -#undef yy_set_bol -#undef yy_new_buffer -#undef yy_set_interactive -#undef yytext_ptr -#undef YY_DO_BEFORE_ACTION - -#ifdef YY_DECL_IS_OURS -#undef YY_DECL_IS_OURS -#undef YY_DECL -#endif - void zconf_starthelp(void) { new_string(); @@ -2231,7 +2288,7 @@ FILE *f; f = fopen(name, "r"); - if (!f && name[0] != '/') { + if (!f && name != NULL && name[0] != '/') { env = getenv(SRCTREE); if (env) { sprintf(fullname, "%s/%s", env, name); Modified: buildrom-devel/scripts/kconfig/lkc.h =================================================================== --- buildrom-devel/scripts/kconfig/lkc.h 2008-07-01 21:13:46 UTC (rev 209) +++ buildrom-devel/scripts/kconfig/lkc.h 2008-07-02 19:45:34 UTC (rev 210) @@ -31,7 +31,7 @@ #define SRCTREE "srctree" -#define PACKAGE "linux" +#define PACKAGE "buildrom" #define LOCALEDIR "/usr/share/locale" #define _(text) gettext(text) @@ -40,7 +40,12 @@ #define TF_COMMAND 0x0001 #define TF_PARAM 0x0002 +#define TF_OPTION 0x0004 +#define T_OPT_MODULES 1 +#define T_OPT_DEFCONFIG_LIST 2 +#define T_OPT_ENV 3 + struct kconf_id { int name; int token; @@ -60,15 +65,17 @@ char *zconf_curname(void); /* confdata.c */ -extern const char conf_def_filename[]; - +const char *conf_get_configname(void); char *conf_get_default_confname(void); +void sym_set_change_count(int count); +void sym_add_change_count(int count); /* kconfig_load.c */ void kconfig_load(void); /* menu.c */ void menu_init(void); +void menu_warn(struct menu *menu, const char *fmt, ...); struct menu *menu_add_menu(void); void menu_end_menu(void); void menu_add_entry(struct symbol *sym); @@ -78,6 +85,7 @@ struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep); void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep); void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep); +void menu_add_option(int token, char *arg); void menu_finalize(struct menu *parent); void menu_set_type(int type); @@ -97,12 +105,16 @@ const char *str_get(struct gstr *gs); /* symbol.c */ +extern struct expr *sym_env_list; + void sym_init(void); void sym_clear_all_valid(void); +void sym_set_all_changed(void); void sym_set_changed(struct symbol *sym); struct symbol *sym_check_deps(struct symbol *sym); struct property *prop_alloc(enum prop_type type, struct symbol *sym); struct symbol *prop_get_symbol(struct property *prop); +struct property *sym_get_env_prop(struct symbol *sym); static inline tristate sym_get_tristate_value(struct symbol *sym) { @@ -137,7 +149,7 @@ static inline bool sym_has_value(struct symbol *sym) { - return sym->flags & SYMBOL_NEW ? false : true; + return sym->flags & SYMBOL_DEF_USER ? true : false; } #ifdef __cplusplus Modified: buildrom-devel/scripts/kconfig/lkc_proto.h =================================================================== --- buildrom-devel/scripts/kconfig/lkc_proto.h 2008-07-01 21:13:46 UTC (rev 209) +++ buildrom-devel/scripts/kconfig/lkc_proto.h 2008-07-02 19:45:34 UTC (rev 210) @@ -2,8 +2,11 @@ /* confdata.c */ P(conf_parse,void,(const char *name)); P(conf_read,int,(const char *name)); -P(conf_read_simple,int,(const char *name)); +P(conf_read_simple,int,(const char *name, int)); P(conf_write,int,(const char *name)); +P(conf_write_autoconf,int,(void)); +P(conf_get_changed,bool,(void)); +P(conf_set_changed_callback, void,(void (*fn)(void))); /* menu.c */ P(rootmenu,struct menu,); @@ -12,10 +15,11 @@ P(menu_get_prompt,const char *,(struct menu *menu)); P(menu_get_root_menu,struct menu *,(struct menu *menu)); P(menu_get_parent_menu,struct menu *,(struct menu *menu)); +P(menu_has_help,bool,(struct menu *menu)); +P(menu_get_help,const char *,(struct menu *menu)); /* symbol.c */ P(symbol_hash,struct symbol *,[SYMBOL_HASHSIZE]); -P(sym_change_count,int,); P(sym_lookup,struct symbol *,(const char *name, int isconst)); P(sym_find,struct symbol *,(const char *name)); @@ -38,4 +42,4 @@ /* expr.c */ P(expr_compare_type,int,(enum expr_type t1, enum expr_type t2)); -P(expr_print,void,(struct expr *e, void (*fn)(void *, const char *), void *data, int prevtoken)); +P(expr_print,void,(struct expr *e, void (*fn)(void *, struct symbol *, const char *), void *data, int prevtoken)); Added: buildrom-devel/scripts/kconfig/lxdialog/.gitignore =================================================================== --- buildrom-devel/scripts/kconfig/lxdialog/.gitignore (rev 0) +++ buildrom-devel/scripts/kconfig/lxdialog/.gitignore 2008-07-02 19:45:34 UTC (rev 210) @@ -0,0 +1,4 @@ +# +# Generated files +# +lxdialog Modified: buildrom-devel/scripts/kconfig/lxdialog/BIG.FAT.WARNING =================================================================== --- buildrom-devel/scripts/kconfig/lxdialog/BIG.FAT.WARNING 2008-07-01 21:13:46 UTC (rev 209) +++ buildrom-devel/scripts/kconfig/lxdialog/BIG.FAT.WARNING 2008-07-02 19:45:34 UTC (rev 210) @@ -1,4 +1,4 @@ This is NOT the official version of dialog. This version has been significantly modified from the original. It is for use by the Linux -busybox configuration script. Please do not bother Savio Lam with +kernel configuration script. Please do not bother Savio Lam with questions about this program. Deleted: buildrom-devel/scripts/kconfig/lxdialog/Makefile =================================================================== --- buildrom-devel/scripts/kconfig/lxdialog/Makefile 2008-07-01 21:13:46 UTC (rev 209) +++ buildrom-devel/scripts/kconfig/lxdialog/Makefile 2008-07-02 19:45:34 UTC (rev 210) @@ -1,32 +0,0 @@ -# Makefile to build lxdialog package -# - -CONFIG_SHELL := sh - -check-lxdialog := ./check-lxdialog.sh - -HOSTCC ?= gcc - -# Use recursively expanded variables so we do not call gcc unless -# we really need to do so. (Do not call gcc as part of make mrproper) -HOST_EXTRACFLAGS = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags) -HOST_LOADLIBES = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC)) - -HOST_EXTRACFLAGS += -DLOCALE - -PHONY += dochecklxdialog -dochecklxdialog: - $(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_LOADLIBES) - -hostprogs-y := lxdialog -always := $(hostprogs-y) dochecklxdialog - -lxdialog-objs := checklist.o menubox.o textbox.o yesno.o inputbox.o \ - util.o lxdialog.o msgbox.o - -lxdialog: dochecklxdialog $(lxdialog-objs) - $(CC) $(HOST_LOADLIBES) -o lxdialog $(lxdialog-objs) - -%.o: %.c - $(Q)$(HOSTCC) $(HOST_EXTRACFLAGS) $^ -c -o $@ - Modified: buildrom-devel/scripts/kconfig/lxdialog/check-lxdialog.sh =================================================================== --- buildrom-devel/scripts/kconfig/lxdialog/check-lxdialog.sh 2008-07-01 21:13:46 UTC (rev 209) +++ buildrom-devel/scripts/kconfig/lxdialog/check-lxdialog.sh 2008-07-02 19:45:34 UTC (rev 210) @@ -4,21 +4,15 @@ # What library to link ldflags() { - $cc -print-file-name=libncursesw.so | grep -q / - if [ $? -eq 0 ]; then - echo '-lncursesw' - exit - fi - $cc -print-file-name=libncurses.so | grep -q / - if [ $? -eq 0 ]; then - echo '-lncurses' - exit - fi - $cc -print-file-name=libcurses.so | grep -q / - if [ $? -eq 0 ]; then - echo '-lcurses' - exit - fi + for ext in so a dylib ; do + for lib in ncursesw ncurses curses ; do + $cc -print-file-name=lib${lib}.${ext} | grep -q / + if [ $? -eq 0 ]; then + echo "-l${lib}" + exit + fi + done + done exit 1 } @@ -42,14 +36,16 @@ # Check if we can link to ncurses check() { - echo "main() {}" | $cc -xc - -o $tmp 2> /dev/null + echo -e " #include CURSES_LOC \n main() {}" | + $cc -xc - -o $tmp 2> /dev/null if [ $? != 0 ]; then - echo " *** Unable to find the ncurses libraries." 1>&2 - echo " *** make menuconfig require the ncurses libraries" 1>&2 - echo " *** " 1>&2 - echo " *** Install ncurses (ncurses-devel) and try again" 1>&2 - echo " *** " 1>&2 - exit 1 + echo " *** Unable to find the ncurses libraries or the" 1>&2 + echo " *** required header files." 1>&2 + echo " *** 'make menuconfig' requires the ncurses libraries." 1>&2 + echo " *** " 1>&2 + echo " *** Install ncurses (ncurses-devel) and try again." 1>&2 + echo " *** " 1>&2 + exit 1 fi } @@ -57,7 +53,7 @@ printf "Usage: $0 [-check compiler options|-header|-library]\n" } -if [ $# == 0 ]; then +if [ $# -eq 0 ]; then usage exit 1 fi Modified: buildrom-devel/scripts/kconfig/lxdialog/checklist.c =================================================================== --- buildrom-devel/scripts/kconfig/lxdialog/checklist.c 2008-07-01 21:13:46 UTC (rev 209) +++ buildrom-devel/scripts/kconfig/lxdialog/checklist.c 2008-07-02 19:45:34 UTC (rev 210) @@ -28,25 +28,25 @@ /* * Print list item */ -static void print_item(WINDOW * win, const char *item, int status, int choice, - int selected) +static void print_item(WINDOW * win, int choice, int selected) { int i; /* Clear 'residue' of last item */ - wattrset(win, menubox_attr); + wattrset(win, dlg.menubox.atr); wmove(win, choice, 0); for (i = 0; i < list_width; i++) waddch(win, ' '); wmove(win, choice, check_x); - wattrset(win, selected ? check_selected_attr : check_attr); - wprintw(win, "(%c)", status ? 'X' : ' '); + wattrset(win, selected ? dlg.check_selected.atr + : dlg.check.atr); + wprintw(win, "(%c)", item_is_tag('X') ? 'X' : ' '); - wattrset(win, selected ? tag_selected_attr : tag_attr); - mvwaddch(win, choice, item_x, item[0]); - wattrset(win, selected ? item_selected_attr : item_attr); - waddstr(win, (char *)item + 1); + wattrset(win, selected ? dlg.tag_selected.atr : dlg.tag.atr); + mvwaddch(win, choice, item_x, item_str()[0]); + wattrset(win, selected ? dlg.item_selected.atr : dlg.item.atr); + waddstr(win, (char *)item_str() + 1); if (selected) { wmove(win, choice, check_x + 1); wrefresh(win); @@ -62,11 +62,11 @@ wmove(win, y, x); if (scroll > 0) { - wattrset(win, uarrow_attr); + wattrset(win, dlg.uarrow.atr); waddch(win, ACS_UARROW); waddstr(win, "(-)"); } else { - wattrset(win, menubox_attr); + wattrset(win, dlg.menubox.atr); waddch(win, ACS_HLINE); waddch(win, ACS_HLINE); waddch(win, ACS_HLINE); @@ -77,11 +77,11 @@ wmove(win, y, x); if ((height < item_no) && (scroll + choice < item_no - 1)) { - wattrset(win, darrow_attr); + wattrset(win, dlg.darrow.atr); waddch(win, ACS_DARROW); waddstr(win, "(+)"); } else { - wattrset(win, menubox_border_attr); + wattrset(win, dlg.menubox_border.atr); waddch(win, ACS_HLINE); waddch(win, ACS_HLINE); waddch(win, ACS_HLINE); @@ -97,8 +97,8 @@ int x = width / 2 - 11; int y = height - 2; - print_button(dialog, "Select", y, x, selected == 0); - print_button(dialog, " Help ", y, x + 14, selected == 1); + print_button(dialog, gettext("Select"), y, x, selected == 0); + print_button(dialog, gettext(" Help "), y, x + 14, selected == 1); wmove(dialog, y, x + 1 + 14 * selected); wrefresh(dialog); @@ -109,32 +109,29 @@ * in the style of radiolist (only one option turned on at a time). */ int dialog_checklist(const char *title, const char *prompt, int height, - int width, int list_height, int item_no, - const char *const *items) + int width, int list_height) { int i, x, y, box_x, box_y; - int key = 0, button = 0, choice = 0, scroll = 0, max_choice, *status; + int key = 0, button = 0, choice = 0, scroll = 0, max_choice; WINDOW *dialog, *list; - /* Allocate space for storing item on/off status */ - if ((status = malloc(sizeof(int) * item_no)) == NULL) { - endwin(); - fprintf(stderr, - "\nCan't allocate memory in dialog_checklist().\n"); - exit(-1); + /* which item to highlight */ + item_foreach() { + if (item_is_tag('X')) + choice = item_n(); + if (item_is_selected()) { + choice = item_n(); + break; + } } - /* Initializes status */ - for (i = 0; i < item_no; i++) { - status[i] = !strcasecmp(items[i * 3 + 2], "on"); - if ((!choice && status[i]) - || !strcasecmp(items[i * 3 + 2], "selected")) - choice = i + 1; - } - if (choice) - choice--; +do_resize: + if (getmaxy(stdscr) < (height + 6)) + return -ERRDISPLAYTOOSMALL; + if (getmaxx(stdscr) < (width + 6)) + return -ERRDISPLAYTOOSMALL; - max_choice = MIN(list_height, item_no); + max_choice = MIN(list_height, item_count()); /* center dialog box on screen */ x = (COLS - width) / 2; @@ -145,17 +142,18 @@ dialog = newwin(height, width, y, x); keypad(dialog, TRUE); - draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr); - wattrset(dialog, border_attr); + draw_box(dialog, 0, 0, height, width, + dlg.dialog.atr, dlg.border.atr); + wattrset(dialog, dlg.border.atr); mvwaddch(dialog, height - 3, 0, ACS_LTEE); for (i = 0; i < width - 2; i++) waddch(dialog, ACS_HLINE); - wattrset(dialog, dialog_attr); + wattrset(dialog, dlg.dialog.atr); waddch(dialog, ACS_RTEE); print_title(dialog, title, width); - wattrset(dialog, dialog_attr); + wattrset(dialog, dlg.dialog.atr); print_autowrap(dialog, prompt, width - 2, 1, 3); list_width = width - 6; @@ -170,12 +168,12 @@ /* draw a box around the list items */ draw_box(dialog, box_y, box_x, list_height + 2, list_width + 2, - menubox_border_attr, menubox_attr); + dlg.menubox_border.atr, dlg.menubox.atr); /* Find length of longest item in order to center checklist */ check_x = 0; - for (i = 0; i < item_no; i++) - check_x = MAX(check_x, +strlen(items[i * 3 + 1]) + 4); + item_foreach() + check_x = MAX(check_x, strlen(item_str()) + 4); check_x = (list_width - check_x) / 2; item_x = check_x + 4; @@ -187,11 +185,11 @@ /* Print the list */ for (i = 0; i < max_choice; i++) { - print_item(list, items[(scroll + i) * 3 + 1], - status[i + scroll], i, i == choice); + item_set(scroll + i); + print_item(list, i, i == choice); } - print_arrows(dialog, choice, item_no, scroll, + print_arrows(dialog, choice, item_count(), scroll, box_y, box_x + check_x + 5, list_height); print_buttons(dialog, height, width, 0); @@ -200,13 +198,14 @@ wnoutrefresh(list); doupdate(); - while (key != ESC) { + while (key != KEY_ESC) { key = wgetch(dialog); - for (i = 0; i < max_choice; i++) - if (toupper(key) == - toupper(items[(scroll + i) * 3 + 1][0])) + for (i = 0; i < max_choice; i++) { + item_set(i + scroll); + if (toupper(key) == toupper(item_str()[0])) break; + } if (i < max_choice || key == KEY_UP || key == KEY_DOWN || key == '+' || key == '-') { @@ -217,15 +216,16 @@ /* Scroll list down */ if (list_height > 1) { /* De-highlight current first item */ - print_item(list, items[scroll * 3 + 1], - status[scroll], 0, FALSE); + item_set(scroll); + print_item(list, 0, FALSE); scrollok(list, TRUE); wscrl(list, -1); scrollok(list, FALSE); } scroll--; - print_item(list, items[scroll * 3 + 1], status[scroll], 0, TRUE); - print_arrows(dialog, choice, item_no, + item_set(scroll); + print_item(list, 0, TRUE); + print_arrows(dialog, choice, item_count(), scroll, box_y, box_x + check_x + 5, list_height); wnoutrefresh(dialog); @@ -236,23 +236,24 @@ i = choice - 1; } else if (key == KEY_DOWN || key == '+') { if (choice == max_choice - 1) { - if (scroll + choice >= item_no - 1) + if (scroll + choice >= item_count() - 1) continue; /* Scroll list up */ if (list_height > 1) { /* De-highlight current last item before scrolling up */ - print_item(list, items[(scroll + max_choice - 1) * 3 + 1], - status[scroll + max_choice - 1], - max_choice - 1, FALSE); + item_set(scroll + max_choice - 1); + print_item(list, + max_choice - 1, + FALSE); scrollok(list, TRUE); wscrl(list, 1); scrollok(list, FALSE); } scroll++; - print_item(list, items[(scroll + max_choice - 1) * 3 + 1], - status[scroll + max_choice - 1], max_choice - 1, TRUE); + item_set(scroll + max_choice - 1); + print_item(list, max_choice - 1, TRUE); - print_arrows(dialog, choice, item_no, + print_arrows(dialog, choice, item_count(), scroll, box_y, box_x + check_x + 5, list_height); wnoutrefresh(dialog); @@ -264,12 +265,12 @@ } if (i != choice) { /* De-highlight current item */ - print_item(list, items[(scroll + choice) * 3 + 1], - status[scroll + choice], choice, FALSE); + item_set(scroll + choice); + print_item(list, choice, FALSE); /* Highlight new item */ choice = i; - print_item(list, items[(scroll + choice) * 3 + 1], - status[scroll + choice], choice, TRUE); + item_set(scroll + choice); + print_item(list, choice, TRUE); wnoutrefresh(dialog); wrefresh(list); } @@ -279,10 +280,19 @@ case 'H': case 'h': case '?': - fprintf(stderr, "%s", items[(scroll + choice) * 3]); + button = 1; + /* fall-through */ + case 'S': + case 's': + case ' ': + case '\n': + item_foreach() + item_set_selected(0); + item_set(scroll + choice); + item_set_selected(1); + delwin(list); delwin(dialog); - free(status); - return 1; + return button; case TAB: case KEY_LEFT: case KEY_RIGHT: @@ -292,42 +302,24 @@ print_buttons(dialog, height, width, button); wrefresh(dialog); break; - case 'S': - case 's': - case ' ': - case '\n': - if (!button) { - if (!status[scroll + choice]) { - for (i = 0; i < item_no; i++) - status[i] = 0; - status[scroll + choice] = 1; - for (i = 0; i < max_choice; i++) - print_item(list, items[(scroll + i) * 3 + 1], - status[scroll + i], i, i == choice); - } - wnoutrefresh(dialog); - wrefresh(list); - - for (i = 0; i < item_no; i++) - if (status[i]) - fprintf(stderr, "%s", items[i * 3]); - } else - fprintf(stderr, "%s", items[(scroll + choice) * 3]); - delwin(dialog); - free(status); - return button; case 'X': case 'x': - key = ESC; - case ESC: + key = KEY_ESC; break; + case KEY_ESC: + key = on_key_esc(dialog); + break; + case KEY_RESIZE: + delwin(list); + delwin(dialog); + on_key_resize(); + goto do_resize; } /* Now, update everything... */ doupdate(); } - + delwin(list); delwin(dialog); - free(status); - return -1; /* ESC pressed */ + return key; /* ESC pressed */ } Deleted: buildrom-devel/scripts/kconfig/lxdialog/colors.h =================================================================== --- buildrom-devel/scripts/kconfig/lxdialog/colors.h 2008-07-01 21:13:46 UTC (rev 209) +++ buildrom-devel/scripts/kconfig/lxdialog/colors.h 2008-07-02 19:45:34 UTC (rev 210) @@ -1,154 +0,0 @@ -/* - * colors.h -- color attribute definitions - * - * AUTHOR: Savio Lam (lam836 at cs.cuhk.hk) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - * Default color definitions - * - * *_FG = foreground - * *_BG = background - * *_HL = highlight? - */ -#define SCREEN_FG COLOR_CYAN -#define SCREEN_BG COLOR_BLUE -#define SCREEN_HL TRUE - -#define SHADOW_FG COLOR_BLACK -#define SHADOW_BG COLOR_BLACK -#define SHADOW_HL TRUE - -#define DIALOG_FG COLOR_BLACK -#define DIALOG_BG COLOR_WHITE -#define DIALOG_HL FALSE - -#define TITLE_FG COLOR_YELLOW -#define TITLE_BG COLOR_WHITE -#define TITLE_HL TRUE - -#define BORDER_FG COLOR_WHITE -#define BORDER_BG COLOR_WHITE -#define BORDER_HL TRUE - -#define BUTTON_ACTIVE_FG COLOR_WHITE -#define BUTTON_ACTIVE_BG COLOR_BLUE -#define BUTTON_ACTIVE_HL TRUE - -#define BUTTON_INACTIVE_FG COLOR_BLACK -#define BUTTON_INACTIVE_BG COLOR_WHITE -#define BUTTON_INACTIVE_HL FALSE - -#define BUTTON_KEY_ACTIVE_FG COLOR_WHITE -#define BUTTON_KEY_ACTIVE_BG COLOR_BLUE -#define BUTTON_KEY_ACTIVE_HL TRUE - -#define BUTTON_KEY_INACTIVE_FG COLOR_RED -#define BUTTON_KEY_INACTIVE_BG COLOR_WHITE -#define BUTTON_KEY_INACTIVE_HL FALSE - -#define BUTTON_LABEL_ACTIVE_FG COLOR_YELLOW -#define BUTTON_LABEL_ACTIVE_BG COLOR_BLUE -#define BUTTON_LABEL_ACTIVE_HL TRUE - -#define BUTTON_LABEL_INACTIVE_FG COLOR_BLACK -#define BUTTON_LABEL_INACTIVE_BG COLOR_WHITE -#define BUTTON_LABEL_INACTIVE_HL TRUE - -#define INPUTBOX_FG COLOR_BLACK -#define INPUTBOX_BG COLOR_WHITE -#define INPUTBOX_HL FALSE - -#define INPUTBOX_BORDER_FG COLOR_BLACK -#define INPUTBOX_BORDER_BG COLOR_WHITE -#define INPUTBOX_BORDER_HL FALSE - -#define SEARCHBOX_FG COLOR_BLACK -#define SEARCHBOX_BG COLOR_WHITE -#define SEARCHBOX_HL FALSE - -#define SEARCHBOX_TITLE_FG COLOR_YELLOW -#define SEARCHBOX_TITLE_BG COLOR_WHITE -#define SEARCHBOX_TITLE_HL TRUE - -#define SEARCHBOX_BORDER_FG COLOR_WHITE -#define SEARCHBOX_BORDER_BG COLOR_WHITE -#define SEARCHBOX_BORDER_HL TRUE - -#define POSITION_INDICATOR_FG COLOR_YELLOW -#define POSITION_INDICATOR_BG COLOR_WHITE -#define POSITION_INDICATOR_HL TRUE - -#define MENUBOX_FG COLOR_BLACK -#define MENUBOX_BG COLOR_WHITE -#define MENUBOX_HL FALSE - -#define MENUBOX_BORDER_FG COLOR_WHITE -#define MENUBOX_BORDER_BG COLOR_WHITE -#define MENUBOX_BORDER_HL TRUE - -#define ITEM_FG COLOR_BLACK -#define ITEM_BG COLOR_WHITE -#define ITEM_HL FALSE - -#define ITEM_SELECTED_FG COLOR_WHITE -#define ITEM_SELECTED_BG COLOR_BLUE -#define ITEM_SELECTED_HL TRUE - -#define TAG_FG COLOR_YELLOW -#define TAG_BG COLOR_WHITE -#define TAG_HL TRUE - -#define TAG_SELECTED_FG COLOR_YELLOW -#define TAG_SELECTED_BG COLOR_BLUE -#define TAG_SELECTED_HL TRUE - -#define TAG_KEY_FG COLOR_YELLOW -#define TAG_KEY_BG COLOR_WHITE -#define TAG_KEY_HL TRUE - -#define TAG_KEY_SELECTED_FG COLOR_YELLOW -#define TAG_KEY_SELECTED_BG COLOR_BLUE -#define TAG_KEY_SELECTED_HL TRUE - -#define CHECK_FG COLOR_BLACK -#define CHECK_BG COLOR_WHITE -#define CHECK_HL FALSE - -#define CHECK_SELECTED_FG COLOR_WHITE -#define CHECK_SELECTED_BG COLOR_BLUE -#define CHECK_SELECTED_HL TRUE - -#define UARROW_FG COLOR_GREEN -#define UARROW_BG COLOR_WHITE -#define UARROW_HL TRUE - -#define DARROW_FG COLOR_GREEN -#define DARROW_BG COLOR_WHITE -#define DARROW_HL TRUE - -/* End of default color definitions */ - -#define C_ATTR(x,y) ((x ? A_BOLD : 0) | COLOR_PAIR((y))) -#define COLOR_NAME_LEN 10 -#define COLOR_COUNT 8 - -/* - * Global variables - */ - -extern int color_table[][3]; Modified: buildrom-devel/scripts/kconfig/lxdialog/dialog.h =================================================================== --- buildrom-devel/scripts/kconfig/lxdialog/dialog.h 2008-07-01 21:13:46 UTC (rev 209) +++ buildrom-devel/scripts/kconfig/lxdialog/dialog.h 2008-07-02 19:45:34 UTC (rev 210) @@ -24,7 +24,14 @@ #include #include #include +#include +#ifndef KBUILD_NO_NLS +# include +#else +# define gettext(Msgid) ((const char *) (Msgid)) +#endif + #ifdef __sun__ #define CURS_MACROS #endif @@ -48,7 +55,7 @@ #define TR(params) _tracef params -#define ESC 27 +#define KEY_ESC 27 #define TAB 9 #define MAX_LEN 2048 #define BUF_SIZE (10*1024) @@ -86,63 +93,111 @@ #define ACS_DARROW 'v' #endif +/* error return codes */ +#define ERRDISPLAYTOOSMALL (KEY_MAX + 1) + /* - * Attribute names + * Color definitions */ -#define screen_attr attributes[0] -#define shadow_attr attributes[1] -#define dialog_attr attributes[2] -#define title_attr attributes[3] -#define border_attr attributes[4] -#define button_active_attr attributes[5] -#define button_inactive_attr attributes[6] -#define button_key_active_attr attributes[7] -#define button_key_inactive_attr attributes[8] -#define button_label_active_attr attributes[9] -#define button_label_inactive_attr attributes[10] -#define inputbox_attr attributes[11] -#define inputbox_border_attr attributes[12] -#define searchbox_attr attributes[13] -#define searchbox_title_attr attributes[14] -#define searchbox_border_attr attributes[15] -#define position_indicator_attr attributes[16] -#define menubox_attr attributes[17] -#define menubox_border_attr attributes[18] -#define item_attr attributes[19] -#define item_selected_attr attributes[20] -#define tag_attr attributes[21] -#define tag_selected_attr attributes[22] -#define tag_key_attr attributes[23] -#define tag_key_selected_attr attributes[24] -#define check_attr attributes[25] -#define check_selected_attr attributes[26] -#define uarrow_attr attributes[27] -#define darrow_attr attributes[28] +struct dialog_color { + chtype atr; /* Color attribute */ + int fg; /* foreground */ + int bg; /* background */ + int hl; /* highlight this item */ +}; -/* number of attributes */ -#define ATTRIBUTE_COUNT 29 +struct dialog_info { + const char *backtitle; + struct dialog_color screen; + struct dialog_color shadow; + struct dialog_color dialog; + struct dialog_color title; + struct dialog_color border; + struct dialog_color button_active; + struct dialog_color button_inactive; + struct dialog_color button_key_active; + struct dialog_color button_key_inactive; + struct dialog_color button_label_active; + struct dialog_color button_label_inactive; + struct dialog_color inputbox; + struct dialog_color inputbox_border; + struct dialog_color searchbox; + struct dialog_color searchbox_title; + struct dialog_color searchbox_border; + struct dialog_color position_indicator; + struct dialog_color menubox; + struct dialog_color menubox_border; + struct dialog_color item; + struct dialog_color item_selected; + struct dialog_color tag; + struct dialog_color tag_selected; + struct dialog_color tag_key; + struct dialog_color tag_key_selected; + struct dialog_color check; + struct dialog_color check_selected; + struct dialog_color uarrow; + struct dialog_color darrow; +}; /* * Global variables */ -extern bool use_colors; -extern bool use_shadow; +extern struct dialog_info dlg; +extern char dialog_input_result[]; -extern chtype attributes[]; - -extern const char *backtitle; - /* * Function prototypes */ -extern void create_rc(const char *filename); -extern int parse_rc(void); -void init_dialog(void); -void end_dialog(void); +/* item list as used by checklist and menubox */ +void item_reset(void); +void item_make(const char *fmt, ...); +void item_add_str(const char *fmt, ...); +void item_set_tag(char tag); +void item_set_data(void *p); +void item_set_selected(int val); +int item_activate_selected(void); +void *item_data(void); +char item_tag(void); + +/* item list manipulation for lxdialog use */ +#define MAXITEMSTR 200 +struct dialog_item { + char str[MAXITEMSTR]; /* promtp displayed */ + char tag; + void *data; /* pointer to menu item - used by menubox+checklist */ + int selected; /* Set to 1 by dialog_*() function if selected. */ +}; + +/* list of lialog_items */ +struct dialog_list { + struct dialog_item node; + struct dialog_list *next; +}; + +extern struct dialog_list *item_cur; +extern struct dialog_list item_nil; +extern struct dialog_list *item_head; + +int item_count(void); +void item_set(int n); +int item_n(void); +const char *item_str(void); +int item_is_selected(void); +int item_is_tag(char tag); +#define item_foreach() \ + for (item_cur = item_head ? item_head: item_cur; \ + item_cur && (item_cur != &item_nil); item_cur = item_cur->next) + +/* generic key handlers */ +int on_key_esc(WINDOW *win); +int on_key_resize(void); + +int init_dialog(const char *backtitle); +void set_dialog_backtitle(const char *backtitle); +void end_dialog(int x, int y); void attr_clear(WINDOW * win, int height, int width, chtype attr); void dialog_clear(void); -void color_setup(void); void print_autowrap(WINDOW * win, const char *prompt, int width, int y, int x); void print_button(WINDOW * win, const char *label, int y, int x, int selected); void print_title(WINDOW *dialog, const char *title, int width); @@ -155,12 +210,10 @@ int dialog_msgbox(const char *title, const char *prompt, int height, int width, int pause); int dialog_textbox(const char *title, const char *file, int height, int width); -int dialog_menu(const char *title, const char *prompt, int height, int width, - int menu_height, const char *choice, int item_no, - const char *const *items); +int dialog_menu(const char *title, const char *prompt, + const void *selected, int *s_scroll); int dialog_checklist(const char *title, const char *prompt, int height, - int width, int list_height, int item_no, - const char *const *items); + int width, int list_height); extern char dialog_input_result[]; int dialog_inputbox(const char *title, const char *prompt, int height, int width, const char *init); Modified: buildrom-devel/scripts/kconfig/lxdialog/inputbox.c =================================================================== --- buildrom-devel/scripts/kconfig/lxdialog/inputbox.c 2008-07-01 21:13:46 UTC (rev 209) +++ buildrom-devel/scripts/kconfig/lxdialog/inputbox.c 2008-07-02 19:45:34 UTC (rev 210) @@ -31,8 +31,8 @@ int x = width / 2 - 11; int y = height - 2; - print_button(dialog, " Ok ", y, x, selected == 0); - print_button(dialog, " Help ", y, x + 14, selected == 1); + print_button(dialog, gettext(" Ok "), y, x, selected == 0); + print_button(dialog, gettext(" Help "), y, x + 14, selected == 1); wmove(dialog, y, x + 1 + 14 * selected); wrefresh(dialog); @@ -49,6 +49,17 @@ char *instr = dialog_input_result; WINDOW *dialog; + if (!init) + instr[0] = '\0'; + else + strcpy(instr, init); + +do_resize: + if (getmaxy(stdscr) <= (height - 2)) + return -ERRDISPLAYTOOSMALL; + if (getmaxx(stdscr) <= (width - 2)) + return -ERRDISPLAYTOOSMALL; + /* center dialog box on screen */ x = (COLS - width) / 2; y = (LINES - height) / 2; @@ -58,17 +69,18 @@ dialog = newwin(height, width, y, x); keypad(dialog, TRUE); - draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr); - wattrset(dialog, border_attr); + draw_box(dialog, 0, 0, height, width, + dlg.dialog.atr, dlg.border.atr); + wattrset(dialog, dlg.border.atr); mvwaddch(dialog, height - 3, 0, ACS_LTEE); for (i = 0; i < width - 2; i++) waddch(dialog, ACS_HLINE); - wattrset(dialog, dialog_attr); + wattrset(dialog, dlg.dialog.atr); waddch(dialog, ACS_RTEE); print_title(dialog, title, width); - wattrset(dialog, dialog_attr); + wattrset(dialog, dlg.dialog.atr); print_autowrap(dialog, prompt, width - 2, 1, 3); /* Draw the input field box */ @@ -76,19 +88,15 @@ getyx(dialog, y, x); box_y = y + 2; box_x = (width - box_width) / 2; - draw_box(dialog, y + 1, box_x - 1, 3, box_width + 2, border_attr, dialog_attr); + draw_box(dialog, y + 1, box_x - 1, 3, box_width + 2, + dlg.border.atr, dlg.dialog.atr); print_buttons(dialog, height, width, 0); /* Set up the initial value */ wmove(dialog, box_y, box_x); - wattrset(dialog, inputbox_attr); + wattrset(dialog, dlg.inputbox.atr); - if (!init) - instr[0] = '\0'; - else - strcpy(instr, init); - input_x = strlen(instr); if (input_x >= box_width) { @@ -104,7 +112,7 @@ wrefresh(dialog); - while (key != ESC) { + while (key != KEY_ESC) { key = wgetch(dialog); if (button == -1) { /* Input box selected */ @@ -120,7 +128,7 @@ case KEY_BACKSPACE: case 127: if (input_x || scroll) { - wattrset(dialog, inputbox_attr); + wattrset(dialog, dlg.inputbox.atr); if (!input_x) { scroll = scroll < box_width - 1 ? 0 : scroll - (box_width - 1); wmove(dialog, box_y, box_x); @@ -140,7 +148,7 @@ default: if (key < 0x100 && isprint(key)) { if (scroll + input_x < MAX_LEN) { - wattrset(dialog, inputbox_attr); + wattrset(dialog, dlg.inputbox.atr); instr[scroll + input_x] = key; instr[scroll + input_x + 1] = '\0'; if (input_x == box_width - 1) { @@ -213,12 +221,18 @@ return (button == -1 ? 0 : button); case 'X': case 'x': - key = ESC; - case ESC: + key = KEY_ESC; break; + case KEY_ESC: + key = on_key_esc(dialog); + break; + case KEY_RESIZE: + delwin(dialog); + on_key_resize(); + goto do_resize; } } delwin(dialog); - return -1; /* ESC pressed */ + return KEY_ESC; /* ESC pressed */ } Deleted: buildrom-devel/scripts/kconfig/lxdialog/lxdialog.c =================================================================== --- buildrom-devel/scripts/kconfig/lxdialog/lxdialog.c 2008-07-01 21:13:46 UTC (rev 209) +++ buildrom-devel/scripts/kconfig/lxdialog/lxdialog.c 2008-07-02 19:45:34 UTC (rev 210) @@ -1,204 +0,0 @@ -/* - * dialog - Display simple dialog boxes from shell scripts - * - * ORIGINAL AUTHOR: Savio Lam (lam836 at cs.cuhk.hk) - * MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcap at cfw.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include "dialog.h" - -static void Usage(const char *name); - -typedef int (jumperFn) (const char *title, int argc, const char *const *argv); - -struct Mode { - char *name; - int argmin, argmax, argmod; - jumperFn *jumper; -}; - -jumperFn j_menu, j_radiolist, j_yesno, j_textbox, j_inputbox; -jumperFn j_msgbox, j_infobox; - -static struct Mode modes[] = { - {"--menu", 9, 0, 3, j_menu}, - {"--radiolist", 9, 0, 3, j_radiolist}, - {"--yesno", 5, 5, 1, j_yesno}, - {"--textbox", 5, 5, 1, j_textbox}, - {"--inputbox", 5, 6, 1, j_inputbox}, - {"--msgbox", 5, 5, 1, j_msgbox}, - {"--infobox", 5, 5, 1, j_infobox}, - {NULL, 0, 0, 0, NULL} -}; - -static struct Mode *modePtr; - -#ifdef LOCALE -#include -#endif - -int main(int argc, const char *const *argv) -{ - int offset = 0, opt_clear = 0, end_common_opts = 0, retval; - const char *title = NULL; - -#ifdef LOCALE - (void)setlocale(LC_ALL, ""); -#endif - -#ifdef TRACE - trace(TRACE_CALLS | TRACE_UPDATE); -#endif - if (argc < 2) { - Usage(argv[0]); - exit(-1); - } - - while (offset < argc - 1 && !end_common_opts) { /* Common options */ - if (!strcmp(argv[offset + 1], "--title")) { - if (argc - offset < 3 || title != NULL) { - Usage(argv[0]); - exit(-1); - } else { - title = argv[offset + 2]; - offset += 2; - } - } else if (!strcmp(argv[offset + 1], "--backtitle")) { - if (backtitle != NULL) { - Usage(argv[0]); - exit(-1); - } else { - backtitle = argv[offset + 2]; - offset += 2; - } - } else if (!strcmp(argv[offset + 1], "--clear")) { - if (opt_clear) { /* Hey, "--clear" can't appear twice! */ - Usage(argv[0]); - exit(-1); - } else if (argc == 2) { /* we only want to clear the screen */ - init_dialog(); - refresh(); /* init_dialog() will clear the screen for us */ - end_dialog(); - return 0; - } else { - opt_clear = 1; - offset++; - } - } else /* no more common options */ - end_common_opts = 1; - } - - if (argc - 1 == offset) { /* no more options */ - Usage(argv[0]); - exit(-1); - } - /* use a table to look for the requested mode, to avoid code duplication */ - - for (modePtr = modes; modePtr->name; modePtr++) /* look for the mode */ - if (!strcmp(argv[offset + 1], modePtr->name)) - break; - - if (!modePtr->name) - Usage(argv[0]); - if (argc - offset < modePtr->argmin) - Usage(argv[0]); - if (modePtr->argmax && argc - offset > modePtr->argmax) - Usage(argv[0]); - - init_dialog(); - retval = (*(modePtr->jumper)) (title, argc - offset, argv + offset); - - if (opt_clear) { /* clear screen before exit */ - attr_clear(stdscr, LINES, COLS, screen_attr); - refresh(); - } - end_dialog(); - - exit(retval); -} - -/* - * Print program usage - */ -static void Usage(const char *name) -{ - fprintf(stderr, "\ -\ndialog, by Savio Lam (lam836 at cs.cuhk.hk).\ -\n patched by Stuart Herbert (S.Herbert at shef.ac.uk)\ -\n modified/gutted for use as a Linux kernel config tool by \ -\n William Roadcap (roadcapw at cfw.com)\ -\n\ -\n* Display dialog boxes from shell scripts *\ -\n\ -\nUsage: %s --clear\ -\n %s [--title ] [--backtitle <backtitle>] --clear <Box options>\ -\n\ -\nBox options:\ -\n\ -\n --menu <text> <height> <width> <menu height> <tag1> <item1>...\ -\n --radiolist <text> <height> <width> <list height> <tag1> <item1> <status1>...\ -\n --textbox <file> <height> <width>\ -\n --inputbox <text> <height> <width> [<init>]\ -\n --yesno <text> <height> <width>\ -\n", name, name); - exit(-1); -} - -/* - * These are the program jumpers - */ - -int j_menu(const char *t, int ac, const char *const *av) -{ - return dialog_menu(t, av[2], atoi(av[3]), atoi(av[4]), - atoi(av[5]), av[6], (ac - 6) / 2, av + 7); -} - -int j_radiolist(const char *t, int ac, const char *const *av) -{ - return dialog_checklist(t, av[2], atoi(av[3]), atoi(av[4]), - atoi(av[5]), (ac - 6) / 3, av + 6); -} - -int j_textbox(const char *t, int ac, const char *const *av) -{ - return dialog_textbox(t, av[2], atoi(av[3]), atoi(av[4])); -} - -int j_yesno(const char *t, int ac, const char *const *av) -{ - return dialog_yesno(t, av[2], atoi(av[3]), atoi(av[4])); -} - -int j_inputbox(const char *t, int ac, const char *const *av) -{ - int ret = dialog_inputbox(t, av[2], atoi(av[3]), atoi(av[4]), - ac == 6 ? av[5] : (char *)NULL); - if (ret == 0) - fprintf(stderr, dialog_input_result); - return ret; -} - -int j_msgbox(const char *t, int ac, const char *const *av) -{ - return dialog_msgbox(t, av[2], atoi(av[3]), atoi(av[4]), 1); -} - -int j_infobox(const char *t, int ac, const char *const *av) -{ - return dialog_msgbox(t, av[2], atoi(av[3]), atoi(av[4]), 0); -} Modified: buildrom-devel/scripts/kconfig/lxdialog/menubox.c =================================================================== --- buildrom-devel/scripts/kconfig/lxdialog/menubox.c 2008-07-01 21:13:46 UTC (rev 209) +++ buildrom-devel/scripts/kconfig/lxdialog/menubox.c 2008-07-02 19:45:34 UTC (rev 210) @@ -26,7 +26,7 @@ * * *) A bugfix for the Page-Down problem * - * *) Formerly when I used Page Down and Page Up, the cursor would be set + * *) Formerly when I used Page Down and Page Up, the cursor would be set * to the first position in the menu box. Now lxdialog is a bit * smarter and works more like other menu systems (just have a look at * it). @@ -63,19 +63,19 @@ /* * Print menu item */ -static void do_print_item(WINDOW * win, const char *item, int choice, +static void do_print_item(WINDOW * win, const char *item, int line_y, int selected, int hotkey) { int j; char *menu_item = malloc(menu_width + 1); strncpy(menu_item, item, menu_width - item_x); - menu_item[menu_width] = 0; + menu_item[menu_width - item_x] = '\0'; j = first_alpha(menu_item, "YyNnMmHh"); /* Clear 'residue' of last item */ - wattrset(win, menubox_attr); - wmove(win, choice, 0); + wattrset(win, dlg.menubox.atr); + wmove(win, line_y, 0); #if OLD_NCURSES { int i; @@ -85,23 +85,24 @@ #else wclrtoeol(win); #endif - wattrset(win, selected ? item_selected_attr : item_attr); - mvwaddstr(win, choice, item_x, menu_item); + wattrset(win, selected ? dlg.item_selected.atr : dlg.item.atr); + mvwaddstr(win, line_y, item_x, menu_item); if (hotkey) { - wattrset(win, selected ? tag_key_selected_attr : tag_key_attr); - mvwaddch(win, choice, item_x + j, menu_item[j]); + wattrset(win, selected ? dlg.tag_key_selected.atr + : dlg.tag_key.atr); + mvwaddch(win, line_y, item_x + j, menu_item[j]); } if (selected) { - wmove(win, choice, item_x + 1); + wmove(win, line_y, item_x + 1); } free(menu_item); wrefresh(win); } -#define print_item(index, choice, selected) \ -do {\ - int hotkey = (items[(index) * 2][0] != ':'); \ - do_print_item(menu, items[(index) * 2 + 1], choice, selected, hotkey); \ +#define print_item(index, choice, selected) \ +do { \ + item_set(index); \ + do_print_item(menu, item_str(), choice, selected, !item_is_tag(':')); \ } while (0) /* @@ -117,11 +118,11 @@ wmove(win, y, x); if (scroll > 0) { - wattrset(win, uarrow_attr); + wattrset(win, dlg.uarrow.atr); waddch(win, ACS_UARROW); waddstr(win, "(-)"); } else { - wattrset(win, menubox_attr); + wattrset(win, dlg.menubox.atr); waddch(win, ACS_HLINE); waddch(win, ACS_HLINE); waddch(win, ACS_HLINE); @@ -133,11 +134,11 @@ wrefresh(win); if ((height < item_no) && (scroll + height < item_no)) { - wattrset(win, darrow_attr); + wattrset(win, dlg.darrow.atr); waddch(win, ACS_DARROW); waddstr(win, "(+)"); } else { - wattrset(win, menubox_border_attr); + wattrset(win, dlg.menubox_border.atr); waddch(win, ACS_HLINE); waddch(win, ACS_HLINE); waddch(win, ACS_HLINE); @@ -156,9 +157,9 @@ int x = width / 2 - 16; int y = height - 2; - print_button(win, "Select", y, x, selected == 0); - print_button(win, " Exit ", y, x + 12, selected == 1); - print_button(win, " Help ", y, x + 24, selected == 2); + print_button(win, gettext("Select"), y, x, selected == 0); + print_button(win, gettext(" Exit "), y, x + 12, selected == 1); + print_button(win, gettext(" Help "), y, x + 24, selected == 2); wmove(win, y, x + 1 + 12 * selected); wrefresh(win); @@ -178,18 +179,27 @@ /* * Display a menu for choosing among a number of options */ -int dialog_menu(const char *title, const char *prompt, int height, int width, - int menu_height, const char *current, int item_no, - const char *const *items) +int dialog_menu(const char *title, const char *prompt, + const void *selected, int *s_scroll) { int i, j, x, y, box_x, box_y; + int height, width, menu_height; int key = 0, button = 0, scroll = 0, choice = 0; int first_item = 0, max_choice; WINDOW *dialog, *menu; - FILE *f; - max_choice = MIN(menu_height, item_no); +do_resize: + height = getmaxy(stdscr); + width = getmaxx(stdscr); + if (height < 15 || width < 65) + return -ERRDISPLAYTOOSMALL; + height -= 4; + width -= 5; + menu_height = height - 10; + + max_choice = MIN(menu_height, item_count()); + /* center dialog box on screen */ x = (COLS - width) / 2; y = (LINES - height) / 2; @@ -199,18 +209,19 @@ dialog = newwin(height, width, y, x); keypad(dialog, TRUE); - draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr); - wattrset(dialog, border_attr); + draw_box(dialog, 0, 0, height, width, + dlg.dialog.atr, dlg.border.atr); + wattrset(dialog, dlg.border.atr); mvwaddch(dialog, height - 3, 0, ACS_LTEE); for (i = 0; i < width - 2; i++) waddch(dialog, ACS_HLINE); - wattrset(dialog, dialog_attr); - wbkgdset(dialog, dialog_attr & A_COLOR); + wattrset(dialog, dlg.dialog.atr); + wbkgdset(dialog, dlg.dialog.atr & A_COLOR); waddch(dialog, ACS_RTEE); print_title(dialog, title, width); - wattrset(dialog, dialog_attr); + wattrset(dialog, dlg.dialog.atr); print_autowrap(dialog, prompt, width - 2, 1, 3); menu_width = width - 6; @@ -224,33 +235,29 @@ /* draw a box around the menu items */ draw_box(dialog, box_y, box_x, menu_height + 2, menu_width + 2, - menubox_border_attr, menubox_attr); + dlg.menubox_border.atr, dlg.menubox.atr); - item_x = (menu_width - 70) / 2; + if (menu_width >= 80) + item_x = (menu_width - 70) / 2; + else + item_x = 4; /* Set choice to default item */ - for (i = 0; i < item_no; i++) - if (strcmp(current, items[i * 2]) == 0) - choice = i; - - /* get the scroll info from the temp file */ - if ((f = fopen("lxdialog.scrltmp", "r")) != NULL) { - if ((fscanf(f, "%d\n", &scroll) == 1) && (scroll <= choice) && - (scroll + max_choice > choice) && (scroll >= 0) && - (scroll + max_choice <= item_no)) { - first_item = scroll; - choice = choice - scroll; - fclose(f); - } else { - scroll = 0; - remove("lxdialog.scrltmp"); - fclose(f); - f = NULL; - } + item_foreach() + if (selected && (selected == item_data())) + choice = item_n(); + /* get the saved scroll info */ + scroll = *s_scroll; + if ((scroll <= choice) && (scroll + max_choice > choice) && + (scroll >= 0) && (scroll + max_choice <= item_count())) { + first_item = scroll; + choice = choice - scroll; + } else { + scroll = 0; } - if ((choice >= max_choice) || (f == NULL && choice >= max_choice / 2)) { - if (choice >= item_no - max_choice / 2) - scroll = first_item = item_no - max_choice; + if ((choice >= max_choice)) { + if (choice >= item_count() - max_choice / 2) + scroll = first_item = item_count() - max_choice; else scroll = first_item = choice - max_choice / 2; choice = choice - scroll; @@ -263,14 +270,14 @@ wnoutrefresh(menu); - print_arrows(dialog, item_no, scroll, + print_arrows(dialog, item_count(), scroll, box_y, box_x + item_x + 1, menu_height); print_buttons(dialog, height, width, 0); wmove(menu, choice, item_x + 1); wrefresh(menu); - while (key != ESC) { + while (key != KEY_ESC) { key = wgetch(menu); if (key < 256 && isalpha(key)) @@ -280,14 +287,16 @@ i = max_choice; else { for (i = choice + 1; i < max_choice; i++) { - j = first_alpha(items[(scroll + i) * 2 + 1], "YyNnMmHh"); - if (key == tolower(items[(scroll + i) * 2 + 1][j])) + item_set(scroll + i); + j = first_alpha(item_str(), "YyNnMmHh"); + if (key == tolower(item_str()[j])) break; } if (i == max_choice) for (i = 0; i < max_choice; i++) { - j = first_alpha(items [(scroll + i) * 2 + 1], "YyNnMmHh"); - if (key == tolower(items[(scroll + i) * 2 + 1][j])) + item_set(scroll + i); + j = first_alpha(item_str(), "YyNnMmHh"); + if (key == tolower(item_str()[j])) break; } } @@ -312,7 +321,7 @@ print_item(scroll+choice, choice, FALSE); if ((choice > max_choice - 3) && - (scroll + max_choice < item_no)) { + (scroll + max_choice < item_count())) { /* Scroll menu up */ do_scroll(menu, &scroll, 1); @@ -335,7 +344,7 @@ } else if (key == KEY_NPAGE) { for (i = 0; (i < max_choice); i++) { - if (scroll + max_choice < item_no) { + if (scroll + max_choice < item_count()) { do_scroll(menu, &scroll, 1); print_item(scroll+max_choice-1, max_choice - 1, FALSE); @@ -349,7 +358,7 @@ print_item(scroll + choice, choice, TRUE); - print_arrows(dialog, item_no, scroll, + print_arrows(dialog, item_count(), scroll, box_y, box_x + item_x + 1, menu_height); wnoutrefresh(dialog); @@ -375,12 +384,11 @@ case 'm': case '/': /* save scroll info */ - if ((f = fopen("lxdialog.scrltmp", "w")) != NULL) { - fprintf(f, "%d\n", scroll); - fclose(f); - } + *s_scroll = scroll; + delwin(menu); delwin(dialog); - fprintf(stderr, "%s\n", items[(scroll + choice) * 2]); + item_set(scroll + choice); + item_set_selected(1); switch (key) { case 's': return 3; @@ -400,27 +408,27 @@ case '?': button = 2; case '\n': + *s_scroll = scroll; + delwin(menu); delwin(dialog); - if (button == 2) - fprintf(stderr, "%s \"%s\"\n", - items[(scroll + choice) * 2], - items[(scroll + choice) * 2 + 1] + - first_alpha(items [(scroll + choice) * 2 + 1], "")); - else - fprintf(stderr, "%s\n", - items[(scroll + choice) * 2]); - - remove("lxdialog.scrltmp"); + item_set(scroll + choice); + item_set_selected(1); return button; case 'e': case 'x': - key = ESC; - case ESC: + key = KEY_ESC; break; + case KEY_ESC: + key = on_key_esc(menu); + break; + case KEY_RESIZE: + on_key_resize(); + delwin(menu); + delwin(dialog); + goto do_resize; } } - + delwin(menu); delwin(dialog); - remove("lxdialog.scrltmp"); - return -1; /* ESC pressed */ + return key; /* ESC pressed */ } Deleted: buildrom-devel/scripts/kconfig/lxdialog/msgbox.c =================================================================== --- buildrom-devel/scripts/kconfig/lxdialog/msgbox.c 2008-07-01 21:13:46 UTC (rev 209) +++ buildrom-devel/scripts/kconfig/lxdialog/msgbox.c 2008-07-02 19:45:34 UTC (rev 210) @@ -1,71 +0,0 @@ -/* - * msgbox.c -- implements the message box and info box - * - * ORIGINAL AUTHOR: Savio Lam (lam836 at cs.cuhk.hk) - * MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcapw at cfw.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include "dialog.h" - -/* - * Display a message box. Program will pause and display an "OK" button - * if the parameter 'pause' is non-zero. - */ -int dialog_msgbox(const char *title, const char *prompt, int height, int width, - int pause) -{ - int i, x, y, key = 0; - WINDOW *dialog; - - /* center dialog box on screen */ - x = (COLS - width) / 2; - y = (LINES - height) / 2; - - draw_shadow(stdscr, y, x, height, width); - - dialog = newwin(height, width, y, x); - keypad(dialog, TRUE); - - draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr); - - print_title(dialog, title, width); - - wattrset(dialog, dialog_attr); - print_autowrap(dialog, prompt, width - 2, 1, 2); - - if (pause) { - wattrset(dialog, border_attr); - mvwaddch(dialog, height - 3, 0, ACS_LTEE); - for (i = 0; i < width - 2; i++) - waddch(dialog, ACS_HLINE); - wattrset(dialog, dialog_attr); - waddch(dialog, ACS_RTEE); - - print_button(dialog, " Ok ", height - 2, width / 2 - 4, TRUE); - - wrefresh(dialog); - while (key != ESC && key != '\n' && key != ' ' && - key != 'O' && key != 'o' && key != 'X' && key != 'x') - key = wgetch(dialog); - } else { - key = '\n'; - wrefresh(dialog); - } - - delwin(dialog); - return key == ESC ? -1 : 0; -} Modified: buildrom-devel/scripts/kconfig/lxdialog/textbox.c =================================================================== --- buildrom-devel/scripts/kconfig/lxdialog/textbox.c 2008-07-01 21:13:46 UTC (rev 209) +++ buildrom-devel/scripts/kconfig/lxdialog/textbox.c 2008-07-02 19:45:34 UTC (rev 210) @@ -25,56 +25,62 @@ static void print_page(WINDOW * win, int height, int width); static void print_line(WINDOW * win, int row, int width); static char *get_line(void); -static void print_position(WINDOW * win, int height, int width); +static void print_position(WINDOW * win); -static int hscroll, fd, file_size, bytes_read; -static int begin_reached = 1, end_reached, page_length; -static char *buf, *page; +static int hscroll; +static int begin_reached, end_reached, page_length; +static const char *buf; +static const char *page; /* + * refresh window content + */ +static void refresh_text_box(WINDOW *dialog, WINDOW *box, int boxh, int boxw, + int cur_y, int cur_x) +{ + print_page(box, boxh, boxw); + print_position(dialog); + wmove(dialog, cur_y, cur_x); /* Restore cursor position */ + wrefresh(dialog); +} + + +/* * Display text from a file in a dialog box. */ -int dialog_textbox(const char *title, const char *file, int height, int width) +int dialog_textbox(const char *title, const char *tbuf, + int initial_height, int initial_width) { - int i, x, y, cur_x, cur_y, fpos, key = 0; + int i, x, y, cur_x, cur_y, key = 0; + int height, width, boxh, boxw; int passed_end; - char search_term[MAX_LEN + 1]; - WINDOW *dialog, *text; + WINDOW *dialog, *box; - search_term[0] = '\0'; /* no search term entered yet */ + begin_reached = 1; + end_reached = 0; + page_length = 0; + hscroll = 0; + buf = tbuf; + page = buf; /* page is pointer to start of page to be displayed */ - /* Open input file for reading */ - if ((fd = open(file, O_RDONLY)) == -1) { - endwin(); - fprintf(stderr, "\nCan't open input file in dialog_textbox().\n"); - exit(-1); - } - /* Get file size. Actually, 'file_size' is the real file size - 1, - since it's only the last byte offset from the beginning */ - if ((file_size = lseek(fd, 0, SEEK_END)) == -1) { - endwin(); - fprintf(stderr, "\nError getting file size in dialog_textbox().\n"); - exit(-1); - } - /* Restore file pointer to beginning of file after getting file size */ - if (lseek(fd, 0, SEEK_SET) == -1) { - endwin(); - fprintf(stderr, "\nError moving file pointer in dialog_textbox().\n"); - exit(-1); - } - /* Allocate space for read buffer */ - if ((buf = malloc(BUF_SIZE + 1)) == NULL) { - endwin(); - fprintf(stderr, "\nCan't allocate memory in dialog_textbox().\n"); - exit(-1); - } - if ((bytes_read = read(fd, buf, BUF_SIZE)) == -1) { - endwin(); - fprintf(stderr, "\nError reading file in dialog_textbox().\n"); - exit(-1); - } - buf[bytes_read] = '\0'; /* mark end of valid data */ - page = buf; /* page is pointer to start of page to be displayed */ +do_resize: + getmaxyx(stdscr, height, width); + if (height < 8 || width < 8) + return -ERRDISPLAYTOOSMALL; + if (initial_height != 0) + height = initial_height; + else + if (height > 4) + height -= 4; + else + height = 0; + if (initial_width != 0) + width = initial_width; + else + if (width > 5) + width -= 5; + else + width = 0; /* center dialog box on screen */ x = (COLS - width) / 2; @@ -85,110 +91,65 @@ dialog = newwin(height, width, y, x); keypad(dialog, TRUE); - /* Create window for text region, used for scrolling text */ - text = subwin(dialog, height - 4, width - 2, y + 1, x + 1); - wattrset(text, dialog_attr); - wbkgdset(text, dialog_attr & A_COLOR); + /* Create window for box region, used for scrolling text */ + boxh = height - 4; + boxw = width - 2; + box = subwin(dialog, boxh, boxw, y + 1, x + 1); + wattrset(box, dlg.dialog.atr); + wbkgdset(box, dlg.dialog.atr & A_COLOR); - keypad(text, TRUE); + keypad(box, TRUE); /* register the new window, along with its borders */ - draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr); + draw_box(dialog, 0, 0, height, width, + dlg.dialog.atr, dlg.border.atr); - wattrset(dialog, border_attr); + wattrset(dialog, dlg.border.atr); mvwaddch(dialog, height - 3, 0, ACS_LTEE); for (i = 0; i < width - 2; i++) waddch(dialog, ACS_HLINE); - wattrset(dialog, dialog_attr); - wbkgdset(dialog, dialog_attr & A_COLOR); + wattrset(dialog, dlg.dialog.atr); + wbkgdset(dialog, dlg.dialog.atr & A_COLOR); waddch(dialog, ACS_RTEE); print_title(dialog, title, width); - print_button(dialog, " Exit ", height - 2, width / 2 - 4, TRUE); + print_button(dialog, gettext(" Exit "), height - 2, width / 2 - 4, TRUE); wnoutrefresh(dialog); getyx(dialog, cur_y, cur_x); /* Save cursor position */ /* Print first page of text */ - attr_clear(text, height - 4, width - 2, dialog_attr); - print_page(text, height - 4, width - 2); - print_position(dialog, height, width); - wmove(dialog, cur_y, cur_x); /* Restore cursor position */ - wrefresh(dialog); + attr_clear(box, boxh, boxw, dlg.dialog.atr); + refresh_text_box(dialog, box, boxh, boxw, cur_y, cur_x); - while ((key != ESC) && (key != '\n')) { + while ((key != KEY_ESC) && (key != '\n')) { key = wgetch(dialog); switch (key) { case 'E': /* Exit */ case 'e': case 'X': case 'x': + delwin(box); delwin(dialog); - free(buf); - close(fd); return 0; case 'g': /* First page */ case KEY_HOME: if (!begin_reached) { begin_reached = 1; - /* First page not in buffer? */ - if ((fpos = lseek(fd, 0, SEEK_CUR)) == -1) { - endwin(); - fprintf(stderr, "\nError moving file pointer in dialog_textbox().\n"); - exit(-1); - } - if (fpos > bytes_read) { /* Yes, we have to read it in */ - if (lseek(fd, 0, SEEK_SET) == -1) { - endwin(); - fprintf(stderr, "\nError moving file pointer in " - "dialog_textbox().\n"); - exit(-1); - } - if ((bytes_read = - read(fd, buf, BUF_SIZE)) == -1) { - endwin(); - fprintf(stderr, "\nError reading file in dialog_textbox().\n"); - exit(-1); - } - buf[bytes_read] = '\0'; - } page = buf; - print_page(text, height - 4, width - 2); - print_position(dialog, height, width); - wmove(dialog, cur_y, cur_x); /* Restore cursor position */ - wrefresh(dialog); + refresh_text_box(dialog, box, boxh, boxw, + cur_y, cur_x); } break; case 'G': /* Last page */ case KEY_END: end_reached = 1; - /* Last page not in buffer? */ - if ((fpos = lseek(fd, 0, SEEK_CUR)) == -1) { - endwin(); - fprintf(stderr, "\nError moving file pointer in dialog_textbox().\n"); - exit(-1); - } - if (fpos < file_size) { /* Yes, we have to read it in */ - if (lseek(fd, -BUF_SIZE, SEEK_END) == -1) { - endwin(); - fprintf(stderr, "\nError moving file pointer in dialog_textbox().\n"); - exit(-1); - } - if ((bytes_read = - read(fd, buf, BUF_SIZE)) == -1) { - endwin(); - fprintf(stderr, "\nError reading file in dialog_textbox().\n"); - exit(-1); - } - buf[bytes_read] = '\0'; - } - page = buf + bytes_read; - back_lines(height - 4); - print_page(text, height - 4, width - 2); - print_position(dialog, height, width); - wmove(dialog, cur_y, cur_x); /* Restore cursor position */ - wrefresh(dialog); + /* point to last char in buf */ + page = buf + strlen(buf); + back_lines(boxh); + refresh_text_box(dialog, box, boxh, boxw, + cur_y, cur_x); break; case 'K': /* Previous line */ case 'k': @@ -196,21 +157,23 @@ if (!begin_reached) { back_lines(page_length + 1); - /* We don't call print_page() here but use scrolling to ensure - faster screen update. However, 'end_reached' and - 'page_length' should still be updated, and 'page' should - point to start of next page. This is done by calling - get_line() in the following 'for' loop. */ - scrollok(text, TRUE); - wscrl(text, -1); /* Scroll text region down one line */ - scrollok(text, FALSE); + /* We don't call print_page() here but use + * scrolling to ensure faster screen update. + * However, 'end_reached' and 'page_length' + * should still be updated, and 'page' should + * point to start of next page. This is done + * by calling get_line() in the following + * 'for' loop. */ + scrollok(box, TRUE); + wscrl(box, -1); /* Scroll box region down one line */ + scrollok(box, FALSE); page_length = 0; passed_end = 0; - for (i = 0; i < height - 4; i++) { + for (i = 0; i < boxh; i++) { if (!i) { /* print first line of page */ - print_line(text, 0, width - 2); - wnoutrefresh(text); + print_line(box, 0, boxw); + wnoutrefresh(box); } else /* Called to update 'end_reached' and 'page' */ get_line(); @@ -220,7 +183,7 @@ passed_end = 1; } - print_position(dialog, height, width); + print_position(dialog); wmove(dialog, cur_y, cur_x); /* Restore cursor position */ wrefresh(dialog); } @@ -230,23 +193,21 @@ case KEY_PPAGE: if (begin_reached) break; - back_lines(page_length + height - 4); - print_page(text, height - 4, width - 2); - print_position(dialog, height, width); - wmove(dialog, cur_y, cur_x); - wrefresh(dialog); + back_lines(page_length + boxh); + refresh_text_box(dialog, box, boxh, boxw, + cur_y, cur_x); break; case 'J': /* Next line */ case 'j': case KEY_DOWN: if (!end_reached) { begin_reached = 0; - scrollok(text, TRUE); - scroll(text); /* Scroll text region up one line */ - scrollok(text, FALSE); - print_line(text, height - 5, width - 2); - wnoutrefresh(text); - print_position(dialog, height, width); + scrollok(box, TRUE); + scroll(box); /* Scroll box region up one line */ + scrollok(box, FALSE); + print_line(box, boxh - 1, boxw); + wnoutrefresh(box); + print_position(dialog); wmove(dialog, cur_y, cur_x); /* Restore cursor position */ wrefresh(dialog); } @@ -257,10 +218,8 @@ break; begin_reached = 0; - print_page(text, height - 4, width - 2); - print_position(dialog, height, width); - wmove(dialog, cur_y, cur_x); - wrefresh(dialog); + refresh_text_box(dialog, box, boxh, boxw, + cur_y, cur_x); break; case '0': /* Beginning of line */ case 'H': /* Scroll left */ @@ -275,9 +234,8 @@ hscroll--; /* Reprint current page to scroll horizontally */ back_lines(page_length); - print_page(text, height - 4, width - 2); - wmove(dialog, cur_y, cur_x); - wrefresh(dialog); + refresh_text_box(dialog, box, boxh, boxw, + cur_y, cur_x); break; case 'L': /* Scroll right */ case 'l': @@ -287,131 +245,56 @@ hscroll++; /* Reprint current page to scroll horizontally */ back_lines(page_length); - print_page(text, height - 4, width - 2); - wmove(dialog, cur_y, cur_x); - wrefresh(dialog); + refresh_text_box(dialog, box, boxh, boxw, + cur_y, cur_x); break; - case ESC: + case KEY_ESC: + key = on_key_esc(dialog); break; + case KEY_RESIZE: + back_lines(height); + delwin(box); + delwin(dialog); + on_key_resize(); + goto do_resize; } } - + delwin(box); delwin(dialog); - free(buf); - close(fd); - return -1; /* ESC pressed */ + return key; /* ESC pressed */ } /* - * Go back 'n' lines in text file. Called by dialog_textbox(). + * Go back 'n' lines in text. Called by dialog_textbox(). * 'page' will be updated to point to the desired line in 'buf'. */ static void back_lines(int n) { - int i, fpos; + int i; begin_reached = 0; - /* We have to distinguish between end_reached and !end_reached - since at end of file, the line is not ended by a '\n'. - The code inside 'if' basically does a '--page' to move one - character backward so as to skip '\n' of the previous line */ - if (!end_reached) { - /* Either beginning of buffer or beginning of file reached? */ - if (page == buf) { - if ((fpos = lseek(fd, 0, SEEK_CUR)) == -1) { - endwin(); - fprintf(stderr, "\nError moving file pointer in " - "back_lines().\n"); - exit(-1); + /* Go back 'n' lines */ + for (i = 0; i < n; i++) { + if (*page == '\0') { + if (end_reached) { + end_reached = 0; + continue; } - if (fpos > bytes_read) { /* Not beginning of file yet */ - /* We've reached beginning of buffer, but not beginning of - file yet, so read previous part of file into buffer. - Note that we only move backward for BUF_SIZE/2 bytes, - but not BUF_SIZE bytes to avoid re-reading again in - print_page() later */ - /* Really possible to move backward BUF_SIZE/2 bytes? */ - if (fpos < BUF_SIZE / 2 + bytes_read) { - /* No, move less then */ - if (lseek(fd, 0, SEEK_SET) == -1) { - endwin(); - fprintf(stderr, "\nError moving file pointer in " - "back_lines().\n"); - exit(-1); - } - page = buf + fpos - bytes_read; - } else { /* Move backward BUF_SIZE/2 bytes */ - if (lseek (fd, -(BUF_SIZE / 2 + bytes_read), SEEK_CUR) == -1) { - endwin(); - fprintf(stderr, "\nError moving file pointer " - "in back_lines().\n"); - exit(-1); - } - page = buf + BUF_SIZE / 2; - } - if ((bytes_read = - read(fd, buf, BUF_SIZE)) == -1) { - endwin(); - fprintf(stderr, "\nError reading file in back_lines().\n"); - exit(-1); - } - buf[bytes_read] = '\0'; - } else { /* Beginning of file reached */ - begin_reached = 1; - return; - } } - if (*(--page) != '\n') { /* '--page' here */ - /* Something's wrong... */ - endwin(); - fprintf(stderr, "\nInternal error in back_lines().\n"); - exit(-1); + if (page == buf) { + begin_reached = 1; + return; } - } - /* Go back 'n' lines */ - for (i = 0; i < n; i++) + page--; do { if (page == buf) { - if ((fpos = lseek(fd, 0, SEEK_CUR)) == -1) { - endwin(); - fprintf(stderr, "\nError moving file pointer in back_lines().\n"); - exit(-1); - } - if (fpos > bytes_read) { - /* Really possible to move backward BUF_SIZE/2 bytes? */ - if (fpos < BUF_SIZE / 2 + bytes_read) { - /* No, move less then */ - if (lseek(fd, 0, SEEK_SET) == -1) { - endwin(); - fprintf(stderr, "\nError moving file pointer " - "in back_lines().\n"); - exit(-1); - } - page = buf + fpos - bytes_read; - } else { /* Move backward BUF_SIZE/2 bytes */ - if (lseek (fd, -(BUF_SIZE / 2 + bytes_read), SEEK_CUR) == -1) { - endwin(); - fprintf(stderr, "\nError moving file pointer" - " in back_lines().\n"); - exit(-1); - } - page = buf + BUF_SIZE / 2; - } - if ((bytes_read = - read(fd, buf, BUF_SIZE)) == -1) { - endwin(); - fprintf(stderr, "\nError reading file in " - "back_lines().\n"); - exit(-1); - } - buf[bytes_read] = '\0'; - } else { /* Beginning of file reached */ - begin_reached = 1; - return; - } + begin_reached = 1; + return; } - } while (*(--page) != '\n'); - page++; + page--; + } while (*page != '\n'); + page++; + } } /* @@ -466,33 +349,14 @@ */ static char *get_line(void) { - int i = 0, fpos; + int i = 0; static char line[MAX_LEN + 1]; end_reached = 0; while (*page != '\n') { if (*page == '\0') { - /* Either end of file or end of buffer reached */ - if ((fpos = lseek(fd, 0, SEEK_CUR)) == -1) { - endwin(); - fprintf(stderr, "\nError moving file pointer in " - "get_line().\n"); - exit(-1); - } - if (fpos < file_size) { /* Not end of file yet */ - /* We've reached end of buffer, but not end of file yet, - so read next part of file into buffer */ - if ((bytes_read = - read(fd, buf, BUF_SIZE)) == -1) { - endwin(); - fprintf(stderr, "\nError reading file in get_line().\n"); - exit(-1); - } - buf[bytes_read] = '\0'; - page = buf; - } else { - if (!end_reached) - end_reached = 1; + if (!end_reached) { + end_reached = 1; break; } } else if (i < MAX_LEN) @@ -515,19 +379,13 @@ /* * Print current position */ -static void print_position(WINDOW * win, int height, int width) +static void print_position(WINDOW * win) { - int fpos, percent; + int percent; - if ((fpos = lseek(fd, 0, SEEK_CUR)) == -1) { - endwin(); - fprintf(stderr, "\nError moving file pointer in print_position().\n"); - exit(-1); - } - wattrset(win, position_indicator_attr); - wbkgdset(win, position_indicator_attr & A_COLOR); - percent = !file_size ? - 100 : ((fpos - bytes_read + page - buf) * 100) / file_size; - wmove(win, height - 3, width - 9); + wattrset(win, dlg.position_indicator.atr); + wbkgdset(win, dlg.position_indicator.atr & A_COLOR); + percent = (page - buf) * 100 / strlen(buf); + wmove(win, getmaxy(win) - 3, getmaxx(win) - 9); wprintw(win, "(%3d%%)", percent); } Modified: buildrom-devel/scripts/kconfig/lxdialog/util.c =================================================================== --- buildrom-devel/scripts/kconfig/lxdialog/util.c 2008-07-01 21:13:46 UTC (rev 209) +++ buildrom-devel/scripts/kconfig/lxdialog/util.c 2008-07-02 19:45:34 UTC (rev 210) @@ -21,86 +21,216 @@ #include "dialog.h" -/* use colors by default? */ -bool use_colors = 1; +struct dialog_info dlg; -const char *backtitle = NULL; +static void set_mono_theme(void) +{ + dlg.screen.atr = A_NORMAL; + dlg.shadow.atr = A_NORMAL; + dlg.dialog.atr = A_NORMAL; + dlg.title.atr = A_BOLD; + dlg.border.atr = A_NORMAL; + dlg.button_active.atr = A_REVERSE; + dlg.button_inactive.atr = A_DIM; + dlg.button_key_active.atr = A_REVERSE; + dlg.button_key_inactive.atr = A_BOLD; + dlg.button_label_active.atr = A_REVERSE; + dlg.button_label_inactive.atr = A_NORMAL; + dlg.inputbox.atr = A_NORMAL; + dlg.inputbox_border.atr = A_NORMAL; + dlg.searchbox.atr = A_NORMAL; + dlg.searchbox_title.atr = A_BOLD; + dlg.searchbox_border.atr = A_NORMAL; + dlg.position_indicator.atr = A_BOLD; + dlg.menubox.atr = A_NORMAL; + dlg.menubox_border.atr = A_NORMAL; + dlg.item.atr = A_NORMAL; + dlg.item_selected.atr = A_REVERSE; + dlg.tag.atr = A_BOLD; + dlg.tag_selected.atr = A_REVERSE; + dlg.tag_key.atr = A_BOLD; + dlg.tag_key_selected.atr = A_REVERSE; + dlg.check.atr = A_BOLD; + dlg.check_selected.atr = A_REVERSE; + dlg.uarrow.atr = A_BOLD; + dlg.darrow.atr = A_BOLD; +} +#define DLG_COLOR(dialog, f, b, h) \ +do { \ + dlg.dialog.fg = (f); \ + dlg.dialog.bg = (b); \ + dlg.dialog.hl = (h); \ +} while (0) + +static void set_classic_theme(void) +{ + DLG_COLOR(screen, COLOR_CYAN, COLOR_BLUE, true); + DLG_COLOR(shadow, COLOR_BLACK, COLOR_BLACK, true); + DLG_COLOR(dialog, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(title, COLOR_YELLOW, COLOR_WHITE, true); + DLG_COLOR(border, COLOR_WHITE, COLOR_WHITE, true); + DLG_COLOR(button_active, COLOR_WHITE, COLOR_BLUE, true); + DLG_COLOR(button_inactive, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(button_key_active, COLOR_WHITE, COLOR_BLUE, true); + DLG_COLOR(button_key_inactive, COLOR_RED, COLOR_WHITE, false); + DLG_COLOR(button_label_active, COLOR_YELLOW, COLOR_BLUE, true); + DLG_COLOR(button_label_inactive, COLOR_BLACK, COLOR_WHITE, true); + DLG_COLOR(inputbox, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(inputbox_border, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(searchbox, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(searchbox_title, COLOR_YELLOW, COLOR_WHITE, true); + DLG_COLOR(searchbox_border, COLOR_WHITE, COLOR_WHITE, true); + DLG_COLOR(position_indicator, COLOR_YELLOW, COLOR_WHITE, true); + DLG_COLOR(menubox, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(menubox_border, COLOR_WHITE, COLOR_WHITE, true); + DLG_COLOR(item, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(item_selected, COLOR_WHITE, COLOR_BLUE, true); + DLG_COLOR(tag, COLOR_YELLOW, COLOR_WHITE, true); + DLG_COLOR(tag_selected, COLOR_YELLOW, COLOR_BLUE, true); + DLG_COLOR(tag_key, COLOR_YELLOW, COLOR_WHITE, true); + DLG_COLOR(tag_key_selected, COLOR_YELLOW, COLOR_BLUE, true); + DLG_COLOR(check, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(check_selected, COLOR_WHITE, COLOR_BLUE, true); + DLG_COLOR(uarrow, COLOR_GREEN, COLOR_WHITE, true); + DLG_COLOR(darrow, COLOR_GREEN, COLOR_WHITE, true); +} + +static void set_blackbg_theme(void) +{ + DLG_COLOR(screen, COLOR_RED, COLOR_BLACK, true); + DLG_COLOR(shadow, COLOR_BLACK, COLOR_BLACK, false); + DLG_COLOR(dialog, COLOR_WHITE, COLOR_BLACK, false); + DLG_COLOR(title, COLOR_RED, COLOR_BLACK, false); + DLG_COLOR(border, COLOR_BLACK, COLOR_BLACK, true); + + DLG_COLOR(button_active, COLOR_YELLOW, COLOR_RED, false); + DLG_COLOR(button_inactive, COLOR_YELLOW, COLOR_BLACK, false); + DLG_COLOR(button_key_active, COLOR_YELLOW, COLOR_RED, true); + DLG_COLOR(button_key_inactive, COLOR_RED, COLOR_BLACK, false); + DLG_COLOR(button_label_active, COLOR_WHITE, COLOR_RED, false); + DLG_COLOR(button_label_inactive, COLOR_BLACK, COLOR_BLACK, true); + + DLG_COLOR(inputbox, COLOR_YELLOW, COLOR_BLACK, false); + DLG_COLOR(inputbox_border, COLOR_YELLOW, COLOR_BLACK, false); + + DLG_COLOR(searchbox, COLOR_YELLOW, COLOR_BLACK, false); + DLG_COLOR(searchbox_title, COLOR_YELLOW, COLOR_BLACK, true); + DLG_COLOR(searchbox_border, COLOR_BLACK, COLOR_BLACK, true); + + DLG_COLOR(position_indicator, COLOR_RED, COLOR_BLACK, false); + + DLG_COLOR(menubox, COLOR_YELLOW, COLOR_BLACK, false); + DLG_COLOR(menubox_border, COLOR_BLACK, COLOR_BLACK, true); + + DLG_COLOR(item, COLOR_WHITE, COLOR_BLACK, false); + DLG_COLOR(item_selected, COLOR_WHITE, COLOR_RED, false); + + DLG_COLOR(tag, COLOR_RED, COLOR_BLACK, false); + DLG_COLOR(tag_selected, COLOR_YELLOW, COLOR_RED, true); + DLG_COLOR(tag_key, COLOR_RED, COLOR_BLACK, false); + DLG_COLOR(tag_key_selected, COLOR_YELLOW, COLOR_RED, true); + + DLG_COLOR(check, COLOR_YELLOW, COLOR_BLACK, false); + DLG_COLOR(check_selected, COLOR_YELLOW, COLOR_RED, true); + + DLG_COLOR(uarrow, COLOR_RED, COLOR_BLACK, false); + DLG_COLOR(darrow, COLOR_RED, COLOR_BLACK, false); +} + +static void set_bluetitle_theme(void) +{ + set_classic_theme(); + DLG_COLOR(title, COLOR_BLUE, COLOR_WHITE, true); + DLG_COLOR(button_key_active, COLOR_YELLOW, COLOR_BLUE, true); + DLG_COLOR(button_label_active, COLOR_WHITE, COLOR_BLUE, true); + DLG_COLOR(searchbox_title, COLOR_BLUE, COLOR_WHITE, true); + DLG_COLOR(position_indicator, COLOR_BLUE, COLOR_WHITE, true); + DLG_COLOR(tag, COLOR_BLUE, COLOR_WHITE, true); + DLG_COLOR(tag_key, COLOR_BLUE, COLOR_WHITE, true); + +} + /* - * Attribute values, default is for mono display + * Select color theme */ -chtype attributes[] = { - A_NORMAL, /* screen_attr */ - A_NORMAL, /* shadow_attr */ - A_NORMAL, /* dialog_attr */ - A_BOLD, /* title_attr */ - A_NORMAL, /* border_attr */ - A_REVERSE, /* button_active_attr */ - A_DIM, /* button_inactive_attr */ - A_REVERSE, /* button_key_active_attr */ - A_BOLD, /* button_key_inactive_attr */ - A_REVERSE, /* button_label_active_attr */ - A_NORMAL, /* button_label_inactive_attr */ - A_NORMAL, /* inputbox_attr */ - A_NORMAL, /* inputbox_border_attr */ - A_NORMAL, /* searchbox_attr */ - A_BOLD, /* searchbox_title_attr */ - A_NORMAL, /* searchbox_border_attr */ - A_BOLD, /* position_indicator_attr */ - A_NORMAL, /* menubox_attr */ - A_NORMAL, /* menubox_border_attr */ - A_NORMAL, /* item_attr */ - A_REVERSE, /* item_selected_attr */ - A_BOLD, /* tag_attr */ - A_REVERSE, /* tag_selected_attr */ - A_BOLD, /* tag_key_attr */ - A_REVERSE, /* tag_key_selected_attr */ - A_BOLD, /* check_attr */ - A_REVERSE, /* check_selected_attr */ - A_BOLD, /* uarrow_attr */ - A_BOLD /* darrow_attr */ -}; +static int set_theme(const char *theme) +{ + int use_color = 1; + if (!theme) + set_bluetitle_theme(); + else if (strcmp(theme, "classic") == 0) + set_classic_theme(); + else if (strcmp(theme, "bluetitle") == 0) + set_bluetitle_theme(); + else if (strcmp(theme, "blackbg") == 0) + set_blackbg_theme(); + else if (strcmp(theme, "mono") == 0) + use_color = 0; -#include "colors.h" + return use_color; +} +static void init_one_color(struct dialog_color *color) +{ + static int pair = 0; + + pair++; + init_pair(pair, color->fg, color->bg); + if (color->hl) + color->atr = A_BOLD | COLOR_PAIR(pair); + else + color->atr = COLOR_PAIR(pair); +} + +static void init_dialog_colors(void) +{ + init_one_color(&dlg.screen); + init_one_color(&dlg.shadow); + init_one_color(&dlg.dialog); + init_one_color(&dlg.title); + init_one_color(&dlg.border); + init_one_color(&dlg.button_active); + init_one_color(&dlg.button_inactive); + init_one_color(&dlg.button_key_active); + init_one_color(&dlg.button_key_inactive); + init_one_color(&dlg.button_label_active); + init_one_color(&dlg.button_label_inactive); + init_one_color(&dlg.inputbox); + init_one_color(&dlg.inputbox_border); + init_one_color(&dlg.searchbox); + init_one_color(&dlg.searchbox_title); + init_one_color(&dlg.searchbox_border); + init_one_color(&dlg.position_indicator); + init_one_color(&dlg.menubox); + init_one_color(&dlg.menubox_border); + init_one_color(&dlg.item); + init_one_color(&dlg.item_selected); + init_one_color(&dlg.tag); + init_one_color(&dlg.tag_selected); + init_one_color(&dlg.tag_key); + init_one_color(&dlg.tag_key_selected); + init_one_color(&dlg.check); + init_one_color(&dlg.check_selected); + init_one_color(&dlg.uarrow); + init_one_color(&dlg.darrow); +} + /* - * Table of color values + * Setup for color display */ -int color_table[][3] = { - {SCREEN_FG, SCREEN_BG, SCREEN_HL}, - {SHADOW_FG, SHADOW_BG, SHADOW_HL}, - {DIALOG_FG, DIALOG_BG, DIALOG_HL}, - {TITLE_FG, TITLE_BG, TITLE_HL}, - {BORDER_FG, BORDER_BG, BORDER_HL}, - {BUTTON_ACTIVE_FG, BUTTON_ACTIVE_BG, BUTTON_ACTIVE_HL}, - {BUTTON_INACTIVE_FG, BUTTON_INACTIVE_BG, BUTTON_INACTIVE_HL}, - {BUTTON_KEY_ACTIVE_FG, BUTTON_KEY_ACTIVE_BG, BUTTON_KEY_ACTIVE_HL}, - {BUTTON_KEY_INACTIVE_FG, BUTTON_KEY_INACTIVE_BG, - BUTTON_KEY_INACTIVE_HL}, - {BUTTON_LABEL_ACTIVE_FG, BUTTON_LABEL_ACTIVE_BG, - BUTTON_LABEL_ACTIVE_HL}, - {BUTTON_LABEL_INACTIVE_FG, BUTTON_LABEL_INACTIVE_BG, - BUTTON_LABEL_INACTIVE_HL}, - {INPUTBOX_FG, INPUTBOX_BG, INPUTBOX_HL}, - {INPUTBOX_BORDER_FG, INPUTBOX_BORDER_BG, INPUTBOX_BORDER_HL}, - {SEARCHBOX_FG, SEARCHBOX_BG, SEARCHBOX_HL}, - {SEARCHBOX_TITLE_FG, SEARCHBOX_TITLE_BG, SEARCHBOX_TITLE_HL}, - {SEARCHBOX_BORDER_FG, SEARCHBOX_BORDER_BG, SEARCHBOX_BORDER_HL}, - {POSITION_INDICATOR_FG, POSITION_INDICATOR_BG, POSITION_INDICATOR_HL}, - {MENUBOX_FG, MENUBOX_BG, MENUBOX_HL}, - {MENUBOX_BORDER_FG, MENUBOX_BORDER_BG, MENUBOX_BORDER_HL}, - {ITEM_FG, ITEM_BG, ITEM_HL}, - {ITEM_SELECTED_FG, ITEM_SELECTED_BG, ITEM_SELECTED_HL}, - {TAG_FG, TAG_BG, TAG_HL}, - {TAG_SELECTED_FG, TAG_SELECTED_BG, TAG_SELECTED_HL}, - {TAG_KEY_FG, TAG_KEY_BG, TAG_KEY_HL}, - {TAG_KEY_SELECTED_FG, TAG_KEY_SELECTED_BG, TAG_KEY_SELECTED_HL}, - {CHECK_FG, CHECK_BG, CHECK_HL}, - {CHECK_SELECTED_FG, CHECK_SELECTED_BG, CHECK_SELECTED_HL}, - {UARROW_FG, UARROW_BG, UARROW_HL}, - {DARROW_FG, DARROW_BG, DARROW_HL}, -}; /* color_table */ +static void color_setup(const char *theme) +{ + int use_color; + use_color = set_theme(theme); + if (use_color && has_colors()) { + start_color(); + init_dialog_colors(); + } else + set_mono_theme(); +} + /* * Set window to attribute 'attr' */ @@ -119,13 +249,13 @@ void dialog_clear(void) { - attr_clear(stdscr, LINES, COLS, screen_attr); + attr_clear(stdscr, LINES, COLS, dlg.screen.atr); /* Display background title if it exists ... - SLH */ - if (backtitle != NULL) { + if (dlg.backtitle != NULL) { int i; - wattrset(stdscr, screen_attr); - mvwaddstr(stdscr, 0, 1, (char *)backtitle); + wattrset(stdscr, dlg.screen.atr); + mvwaddstr(stdscr, 0, 1, (char *)dlg.backtitle); wmove(stdscr, 1, 1); for (i = 1; i < COLS - 1; i++) waddch(stdscr, ACS_HLINE); @@ -136,44 +266,41 @@ /* * Do some initialization for dialog */ -void init_dialog(void) +int init_dialog(const char *backtitle) { + int height, width; + initscr(); /* Init curses */ + getmaxyx(stdscr, height, width); + if (height < 19 || width < 80) { + endwin(); + return -ERRDISPLAYTOOSMALL; + } + + dlg.backtitle = backtitle; + color_setup(getenv("MENUCONFIG_COLOR")); + keypad(stdscr, TRUE); cbreak(); noecho(); + dialog_clear(); - if (use_colors) /* Set up colors */ - color_setup(); - - dialog_clear(); + return 0; } -/* - * Setup for color display - */ -void color_setup(void) +void set_dialog_backtitle(const char *backtitle) { - int i; - - if (has_colors()) { /* Terminal supports color? */ - start_color(); - - /* Initialize color pairs */ - for (i = 0; i < ATTRIBUTE_COUNT; i++) - init_pair(i + 1, color_table[i][0], color_table[i][1]); - - /* Setup color attributes */ - for (i = 0; i < ATTRIBUTE_COUNT; i++) - attributes[i] = C_ATTR(color_table[i][2], i + 1); - } + dlg.backtitle = backtitle; } /* * End using dialog functions. */ -void end_dialog(void) +void end_dialog(int x, int y) { + /* move cursor back to original position */ + move(y, x); + refresh(); endwin(); } @@ -184,7 +311,7 @@ { if (title) { int tlen = MIN(width - 2, strlen(title)); - wattrset(dialog, title_attr); + wattrset(dialog, dlg.title.atr); mvwaddch(dialog, 0, (width - tlen) / 2 - 1, ' '); mvwaddnstr(dialog, 0, (width - tlen)/2, title, tlen); waddch(dialog, ' '); @@ -224,7 +351,7 @@ newl = 1; word = tempstr; while (word && *word) { - sp = index(word, ' '); + sp = strchr(word, ' '); if (sp) *sp++ = 0; @@ -236,7 +363,7 @@ if (wlen > room || (newl && wlen < 4 && sp && wlen + 1 + strlen(sp) > room - && (!(sp2 = index(sp, ' ')) + && (!(sp2 = strchr(sp, ' ')) || wlen + 1 + (sp2 - sp) > room))) { cur_y++; cur_x = x; @@ -264,21 +391,23 @@ int i, temp; wmove(win, y, x); - wattrset(win, selected ? button_active_attr : button_inactive_attr); + wattrset(win, selected ? dlg.button_active.atr + : dlg.button_inactive.atr); waddstr(win, "<"); temp = strspn(label, " "); label += temp; - wattrset(win, selected ? button_label_active_attr - : button_label_inactive_attr); + wattrset(win, selected ? dlg.button_label_active.atr + : dlg.button_label_inactive.atr); for (i = 0; i < temp; i++) waddch(win, ' '); - wattrset(win, selected ? button_key_active_attr - : button_key_inactive_attr); + wattrset(win, selected ? dlg.button_key_active.atr + : dlg.button_key_inactive.atr); waddch(win, label[0]); - wattrset(win, selected ? button_label_active_attr - : button_label_inactive_attr); + wattrset(win, selected ? dlg.button_label_active.atr + : dlg.button_label_inactive.atr); waddstr(win, (char *)label + 1); - wattrset(win, selected ? button_active_attr : button_inactive_attr); + wattrset(win, selected ? dlg.button_active.atr + : dlg.button_inactive.atr); waddstr(win, ">"); wmove(win, y, x + temp + 1); } @@ -326,7 +455,7 @@ int i; if (has_colors()) { /* Whether terminal supports color? */ - wattrset(win, shadow_attr); + wattrset(win, dlg.shadow.atr); wmove(win, y + height, x + 2); for (i = 0; i < width; i++) waddch(win, winch(win) & A_CHARTEXT); @@ -360,3 +489,167 @@ return 0; } + +/* + * ncurses uses ESC to detect escaped char sequences. This resutl in + * a small timeout before ESC is actually delivered to the application. + * lxdialog suggest <ESC> <ESC> which is correctly translated to two + * times esc. But then we need to ignore the second esc to avoid stepping + * out one menu too much. Filter away all escaped key sequences since + * keypad(FALSE) turn off ncurses support for escape sequences - and thats + * needed to make notimeout() do as expected. + */ +int on_key_esc(WINDOW *win) +{ + int key; + int key2; + int key3; + + nodelay(win, TRUE); + keypad(win, FALSE); + key = wgetch(win); + key2 = wgetch(win); + do { + key3 = wgetch(win); + } while (key3 != ERR); + nodelay(win, FALSE); + keypad(win, TRUE); + if (key == KEY_ESC && key2 == ERR) + return KEY_ESC; + else if (key != ERR && key != KEY_ESC && key2 == ERR) + ungetch(key); + + return -1; +} + +/* redraw screen in new size */ +int on_key_resize(void) +{ + dialog_clear(); + return KEY_RESIZE; +} + +struct dialog_list *item_cur; +struct dialog_list item_nil; +struct dialog_list *item_head; + +void item_reset(void) +{ + struct dialog_list *p, *next; + + for (p = item_head; p; p = next) { + next = p->next; + free(p); + } + item_head = NULL; + item_cur = &item_nil; +} + +void item_make(const char *fmt, ...) +{ + va_list ap; + struct dialog_list *p = malloc(sizeof(*p)); + + if (item_head) + item_cur->next = p; + else + item_head = p; + item_cur = p; + memset(p, 0, sizeof(*p)); + + va_start(ap, fmt); + vsnprintf(item_cur->node.str, sizeof(item_cur->node.str), fmt, ap); + va_end(ap); +} + +void item_add_str(const char *fmt, ...) +{ + va_list ap; + size_t avail; + + avail = sizeof(item_cur->node.str) - strlen(item_cur->node.str); + + va_start(ap, fmt); + vsnprintf(item_cur->node.str + strlen(item_cur->node.str), + avail, fmt, ap); + item_cur->node.str[sizeof(item_cur->node.str) - 1] = '\0'; + va_end(ap); +} + +void item_set_tag(char tag) +{ + item_cur->node.tag = tag; +} +void item_set_data(void *ptr) +{ + item_cur->node.data = ptr; +} + +void item_set_selected(int val) +{ + item_cur->node.selected = val; +} + +int item_activate_selected(void) +{ + item_foreach() + if (item_is_selected()) + return 1; + return 0; +} + +void *item_data(void) +{ + return item_cur->node.data; +} + +char item_tag(void) +{ + return item_cur->node.tag; +} + +int item_count(void) +{ + int n = 0; + struct dialog_list *p; + + for (p = item_head; p; p = p->next) + n++; + return n; +} + +void item_set(int n) +{ + int i = 0; + item_foreach() + if (i++ == n) + return; +} + +int item_n(void) +{ + int n = 0; + struct dialog_list *p; + + for (p = item_head; p; p = p->next) { + if (p == item_cur) + return n; + n++; + } + return 0; +} + +const char *item_str(void) +{ + return item_cur->node.str; +} + +int item_is_selected(void) +{ + return (item_cur->node.selected != 0); +} + +int item_is_tag(char tag) +{ + return (item_cur->node.tag == tag); +} Modified: buildrom-devel/scripts/kconfig/lxdialog/yesno.c =================================================================== --- buildrom-devel/scripts/kconfig/lxdialog/yesno.c 2008-07-01 21:13:46 UTC (rev 209) +++ buildrom-devel/scripts/kconfig/lxdialog/yesno.c 2008-07-02 19:45:34 UTC (rev 210) @@ -29,8 +29,8 @@ int x = width / 2 - 10; int y = height - 2; - print_button(dialog, " Yes ", y, x, selected == 0); - print_button(dialog, " No ", y, x + 13, selected == 1); + print_button(dialog, gettext(" Yes "), y, x, selected == 0); + print_button(dialog, gettext(" No "), y, x + 13, selected == 1); wmove(dialog, y, x + 1 + 13 * selected); wrefresh(dialog); @@ -44,6 +44,12 @@ int i, x, y, key = 0, button = 0; WINDOW *dialog; +do_resize: + if (getmaxy(stdscr) < (height + 4)) + return -ERRDISPLAYTOOSMALL; + if (getmaxx(stdscr) < (width + 4)) + return -ERRDISPLAYTOOSMALL; + /* center dialog box on screen */ x = (COLS - width) / 2; y = (LINES - height) / 2; @@ -53,22 +59,23 @@ dialog = newwin(height, width, y, x); keypad(dialog, TRUE); - draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr); - wattrset(dialog, border_attr); + draw_box(dialog, 0, 0, height, width, + dlg.dialog.atr, dlg.border.atr); + wattrset(dialog, dlg.border.atr); mvwaddch(dialog, height - 3, 0, ACS_LTEE); for (i = 0; i < width - 2; i++) waddch(dialog, ACS_HLINE); - wattrset(dialog, dialog_attr); + wattrset(dialog, dlg.dialog.atr); waddch(dialog, ACS_RTEE); print_title(dialog, title, width); - wattrset(dialog, dialog_attr); + wattrset(dialog, dlg.dialog.atr); print_autowrap(dialog, prompt, width - 2, 1, 3); print_buttons(dialog, height, width, 0); - while (key != ESC) { + while (key != KEY_ESC) { key = wgetch(dialog); switch (key) { case 'Y': @@ -92,11 +99,16 @@ case '\n': delwin(dialog); return button; - case ESC: + case KEY_ESC: + key = on_key_esc(dialog); break; + case KEY_RESIZE: + delwin(dialog); + on_key_resize(); + goto do_resize; } } delwin(dialog); - return -1; /* ESC pressed */ + return key; /* ESC pressed */ } Modified: buildrom-devel/scripts/kconfig/mconf.c =================================================================== --- buildrom-devel/scripts/kconfig/mconf.c 2008-07-01 21:13:46 UTC (rev 209) +++ buildrom-devel/scripts/kconfig/mconf.c 2008-07-02 19:45:34 UTC (rev 210) @@ -8,36 +8,36 @@ * i18n, 2005, Arnaldo Carvalho de Melo <acme at conectiva.com.br> */ -#include <sys/ioctl.h> -#include <sys/wait.h> #include <ctype.h> #include <errno.h> #include <fcntl.h> #include <limits.h> -#include <signal.h> #include <stdarg.h> #include <stdlib.h> #include <string.h> -#include <termios.h> #include <unistd.h> #include <locale.h> #define LKC_DIRECT_LINK #include "lkc.h" +#include "lxdialog/dialog.h" -static char menu_backtitle[128]; static const char mconf_readme[] = N_( "Overview\n" "--------\n" "Some features may be built directly into buildrom.\n" -"Some may be made into standalone applets. Some features\n" +"Some may be made into loadable runtime modules. Some features\n" "may be completely removed altogether. There are also certain\n" "parameters which are not really features, but must be\n" "entered in as decimal or hexadecimal numbers or possibly text.\n" "\n" -"Menu items beginning with [*], <M> or [ ] represent features\n" -"configured to be built in, modularized or removed respectively.\n" -"Pointed brackets <> represent module capable features.\n" +"Menu items beginning with following braces represent features that\n" +" [ ] can be built in or removed\n" +" < > can be built in, modularized or removed\n" +" { } can be built in or modularized (selected by other feature)\n" +" - - are selected by other feature,\n" +"while *, M or whitespace inside braces means to build in, build as\n" +"a module or to exclude the feature respectively.\n" "\n" "To change any of these features, highlight it with the cursor\n" "keys and press <Y> to build it in, <M> to make it a module or\n" @@ -115,7 +115,7 @@ "-----------------------------\n" "Menuconfig supports the use of alternate configuration files for\n" "those who, for various reasons, find it necessary to switch\n" -"between different buildrom configurations.\n" +"between different configurations.\n" "\n" "At the end of the main menu you will find two options. One is\n" "for saving the current configuration to a file of your choosing.\n" @@ -148,7 +148,7 @@ "\n" "Optional personality available\n" "------------------------------\n" -"If you prefer to have all of the buildrom options listed in a single\n" +"If you prefer to have all of the options listed in a single\n" "menu, rather than the default multimenu hierarchy, run the menuconfig\n" "with MENUCONFIG_MODE environment variable set to single_menu. Example:\n" "\n" @@ -159,7 +159,21 @@ "\n" "Note that this mode can eventually be a little more CPU expensive\n" "(especially with a larger number of unrolled categories) than the\n" -"default mode.\n"), +"default mode.\n" +"\n" +"Different color themes available\n" +"--------------------------------\n" +"It is possible to select different color themes using the variable\n" +"MENUCONFIG_COLOR. To select a theme use:\n" +"\n" +"make MENUCONFIG_COLOR=<theme> menuconfig\n" +"\n" +"Available themes are\n" +" mono => selects colors suitable for monochrome displays\n" +" blackbg => selects a color scheme with black background\n" +" classic => theme with blue background. The classic look\n" +" bluetitle => a LCD friendly version of classic. (default)\n" +"\n"), menu_instructions[] = N_( "Arrow keys navigate the menu. " "<Enter> selects submenus --->. " @@ -193,11 +207,11 @@ "last retrieved. Leave blank to abort."), load_config_help[] = N_( "\n" - "For various reasons, one may wish to keep several different buildrom\n" + "For various reasons, one may wish to keep several different\n" "configurations available on a single machine.\n" "\n" - "If you have saved a previous configuration in a file other than \n" - "buildrom default, entering the name of the file here will allow you\n" + "If you have saved a previous configuration in a file other than the\n" + "default, entering the name of the file here will allow you\n" "to modify that configuration.\n" "\n" "If you are uncertain, then you have probably never used alternate\n" @@ -207,7 +221,7 @@ "as an alternate. Leave blank to abort."), save_config_help[] = N_( "\n" - "For various reasons, one may wish to keep different buildrom\n" + "For various reasons, one may wish to keep different\n" "configurations available on a single machine.\n" "\n" "Entering a file name here will allow you to later retrieve, modify\n" @@ -256,16 +270,9 @@ " USB$ => find all CONFIG_ symbols ending with USB\n" "\n"); -static char buf[4096], *bufptr = buf; -static char input_buf[4096]; -static char filename[PATH_MAX+1] = ".config"; -static char *args[1024], **argptr = args; static int indent; -static struct termios ios_org; -static int rows = 0, cols = 0; static struct menu *current_menu; static int child_count; -static int do_resize; static int single_menu_mode; static void conf(struct menu *menu); @@ -276,106 +283,17 @@ static void show_textbox(const char *title, const char *text, int r, int c); static void show_helptext(const char *title, const char *text); static void show_help(struct menu *menu); -static void show_file(const char *filename, const char *title, int r, int c); -static void cprint_init(void); -static int cprint1(const char *fmt, ...); -static void cprint_done(void); -static int cprint(const char *fmt, ...); - -static void init_wsize(void) -{ - struct winsize ws; - char *env; - - if (!ioctl(STDIN_FILENO, TIOCGWINSZ, &ws)) { - rows = ws.ws_row; - cols = ws.ws_col; - } - - if (!rows) { - env = getenv("LINES"); - if (env) - rows = atoi(env); - if (!rows) - rows = 24; - } - if (!cols) { - env = getenv("COLUMNS"); - if (env) - cols = atoi(env); - if (!cols) - cols = 80; - } - - if (rows < 19 || cols < 80) { - fprintf(stderr, N_("Your display is too small to run Menuconfig!\n")); - fprintf(stderr, N_("It must be at least 19 lines by 80 columns.\n")); - exit(1); - } - - rows -= 4; - cols -= 5; -} - -static void cprint_init(void) -{ - bufptr = buf; - argptr = args; - memset(args, 0, sizeof(args)); - indent = 0; - child_count = 0; - cprint("./scripts/kconfig/lxdialog/lxdialog"); - cprint("--backtitle"); - cprint(menu_backtitle); -} - -static int cprint1(const char *fmt, ...) -{ - va_list ap; - int res; - - if (!*argptr) - *argptr = bufptr; - va_start(ap, fmt); - res = vsprintf(bufptr, fmt, ap); - va_end(ap); - bufptr += res; - - return res; -} - -static void cprint_done(void) -{ - *bufptr++ = 0; - argptr++; -} - -static int cprint(const char *fmt, ...) -{ - va_list ap; - int res; - - *argptr++ = bufptr; - va_start(ap, fmt); - res = vsprintf(bufptr, fmt, ap); - va_end(ap); - bufptr += res; - *bufptr++ = 0; - - return res; -} - static void get_prompt_str(struct gstr *r, struct property *prop) { int i, j; struct menu *submenu[8], *menu; - str_printf(r, "Prompt: %s\n", prop->text); - str_printf(r, " Defined at %s:%d\n", prop->menu->file->name, + str_printf(r, _("Prompt: %s\n"), _(prop->text)); + str_printf(r, _(" Defined at %s:%d\n"), prop->menu->file->name, prop->menu->lineno); if (!expr_is_yes(prop->visible.expr)) { - str_append(r, " Depends on: "); + str_append(r, _(" Depends on: ")); expr_gstr_print(prop->visible.expr, r); str_append(r, "\n"); } @@ -383,13 +301,13 @@ for (i = 0; menu != &rootmenu && i < 8; menu = menu->parent) submenu[i++] = menu; if (i > 0) { - str_printf(r, " Location:\n"); + str_printf(r, _(" Location:\n")); for (j = 4; --i >= 0; j += 2) { menu = submenu[i]; - str_printf(r, "%*c-> %s", j, ' ', menu_get_prompt(menu)); + str_printf(r, "%*c-> %s", j, ' ', _(menu_get_prompt(menu))); if (menu->sym) { str_printf(r, " (%s [=%s])", menu->sym->name ? - menu->sym->name : "<choice>", + menu->sym->name : _("<choice>"), sym_get_string_value(menu->sym)); } str_append(r, "\n"); @@ -402,8 +320,9 @@ bool hit; struct property *prop; - str_printf(r, "Symbol: %s [=%s]\n", sym->name, - sym_get_string_value(sym)); + if (sym && sym->name) + str_printf(r, "Symbol: %s [=%s]\n", sym->name, + sym_get_string_value(sym)); for_all_prompts(sym, prop) get_prompt_str(r, prop); hit = false; @@ -418,7 +337,7 @@ if (hit) str_append(r, "\n"); if (sym->rev_dep.expr) { - str_append(r, " Selected by: "); + str_append(r, _(" Selected by: ")); expr_gstr_print(sym->rev_dep.expr, r); str_append(r, "\n"); } @@ -434,112 +353,45 @@ for (i = 0; sym_arr && (sym = sym_arr[i]); i++) get_symbol_str(&res, sym); if (!i) - str_append(&res, "No matches found.\n"); + str_append(&res, _("No matches found.\n")); return res; } -pid_t pid; - -static void winch_handler(int sig) +static char filename[PATH_MAX+1]; +static void set_config_filename(const char *config_filename) { - if (!do_resize) { - kill(pid, SIGINT); - do_resize = 1; - } -} + static char menu_backtitle[PATH_MAX+128]; + int size; + struct symbol *sym; -static int exec_conf(void) -{ - int pipefd[2], stat, size; - struct sigaction sa; - sigset_t sset, osset; + sym = sym_lookup("KERNELVERSION", 0); + sym_calc_value(sym); + size = snprintf(menu_backtitle, sizeof(menu_backtitle), + _("%s - buildrom v%s Configuration"), + config_filename, getenv("KERNELVERSION")); + if (size >= sizeof(menu_backtitle)) + menu_backtitle[sizeof(menu_backtitle)-1] = '\0'; + set_dialog_backtitle(menu_backtitle); - sigemptyset(&sset); - sigaddset(&sset, SIGINT); - sigprocmask(SIG_BLOCK, &sset, &osset); - - signal(SIGINT, SIG_DFL); - - sa.sa_handler = winch_handler; - sigemptyset(&sa.sa_mask); - sa.sa_flags = SA_RESTART; - sigaction(SIGWINCH, &sa, NULL); - - *argptr++ = NULL; - - pipe(pipefd); - pid = fork(); - if (pid == 0) { - sigprocmask(SIG_SETMASK, &osset, NULL); - dup2(pipefd[1], 2); - close(pipefd[0]); - close(pipefd[1]); - execv(args[0], args); - _exit(EXIT_FAILURE); - } - - close(pipefd[1]); - bufptr = input_buf; - while (1) { - size = input_buf + sizeof(input_buf) - bufptr; - size = read(pipefd[0], bufptr, size); - if (size <= 0) { - if (size < 0) { - if (errno == EINTR || errno == EAGAIN) - continue; - perror("read"); - } - break; - } - bufptr += size; - } - *bufptr++ = 0; - close(pipefd[0]); - waitpid(pid, &stat, 0); - - if (do_resize) { - init_wsize(); - do_resize = 0; - sigprocmask(SIG_SETMASK, &osset, NULL); - return -1; - } - if (WIFSIGNALED(stat)) { - printf("\finterrupted(%d)\n", WTERMSIG(stat)); - exit(1); - } -#if 0 - printf("\fexit state: %d\nexit data: '%s'\n", WEXITSTATUS(stat), input_buf); - sleep(1); -#endif - sigpending(&sset); - if (sigismember(&sset, SIGINT)) { - printf("\finterrupted\n"); - exit(1); - } - sigprocmask(SIG_SETMASK, &osset, NULL); - - return WEXITSTATUS(stat); + size = snprintf(filename, sizeof(filename), "%s", config_filename); + if (size >= sizeof(filename)) + filename[sizeof(filename)-1] = '\0'; } + static void search_conf(void) { struct symbol **sym_arr; - int stat; struct gstr res; - + char *dialog_input; + int dres; again: - cprint_init(); - cprint("--title"); - cprint(_("Search Configuration Parameter")); - cprint("--inputbox"); - cprint(_("Enter CONFIG_ (sub)string to search for (omit CONFIG_)")); - cprint("10"); - cprint("75"); - cprint(""); - stat = exec_conf(); - if (stat < 0) - goto again; - switch (stat) { + dialog_clear(); + dres = dialog_inputbox(_("Search Configuration Parameter"), + _("Enter CONFIG_ (sub)string to search for " + "(with or without \"CONFIG\")"), + 10, 75, ""); + switch (dres) { case 0: break; case 1: @@ -549,7 +401,12 @@ return; } - sym_arr = sym_re_search(input_buf); + /* strip CONFIG_ if necessary */ + dialog_input = dialog_input_result; + if (strncasecmp(dialog_input_result, "CONFIG_", 7) == 0) + dialog_input += 7; + + sym_arr = sym_re_search(dialog_input); res = get_relations_str(sym_arr); free(sym_arr); show_textbox(_("Search Results"), str_get(&res), 0, 0); @@ -576,24 +433,33 @@ switch (prop->type) { case P_MENU: child_count++; - cprint("m%p", menu); - + prompt = _(prompt); if (single_menu_mode) { - cprint1("%s%*c%s", - menu->data ? "-->" : "++>", - indent + 1, ' ', prompt); + item_make("%s%*c%s", + menu->data ? "-->" : "++>", + indent + 1, ' ', prompt); } else - cprint1(" %*c%s --->", indent + 1, ' ', prompt); + item_make(" %*c%s --->", indent + 1, ' ', prompt); - cprint_done(); + item_set_tag('m'); + item_set_data(menu); if (single_menu_mode && menu->data) goto conf_childs; return; + case P_COMMENT: + if (prompt) { + child_count++; + item_make(" %*c*** %s ***", indent + 1, ' ', _(prompt)); + item_set_tag(':'); + item_set_data(menu); + } + break; default: if (prompt) { child_count++; - cprint(":%p", menu); - cprint("---%*c%s", indent + 1, ' ', prompt); + item_make("---%*c%s", indent + 1, ' ', _(prompt)); + item_set_tag(':'); + item_set_data(menu); } } } else @@ -614,10 +480,9 @@ val = sym_get_tristate_value(sym); if (sym_is_changable(sym)) { - cprint("t%p", menu); switch (type) { case S_BOOLEAN: - cprint1("[%c]", val == no ? ' ' : '*'); + item_make("[%c]", val == no ? ' ' : '*'); break; case S_TRISTATE: switch (val) { @@ -625,84 +490,90 @@ case mod: ch = 'M'; break; default: ch = ' '; break; } - cprint1("<%c>", ch); + item_make("<%c>", ch); break; } + item_set_tag('t'); + item_set_data(menu); } else { - cprint("%c%p", def_menu ? 't' : ':', menu); - cprint1(" "); + item_make(" "); + item_set_tag(def_menu ? 't' : ':'); + item_set_data(menu); } - cprint1("%*c%s", indent + 1, ' ', menu_get_prompt(menu)); + item_add_str("%*c%s", indent + 1, ' ', _(menu_get_prompt(menu))); if (val == yes) { if (def_menu) { - cprint1(" (%s)", menu_get_prompt(def_menu)); - cprint1(" --->"); - cprint_done(); + item_add_str(" (%s)", _(menu_get_prompt(def_menu))); + item_add_str(" --->"); if (def_menu->list) { indent += 2; build_conf(def_menu); indent -= 2; } - } else - cprint_done(); + } return; } - cprint_done(); } else { if (menu == current_menu) { - cprint(":%p", menu); - cprint("---%*c%s", indent + 1, ' ', menu_get_prompt(menu)); + item_make("---%*c%s", indent + 1, ' ', _(menu_get_prompt(menu))); + item_set_tag(':'); + item_set_data(menu); goto conf_childs; } child_count++; val = sym_get_tristate_value(sym); if (sym_is_choice_value(sym) && val == yes) { - cprint(":%p", menu); - cprint1(" "); + item_make(" "); + item_set_tag(':'); + item_set_data(menu); } else { switch (type) { case S_BOOLEAN: - cprint("t%p", menu); if (sym_is_changable(sym)) - cprint1("[%c]", val == no ? ' ' : '*'); + item_make("[%c]", val == no ? ' ' : '*'); else - cprint1("---"); + item_make("-%c-", val == no ? ' ' : '*'); + item_set_tag('t'); + item_set_data(menu); break; case S_TRISTATE: - cprint("t%p", menu); switch (val) { case yes: ch = '*'; break; case mod: ch = 'M'; break; default: ch = ' '; break; } - if (sym_is_changable(sym)) - cprint1("<%c>", ch); - else - cprint1("---"); + if (sym_is_changable(sym)) { + if (sym->rev_dep.tri == mod) + item_make("{%c}", ch); + else + item_make("<%c>", ch); + } else + item_make("-%c-", ch); + item_set_tag('t'); + item_set_data(menu); break; default: - cprint("s%p", menu); - tmp = cprint1("(%s)", sym_get_string_value(sym)); + tmp = 2 + strlen(sym_get_string_value(sym)); /* () = 2 */ + item_make("(%s)", sym_get_string_value(sym)); tmp = indent - tmp + 4; if (tmp < 0) tmp = 0; - cprint1("%*c%s%s", tmp, ' ', menu_get_prompt(menu), - (sym_has_value(sym) || !sym_is_changable(sym)) ? - "" : " (NEW)"); - cprint_done(); + item_add_str("%*c%s%s", tmp, ' ', _(menu_get_prompt(menu)), + (sym_has_value(sym) || !sym_is_changable(sym)) ? + "" : _(" (NEW)")); + item_set_tag('s'); + item_set_data(menu); goto conf_childs; } } - cprint1("%*c%s%s", indent + 1, ' ', menu_get_prompt(menu), - (sym_has_value(sym) || !sym_is_changable(sym)) ? - "" : " (NEW)"); + item_add_str("%*c%s%s", indent + 1, ' ', _(menu_get_prompt(menu)), + (sym_has_value(sym) || !sym_is_changable(sym)) ? + "" : _(" (NEW)")); if (menu->prompt->type == P_MENU) { - cprint1(" --->"); - cprint_done(); + item_add_str(" --->"); return; } - cprint_done(); } conf_childs: @@ -717,59 +588,45 @@ struct menu *submenu; const char *prompt = menu_get_prompt(menu); struct symbol *sym; - char active_entry[40]; - int stat, type, i; + struct menu *active_menu = NULL; + int res; + int s_scroll = 0; - unlink("lxdialog.scrltmp"); - active_entry[0] = 0; while (1) { - cprint_init(); - cprint("--title"); - cprint("%s", prompt ? prompt : _("Main Menu")); - cprint("--menu"); - cprint(_(menu_instructions)); - cprint("%d", rows); - cprint("%d", cols); - cprint("%d", rows - 10); - cprint("%s", active_entry); + item_reset(); current_menu = menu; build_conf(menu); if (!child_count) break; if (menu == &rootmenu) { - cprint(":"); - cprint("--- "); - cprint("L"); - cprint(_(" Load an Alternate Configuration File")); - cprint("S"); - cprint(_(" Save Configuration to an Alternate File")); + item_make("--- "); + item_set_tag(':'); + item_make(_(" Load an Alternate Configuration File")); + item_set_tag('L'); + item_make(_(" Save an Alternate Configuration File")); + item_set_tag('S'); } - stat = exec_conf(); - if (stat < 0) - continue; - - if (stat == 1 || stat == 255) + dialog_clear(); + res = dialog_menu(prompt ? _(prompt) : _("Main Menu"), + _(menu_instructions), + active_menu, &s_scroll); + if (res == 1 || res == KEY_ESC || res == -ERRDISPLAYTOOSMALL) break; - - type = input_buf[0]; - if (!type) + if (!item_activate_selected()) continue; + if (!item_tag()) + continue; - for (i = 0; input_buf[i] && !isspace(input_buf[i]); i++) - ; - if (i >= sizeof(active_entry)) - i = sizeof(active_entry) - 1; - input_buf[i] = 0; - strcpy(active_entry, input_buf); - - sym = NULL; - submenu = NULL; - if (sscanf(input_buf + 1, "%p", &submenu) == 1) + submenu = item_data(); + active_menu = item_data(); + if (submenu) sym = submenu->sym; + else + sym = NULL; - switch (stat) { + switch (res) { case 0: - switch (type) { + switch (item_tag()) { case 'm': if (single_menu_mode) submenu->data = (void *) (long) !submenu->data; @@ -797,10 +654,10 @@ if (sym) show_help(submenu); else - show_helptext("README", _(mconf_readme)); + show_helptext(_("README"), _(mconf_readme)); break; case 3: - if (type == 't') { + if (item_is_tag('t')) { if (sym_set_tristate_value(sym, yes)) break; if (sym_set_tristate_value(sym, mod)) @@ -808,17 +665,17 @@ } break; case 4: - if (type == 't') + if (item_is_tag('t')) sym_set_tristate_value(sym, no); break; case 5: - if (type == 't') + if (item_is_tag('t')) sym_set_tristate_value(sym, mod); break; case 6: - if (type == 't') + if (item_is_tag('t')) sym_toggle_tristate_value(sym); - else if (type == 'm') + else if (item_is_tag('m')) conf(submenu); break; case 7: @@ -830,13 +687,8 @@ static void show_textbox(const char *title, const char *text, int r, int c) { - int fd; - - fd = creat(".help.tmp", 0777); - write(fd, text, strlen(text)); - close(fd); - show_file(".help.tmp", title, r, c); - unlink(".help.tmp"); + dialog_clear(); + dialog_textbox(title, text, r, c); } static void show_helptext(const char *title, const char *text) @@ -849,84 +701,68 @@ struct gstr help = str_new(); struct symbol *sym = menu->sym; - if (sym->help) + if (menu_has_help(menu)) { if (sym->name) { str_printf(&help, "CONFIG_%s:\n\n", sym->name); - str_append(&help, _(sym->help)); + str_append(&help, _(menu_get_help(menu))); str_append(&help, "\n"); } } else { str_append(&help, nohelp_text); } get_symbol_str(&help, sym); - show_helptext(menu_get_prompt(menu), str_get(&help)); + show_helptext(_(menu_get_prompt(menu)), str_get(&help)); str_free(&help); } -static void show_file(const char *filename, const char *title, int r, int c) -{ - do { - cprint_init(); - if (title) { - cprint("--title"); - cprint("%s", title); - } - cprint("--textbox"); - cprint("%s", filename); - cprint("%d", r ? r : rows); - cprint("%d", c ? c : cols); - } while (exec_conf() < 0); -} - static void conf_choice(struct menu *menu) { - const char *prompt = menu_get_prompt(menu); + const char *prompt = _(menu_get_prompt(menu)); struct menu *child; struct symbol *active; - int stat; active = sym_get_choice_value(menu->sym); while (1) { - cprint_init(); - cprint("--title"); - cprint("%s", prompt ? prompt : _("Main Menu")); - cprint("--radiolist"); - cprint(_(radiolist_instructions)); - cprint("15"); - cprint("70"); - cprint("6"); + int res; + int selected; + item_reset(); current_menu = menu; for (child = menu->list; child; child = child->next) { if (!menu_is_visible(child)) continue; - cprint("%p", child); - cprint("%s", menu_get_prompt(child)); + item_make("%s", _(menu_get_prompt(child))); + item_set_data(child); + if (child->sym == active) + item_set_selected(1); if (child->sym == sym_get_choice_value(menu->sym)) - cprint("ON"); - else if (child->sym == active) - cprint("SELECTED"); - else - cprint("OFF"); + item_set_tag('X'); } - - stat = exec_conf(); - switch (stat) { + dialog_clear(); + res = dialog_checklist(prompt ? _(prompt) : _("Main Menu"), + _(radiolist_instructions), + 15, 70, 6); + selected = item_activate_selected(); + switch (res) { case 0: - if (sscanf(input_buf, "%p", &child) != 1) - break; - sym_set_tristate_value(child->sym, yes); + if (selected) { + child = item_data(); + sym_set_tristate_value(child->sym, yes); + } return; case 1: - if (sscanf(input_buf, "%p", &child) == 1) { + if (selected) { + child = item_data(); show_help(child); active = child->sym; } else show_help(menu); break; - case 255: + case KEY_ESC: return; + case -ERRDISPLAYTOOSMALL: + return; } } } @@ -934,40 +770,38 @@ static void conf_string(struct menu *menu) { const char *prompt = menu_get_prompt(menu); - int stat; while (1) { - cprint_init(); - cprint("--title"); - cprint("%s", prompt ? prompt : _("Main Menu")); - cprint("--inputbox"); + int res; + char *heading; + switch (sym_get_type(menu->sym)) { case S_INT: - cprint(_(inputbox_instructions_int)); + heading = _(inputbox_instructions_int); break; case S_HEX: - cprint(_(inputbox_instructions_hex)); + heading = _(inputbox_instructions_hex); break; case S_STRING: - cprint(_(inputbox_instructions_string)); + heading = _(inputbox_instructions_string); break; default: - /* panic? */; + heading = _("Internal mconf error!"); } - cprint("10"); - cprint("75"); - cprint("%s", sym_get_string_value(menu->sym)); - stat = exec_conf(); - switch (stat) { + dialog_clear(); + res = dialog_inputbox(prompt ? _(prompt) : _("Main Menu"), + heading, 10, 75, + sym_get_string_value(menu->sym)); + switch (res) { case 0: - if (sym_set_string_value(menu->sym, input_buf)) + if (sym_set_string_value(menu->sym, dialog_input_result)) return; show_textbox(NULL, _("You have made an invalid entry."), 5, 43); break; case 1: show_help(menu); break; - case 255: + case KEY_ESC: return; } } @@ -975,28 +809,27 @@ static void conf_load(void) { - int stat; while (1) { - cprint_init(); - cprint("--inputbox"); - cprint(load_config_text); - cprint("11"); - cprint("55"); - cprint("%s", filename); - stat = exec_conf(); - switch(stat) { + int res; + dialog_clear(); + res = dialog_inputbox(NULL, load_config_text, + 11, 55, filename); + switch(res) { case 0: - if (!input_buf[0]) + if (!dialog_input_result[0]) return; - if (!conf_read(input_buf)) + if (!conf_read(dialog_input_result)) { + set_config_filename(dialog_input_result); + sym_set_change_count(1); return; + } show_textbox(NULL, _("File does not exist!"), 5, 38); break; case 1: show_helptext(_("Load Alternate Configuration"), load_config_help); break; - case 255: + case KEY_ESC: return; } } @@ -1004,45 +837,35 @@ static void conf_save(void) { - int stat; - while (1) { - cprint_init(); - cprint("--inputbox"); - cprint(save_config_text); - cprint("11"); - cprint("55"); - cprint("%s", filename); - stat = exec_conf(); - switch(stat) { + int res; + dialog_clear(); + res = dialog_inputbox(NULL, save_config_text, + 11, 55, filename); + switch(res) { case 0: - if (!input_buf[0]) + if (!dialog_input_result[0]) return; - if (!conf_write(input_buf)) + if (!conf_write(dialog_input_result)) { + set_config_filename(dialog_input_result); return; + } show_textbox(NULL, _("Can't create file! Probably a nonexistent directory."), 5, 60); break; case 1: show_helptext(_("Save Alternate Configuration"), save_config_help); break; - case 255: + case KEY_ESC: return; } } } -static void conf_cleanup(void) -{ - tcsetattr(1, TCSAFLUSH, &ios_org); - unlink(".help.tmp"); - unlink("lxdialog.scrltmp"); -} - int main(int ac, char **av) { - struct symbol *sym; + int saved_x, saved_y; char *mode; - int stat; + int res; setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, LOCALEDIR); @@ -1051,46 +874,56 @@ conf_parse(av[1]); conf_read(NULL); - sym = sym_lookup("KERNELVERSION", 0); - sym_calc_value(sym); - sprintf(menu_backtitle, _("BusyBox %s Configuration"), - sym_get_string_value(sym)); - mode = getenv("MENUCONFIG_MODE"); if (mode) { if (!strcasecmp(mode, "single_menu")) single_menu_mode = 1; } - tcgetattr(1, &ios_org); - atexit(conf_cleanup); - init_wsize(); - conf(&rootmenu); + getyx(stdscr, saved_y, saved_x); + if (init_dialog(NULL)) { + fprintf(stderr, N_("Your display is too small to run Menuconfig!\n")); + fprintf(stderr, N_("It must be at least 19 lines by 80 columns.\n")); + return 1; + } + set_config_filename(conf_get_configname()); do { - cprint_init(); - cprint("--yesno"); - cprint(_("Do you wish to save your new buildrom configuration?")); - cprint("5"); - cprint("60"); - stat = exec_conf(); - } while (stat < 0); + conf(&rootmenu); + dialog_clear(); + if (conf_get_changed()) + res = dialog_yesno(NULL, + _("Do you wish to save your " + "new configuration?\n" + "<ESC><ESC> to continue."), + 6, 60); + else + res = -1; + } while (res == KEY_ESC); + end_dialog(saved_x, saved_y); - if (stat == 0) { - if (conf_write(NULL)) { + switch (res) { + case 0: + if (conf_write(filename)) { fprintf(stderr, _("\n\n" - "Error during writing of the buildrom configuration.\n" - "Your buildrom configuration changes were NOT saved." + "Error during writing of the configuration.\n" + "Your configuration changes were NOT saved." "\n\n")); return 1; } + if (conf_write_autoconf()) { + fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n")); + return 1; + } + case -1: printf(_("\n\n" - "*** End of buildrom configuration.\n" - "*** Execute 'make' to build buildrom or try 'make help'." + "*** End of configuration.\n" + "*** Execute 'make' to build or try 'make help'." "\n\n")); - } else { + break; + default: fprintf(stderr, _("\n\n" - "Your buildrom configuration changes were NOT saved." + "Your configuration changes were NOT saved." "\n\n")); } Modified: buildrom-devel/scripts/kconfig/menu.c =================================================================== --- buildrom-devel/scripts/kconfig/menu.c 2008-07-01 21:13:46 UTC (rev 209) +++ buildrom-devel/scripts/kconfig/menu.c 2008-07-02 19:45:34 UTC (rev 210) @@ -15,7 +15,7 @@ struct file *file_list; struct file *current_file; -static void menu_warn(struct menu *menu, const char *fmt, ...) +void menu_warn(struct menu *menu, const char *fmt, ...) { va_list ap; va_start(ap, fmt); @@ -114,7 +114,7 @@ sym->type = type; return; } - menu_warn(current_entry, "type of '%s' redefined from '%s' to '%s'\n", + menu_warn(current_entry, "type of '%s' redefined from '%s' to '%s'", sym->name ? sym->name : "<choice>", sym_type_name(sym->type), sym_type_name(type)); } @@ -124,15 +124,20 @@ struct property *prop = prop_alloc(type, current_entry->sym); prop->menu = current_entry; - prop->text = prompt; prop->expr = expr; prop->visible.expr = menu_check_dep(dep); if (prompt) { + if (isspace(*prompt)) { + prop_warn(prop, "leading whitespace ignored"); + while (isspace(*prompt)) + prompt++; + } if (current_entry->prompt) - menu_warn(current_entry, "prompt redefined\n"); + prop_warn(prop, "prompt redefined"); current_entry->prompt = prop; } + prop->text = prompt; return prop; } @@ -152,6 +157,27 @@ menu_add_prop(type, NULL, expr_alloc_symbol(sym), dep); } +void menu_add_option(int token, char *arg) +{ + struct property *prop; + + switch (token) { + case T_OPT_MODULES: + prop = prop_alloc(P_DEFAULT, modules_sym); + prop->expr = expr_alloc_symbol(current_entry->sym); + break; + case T_OPT_DEFCONFIG_LIST: + if (!sym_defconfig_list) + sym_defconfig_list = current_entry->sym; + else if (sym_defconfig_list != current_entry->sym) + zconf_error("trying to redefine defconfig symbol"); + break; + case T_OPT_ENV: + prop_add_env(arg); + break; + } +} + static int menu_range_valid_sym(struct symbol *sym, struct symbol *sym2) { return sym2->type == S_INT || sym2->type == S_HEX || @@ -177,13 +203,10 @@ prop_warn(prop, "config symbol '%s' uses select, but is " "not boolean or tristate", sym->name); - else if (sym2->type == S_UNKNOWN) + else if (sym2->type != S_UNKNOWN && + sym2->type != S_BOOLEAN && + sym2->type != S_TRISTATE) prop_warn(prop, - "'select' used by config symbol '%s' " - "refer to undefined symbol '%s'", - sym->name, sym2->name); - else if (sym2->type != S_BOOLEAN && sym2->type != S_TRISTATE) - prop_warn(prop, "'%s' has wrong type. 'select' only " "accept arguments of boolean and " "tristate type", sym2->name); @@ -216,9 +239,11 @@ for (menu = parent->list; menu; menu = menu->next) { if (menu->sym) { current_entry = parent; - menu_set_type(menu->sym->type); + if (sym->type == S_UNKNOWN) + menu_set_type(menu->sym->type); current_entry = menu; - menu_set_type(sym->type); + if (menu->sym->type == S_UNKNOWN) + menu_set_type(sym->type); break; } } @@ -303,12 +328,42 @@ "values not supported"); } current_entry = menu; - menu_set_type(sym->type); + if (menu->sym->type == S_UNKNOWN) + menu_set_type(sym->type); + /* Non-tristate choice values of tristate choices must + * depend on the choice being set to Y. The choice + * values' dependencies were propagated to their + * properties above, so the change here must be re- + * propagated. */ + if (sym->type == S_TRISTATE && menu->sym->type != S_TRISTATE) { + basedep = expr_alloc_comp(E_EQUAL, sym, &symbol_yes); + basedep = expr_alloc_and(basedep, menu->dep); + basedep = expr_eliminate_dups(basedep); + menu->dep = basedep; + for (prop = menu->sym->prop; prop; prop = prop->next) { + if (prop->menu != menu) + continue; + dep = expr_alloc_and(expr_copy(basedep), + prop->visible.expr); + dep = expr_eliminate_dups(dep); + dep = expr_trans_bool(dep); + prop->visible.expr = dep; + if (prop->type == P_SELECT) { + struct symbol *es = prop_get_symbol(prop); + dep2 = expr_alloc_symbol(menu->sym); + dep = expr_alloc_and(dep2, + expr_copy(dep)); + dep = expr_alloc_or(es->rev_dep.expr, dep); + dep = expr_eliminate_dups(dep); + es->rev_dep.expr = dep; + } + } + } menu_add_symbol(P_CHOICE, sym, NULL); prop = sym_get_choice_prop(sym); for (ep = &prop->expr; *ep; ep = &(*ep)->left.expr) ; - *ep = expr_alloc_one(E_CHOICE, NULL); + *ep = expr_alloc_one(E_LIST, NULL); (*ep)->right.sym = menu->sym; } if (menu->list && (!menu->prompt || !menu->prompt->text)) { @@ -325,11 +380,10 @@ if (sym && !(sym->flags & SYMBOL_WARNED)) { if (sym->type == S_UNKNOWN) - menu_warn(parent, "config symbol defined " - "without type\n"); + menu_warn(parent, "config symbol defined without type"); if (sym_is_choice(sym) && !parent->prompt) - menu_warn(parent, "choice must have a prompt\n"); + menu_warn(parent, "choice must have a prompt"); /* Check properties connected to this symbol */ sym_check_prop(sym); @@ -372,9 +426,9 @@ const char *menu_get_prompt(struct menu *menu) { if (menu->prompt) - return _(menu->prompt->text); + return menu->prompt->text; else if (menu->sym) - return _(menu->sym->name); + return menu->sym->name; return NULL; } @@ -395,3 +449,15 @@ return menu; } +bool menu_has_help(struct menu *menu) +{ + return menu->help != NULL; +} + +const char *menu_get_help(struct menu *menu) +{ + if (menu->help) + return menu->help; + else + return ""; +} Added: buildrom-devel/scripts/kconfig/qconf.cc =================================================================== --- buildrom-devel/scripts/kconfig/qconf.cc (rev 0) +++ buildrom-devel/scripts/kconfig/qconf.cc 2008-07-02 19:45:34 UTC (rev 210) @@ -0,0 +1,1764 @@ +/* + * Copyright (C) 2002 Roman Zippel <zippel at linux-m68k.org> + * Released under the terms of the GNU GPL v2.0. + */ + +#include <qapplication.h> +#include <qmainwindow.h> +#include <qtoolbar.h> +#include <qlayout.h> +#include <qvbox.h> +#include <qsplitter.h> +#include <qlistview.h> +#include <qtextbrowser.h> +#include <qlineedit.h> +#include <qlabel.h> +#include <qpushbutton.h> +#include <qmenubar.h> +#include <qmessagebox.h> +#include <qaction.h> +#include <qheader.h> +#include <qfiledialog.h> +#include <qdragobject.h> +#include <qregexp.h> + +#include <stdlib.h> + +#include "lkc.h" +#include "qconf.h" + +#include "qconf.moc" +#include "images.c" + +#ifdef _ +# undef _ +# define _ qgettext +#endif + +static QApplication *configApp; +static ConfigSettings *configSettings; + +QAction *ConfigMainWindow::saveAction; + +static inline QString qgettext(const char* str) +{ + return QString::fromLocal8Bit(gettext(str)); +} + +static inline QString qgettext(const QString& str) +{ + return QString::fromLocal8Bit(gettext(str.latin1())); +} + +/** + * Reads a list of integer values from the application settings. + */ +QValueList<int> ConfigSettings::readSizes(const QString& key, bool *ok) +{ + QValueList<int> result; + QStringList entryList = readListEntry(key, ok); + if (ok) { + QStringList::Iterator it; + for (it = entryList.begin(); it != entryList.end(); ++it) + result.push_back((*it).toInt()); + } + + return result; +} + +/** + * Writes a list of integer values to the application settings. + */ +bool ConfigSettings::writeSizes(const QString& key, const QValueList<int>& value) +{ + QStringList stringList; + QValueList<int>::ConstIterator it; + + for (it = value.begin(); it != value.end(); ++it) + stringList.push_back(QString::number(*it)); + return writeEntry(key, stringList); +} + + +#if QT_VERSION >= 300 +/* + * set the new data + * TODO check the value + */ +void ConfigItem::okRename(int col) +{ + Parent::okRename(col); + sym_set_string_value(menu->sym, text(dataColIdx).latin1()); + listView()->updateList(this); +} +#endif + +/* + * update the displayed of a menu entry + */ +void ConfigItem::updateMenu(void) +{ + ConfigList* list; + struct symbol* sym; + struct property *prop; + QString prompt; + int type; + tristate expr; + + list = listView(); + if (goParent) { + setPixmap(promptColIdx, list->menuBackPix); + prompt = ".."; + goto set_prompt; + } + + sym = menu->sym; + prop = menu->prompt; + prompt = _(menu_get_prompt(menu)); + + if (prop) switch (prop->type) { + case P_MENU: + if (list->mode == singleMode || list->mode == symbolMode) { + /* a menuconfig entry is displayed differently + * depending whether it's at the view root or a child. + */ + if (sym && list->rootEntry == menu) + break; + setPixmap(promptColIdx, list->menuPix); + } else { + if (sym) + break; + setPixmap(promptColIdx, 0); + } + goto set_prompt; + case P_COMMENT: + setPixmap(promptColIdx, 0); + goto set_prompt; + default: + ; + } + if (!sym) + goto set_prompt; + + setText(nameColIdx, QString::fromLocal8Bit(sym->name)); + + type = sym_get_type(sym); + switch (type) { + case S_BOOLEAN: + case S_TRISTATE: + char ch; + + if (!sym_is_changable(sym) && !list->showAll) { + setPixmap(promptColIdx, 0); + setText(noColIdx, QString::null); + setText(modColIdx, QString::null); + setText(yesColIdx, QString::null); + break; + } + expr = sym_get_tristate_value(sym); + switch (expr) { + case yes: + if (sym_is_choice_value(sym) && type == S_BOOLEAN) + setPixmap(promptColIdx, list->choiceYesPix); + else + setPixmap(promptColIdx, list->symbolYesPix); + setText(yesColIdx, "Y"); + ch = 'Y'; + break; + case mod: + setPixmap(promptColIdx, list->symbolModPix); + setText(modColIdx, "M"); + ch = 'M'; + break; + default: + if (sym_is_choice_value(sym) && type == S_BOOLEAN) + setPixmap(promptColIdx, list->choiceNoPix); + else + setPixmap(promptColIdx, list->symbolNoPix); + setText(noColIdx, "N"); + ch = 'N'; + break; + } + if (expr != no) + setText(noColIdx, sym_tristate_within_range(sym, no) ? "_" : 0); + if (expr != mod) + setText(modColIdx, sym_tristate_within_range(sym, mod) ? "_" : 0); + if (expr != yes) + setText(yesColIdx, sym_tristate_within_range(sym, yes) ? "_" : 0); + + setText(dataColIdx, QChar(ch)); + break; + case S_INT: + case S_HEX: + case S_STRING: + const char* data; + + data = sym_get_string_value(sym); + +#if QT_VERSION >= 300 + int i = list->mapIdx(dataColIdx); + if (i >= 0) + setRenameEnabled(i, TRUE); +#endif + setText(dataColIdx, data); + if (type == S_STRING) + prompt = QString("%1: %2").arg(prompt).arg(data); + else + prompt = QString("(%2) %1").arg(prompt).arg(data); + break; + } + if (!sym_has_value(sym) && visible) + prompt += _(" (NEW)"); +set_prompt: + setText(promptColIdx, prompt); +} + +void ConfigItem::testUpdateMenu(bool v) +{ + ConfigItem* i; + + visible = v; + if (!menu) + return; + + sym_calc_value(menu->sym); + if (menu->flags & MENU_CHANGED) { + /* the menu entry changed, so update all list items */ + menu->flags &= ~MENU_CHANGED; + for (i = (ConfigItem*)menu->data; i; i = i->nextItem) + i->updateMenu(); + } else if (listView()->updateAll) + updateMenu(); +} + +void ConfigItem::paintCell(QPainter* p, const QColorGroup& cg, int column, int width, int align) +{ + ConfigList* list = listView(); + + if (visible) { + if (isSelected() && !list->hasFocus() && list->mode == menuMode) + Parent::paintCell(p, list->inactivedColorGroup, column, width, align); + else + Parent::paintCell(p, cg, column, width, align); + } else + Parent::paintCell(p, list->disabledColorGroup, column, width, align); +} + +/* + * construct a menu entry + */ +void ConfigItem::init(void) +{ + if (menu) { + ConfigList* list = listView(); + nextItem = (ConfigItem*)menu->data; + menu->data = this; + + if (list->mode != fullMode) + setOpen(TRUE); + sym_calc_value(menu->sym); + } + updateMenu(); +} + +/* + * destruct a menu entry + */ +ConfigItem::~ConfigItem(void) +{ + if (menu) { + ConfigItem** ip = (ConfigItem**)&menu->data; + for (; *ip; ip = &(*ip)->nextItem) { + if (*ip == this) { + *ip = nextItem; + break; + } + } + } +} + +ConfigLineEdit::ConfigLineEdit(ConfigView* parent) + : Parent(parent) +{ + connect(this, SIGNAL(lostFocus()), SLOT(hide())); +} + +void ConfigLineEdit::show(ConfigItem* i) +{ + item = i; + if (sym_get_string_value(item->menu->sym)) + setText(QString::fromLocal8Bit(sym_get_string_value(item->menu->sym))); + else + setText(QString::null); + Parent::show(); + setFocus(); +} + +void ConfigLineEdit::keyPressEvent(QKeyEvent* e) +{ + switch (e->key()) { + case Key_Escape: + break; + case Key_Return: + case Key_Enter: + sym_set_string_value(item->menu->sym, text().latin1()); + parent()->updateList(item); + break; + default: + Parent::keyPressEvent(e); + return; + } + e->accept(); + parent()->list->setFocus(); + hide(); +} + +ConfigList::ConfigList(ConfigView* p, const char *name) + : Parent(p, name), + updateAll(false), + symbolYesPix(xpm_symbol_yes), symbolModPix(xpm_symbol_mod), symbolNoPix(xpm_symbol_no), + choiceYesPix(xpm_choice_yes), choiceNoPix(xpm_choice_no), + menuPix(xpm_menu), menuInvPix(xpm_menu_inv), menuBackPix(xpm_menuback), voidPix(xpm_void), + showAll(false), showName(false), showRange(false), showData(false), + rootEntry(0), headerPopup(0) +{ + int i; + + setSorting(-1); + setRootIsDecorated(TRUE); + disabledColorGroup = palette().active(); + disabledColorGroup.setColor(QColorGroup::Text, palette().disabled().text()); + inactivedColorGroup = palette().active(); + inactivedColorGroup.setColor(QColorGroup::Highlight, palette().disabled().highlight()); + + connect(this, SIGNAL(selectionChanged(void)), + SLOT(updateSelection(void))); + + if (name) { + configSettings->beginGroup(name); + showAll = configSettings->readBoolEntry("/showAll", false); + showName = configSettings->readBoolEntry("/showName", false); + showRange = configSettings->readBoolEntry("/showRange", false); + showData = configSettings->readBoolEntry("/showData", false); + configSettings->endGroup(); + connect(configApp, SIGNAL(aboutToQuit()), SLOT(saveSettings())); + } + + for (i = 0; i < colNr; i++) + colMap[i] = colRevMap[i] = -1; + addColumn(promptColIdx, _("Option")); + + reinit(); +} + +void ConfigList::reinit(void) +{ + removeColumn(dataColIdx); + removeColumn(yesColIdx); + removeColumn(modColIdx); + removeColumn(noColIdx); + removeColumn(nameColIdx); + + if (showName) + addColumn(nameColIdx, _("Name")); + if (showRange) { + addColumn(noColIdx, "N"); + addColumn(modColIdx, "M"); + addColumn(yesColIdx, "Y"); + } + if (showData) + addColumn(dataColIdx, _("Value")); + + updateListAll(); +} + +void ConfigList::saveSettings(void) +{ + if (name()) { + configSettings->beginGroup(name()); + configSettings->writeEntry("/showName", showName); + configSettings->writeEntry("/showRange", showRange); + configSettings->writeEntry("/showData", showData); + configSettings->writeEntry("/showAll", showAll); + configSettings->endGroup(); + } +} + +ConfigItem* ConfigList::findConfigItem(struct menu *menu) +{ + ConfigItem* item = (ConfigItem*)menu->data; + + for (; item; item = item->nextItem) { + if (this == item->listView()) + break; + } + + return item; +} + +void ConfigList::updateSelection(void) +{ + struct menu *menu; + enum prop_type type; + + ConfigItem* item = (ConfigItem*)selectedItem(); + if (!item) + return; + + menu = item->menu; + emit menuChanged(menu); + if (!menu) + return; + type = menu->prompt ? menu->prompt->type : P_UNKNOWN; + if (mode == menuMode && type == P_MENU) + emit menuSelected(menu); +} + +void ConfigList::updateList(ConfigItem* item) +{ + ConfigItem* last = 0; + + if (!rootEntry) { + if (mode != listMode) + goto update; + QListViewItemIterator it(this); + ConfigItem* item; + + for (; it.current(); ++it) { + item = (ConfigItem*)it.current(); + if (!item->menu) + continue; + item->testUpdateMenu(menu_is_visible(item->menu)); + } + return; + } + + if (rootEntry != &rootmenu && (mode == singleMode || + (mode == symbolMode && rootEntry->parent != &rootmenu))) { + item = firstChild(); + if (!item) + item = new ConfigItem(this, 0, true); + last = item; + } + if ((mode == singleMode || (mode == symbolMode && !(rootEntry->flags & MENU_ROOT))) && + rootEntry->sym && rootEntry->prompt) { + item = last ? last->nextSibling() : firstChild(); + if (!item) + item = new ConfigItem(this, last, rootEntry, true); + else + item->testUpdateMenu(true); + + updateMenuList(item, rootEntry); + triggerUpdate(); + return; + } +update: + updateMenuList(this, rootEntry); + triggerUpdate(); +} + +void ConfigList::setValue(ConfigItem* item, tristate val) +{ + struct symbol* sym; + int type; + tristate oldval; + + sym = item->menu ? item->menu->sym : 0; + if (!sym) + return; + + type = sym_get_type(sym); + switch (type) { + case S_BOOLEAN: + case S_TRISTATE: + oldval = sym_get_tristate_value(sym); + + if (!sym_set_tristate_value(sym, val)) + return; + if (oldval == no && item->menu->list) + item->setOpen(TRUE); + parent()->updateList(item); + break; + } +} + +void ConfigList::changeValue(ConfigItem* item) +{ + struct symbol* sym; + struct menu* menu; + int type, oldexpr, newexpr; + + menu = item->menu; + if (!menu) + return; + sym = menu->sym; + if (!sym) { + if (item->menu->list) + item->setOpen(!item->isOpen()); + return; + } + + type = sym_get_type(sym); + switch (type) { + case S_BOOLEAN: + case S_TRISTATE: + oldexpr = sym_get_tristate_value(sym); + newexpr = sym_toggle_tristate_value(sym); + if (item->menu->list) { + if (oldexpr == newexpr) + item->setOpen(!item->isOpen()); + else if (oldexpr == no) + item->setOpen(TRUE); + } + if (oldexpr != newexpr) + parent()->updateList(item); + break; + case S_INT: + case S_HEX: + case S_STRING: +#if QT_VERSION >= 300 + if (colMap[dataColIdx] >= 0) + item->startRename(colMap[dataColIdx]); + else +#endif + parent()->lineEdit->show(item); + break; + } +} + +void ConfigList::setRootMenu(struct menu *menu) +{ + enum prop_type type; + + if (rootEntry == menu) + return; + type = menu && menu->prompt ? menu->prompt->type : P_UNKNOWN; + if (type != P_MENU) + return; + updateMenuList(this, 0); + rootEntry = menu; + updateListAll(); + setSelected(currentItem(), hasFocus()); + ensureItemVisible(currentItem()); +} + +void ConfigList::setParentMenu(void) +{ + ConfigItem* item; + struct menu *oldroot; + + oldroot = rootEntry; + if (rootEntry == &rootmenu) + return; + setRootMenu(menu_get_parent_menu(rootEntry->parent)); + + QListViewItemIterator it(this); + for (; (item = (ConfigItem*)it.current()); it++) { + if (item->menu == oldroot) { + setCurrentItem(item); + ensureItemVisible(item); + break; + } + } +} + +/* + * update all the children of a menu entry + * removes/adds the entries from the parent widget as necessary + * + * parent: either the menu list widget or a menu entry widget + * menu: entry to be updated + */ +template <class P> +void ConfigList::updateMenuList(P* parent, struct menu* menu) +{ + struct menu* child; + ConfigItem* item; + ConfigItem* last; + bool visible; + enum prop_type type; + + if (!menu) { + while ((item = parent->firstChild())) + delete item; + return; + } + + last = parent->firstChild(); + if (last && !last->goParent) + last = 0; + for (child = menu->list; child; child = child->next) { + item = last ? last->nextSibling() : parent->firstChild(); + type = child->prompt ? child->prompt->type : P_UNKNOWN; + + switch (mode) { + case menuMode: + if (!(child->flags & MENU_ROOT)) + goto hide; + break; + case symbolMode: + if (child->flags & MENU_ROOT) + goto hide; + break; + default: + break; + } + + visible = menu_is_visible(child); + if (showAll || visible) { + if (!child->sym && !child->list && !child->prompt) + continue; + if (!item || item->menu != child) + item = new ConfigItem(parent, last, child, visible); + else + item->testUpdateMenu(visible); + + if (mode == fullMode || mode == menuMode || type != P_MENU) + updateMenuList(item, child); + else + updateMenuList(item, 0); + last = item; + continue; + } + hide: + if (item && item->menu == child) { + last = parent->firstChild(); + if (last == item) + last = 0; + else while (last->nextSibling() != item) + last = last->nextSibling(); + delete item; + } + } +} + +void ConfigList::keyPressEvent(QKeyEvent* ev) +{ + QListViewItem* i = currentItem(); + ConfigItem* item; + struct menu *menu; + enum prop_type type; + + if (ev->key() == Key_Escape && mode != fullMode && mode != listMode) { + emit parentSelected(); + ev->accept(); + return; + } + + if (!i) { + Parent::keyPressEvent(ev); + return; + } + item = (ConfigItem*)i; + + switch (ev->key()) { + case Key_Return: + case Key_Enter: + if (item->goParent) { + emit parentSelected(); + break; + } + menu = item->menu; + if (!menu) + break; + type = menu->prompt ? menu->prompt->type : P_UNKNOWN; + if (type == P_MENU && rootEntry != menu && + mode != fullMode && mode != menuMode) { + emit menuSelected(menu); + break; + } + case Key_Space: + changeValue(item); + break; + case Key_N: + setValue(item, no); + break; + case Key_M: + setValue(item, mod); + break; + case Key_Y: + setValue(item, yes); + break; + default: + Parent::keyPressEvent(ev); + return; + } + ev->accept(); +} + +void ConfigList::contentsMousePressEvent(QMouseEvent* e) +{ + //QPoint p(contentsToViewport(e->pos())); + //printf("contentsMousePressEvent: %d,%d\n", p.x(), p.y()); + Parent::contentsMousePressEvent(e); +} + +void ConfigList::contentsMouseReleaseEvent(QMouseEvent* e) +{ + QPoint p(contentsToViewport(e->pos())); + ConfigItem* item = (ConfigItem*)itemAt(p); + struct menu *menu; + enum prop_type ptype; + const QPixmap* pm; + int idx, x; + + if (!item) + goto skip; + + menu = item->menu; + x = header()->offset() + p.x(); + idx = colRevMap[header()->sectionAt(x)]; + switch (idx) { + case promptColIdx: + pm = item->pixmap(promptColIdx); + if (pm) { + int off = header()->sectionPos(0) + itemMargin() + + treeStepSize() * (item->depth() + (rootIsDecorated() ? 1 : 0)); + if (x >= off && x < off + pm->width()) { + if (item->goParent) { + emit parentSelected(); + break; + } else if (!menu) + break; + ptype = menu->prompt ? menu->prompt->type : P_UNKNOWN; + if (ptype == P_MENU && rootEntry != menu && + mode != fullMode && mode != menuMode) + emit menuSelected(menu); + else + changeValue(item); + } + } + break; + case noColIdx: + setValue(item, no); + break; + case modColIdx: + setValue(item, mod); + break; + case yesColIdx: + setValue(item, yes); + break; + case dataColIdx: + changeValue(item); + break; + } + +skip: + //printf("contentsMouseReleaseEvent: %d,%d\n", p.x(), p.y()); + Parent::contentsMouseReleaseEvent(e); +} + +void ConfigList::contentsMouseMoveEvent(QMouseEvent* e) +{ + //QPoint p(contentsToViewport(e->pos())); + //printf("contentsMouseMoveEvent: %d,%d\n", p.x(), p.y()); + Parent::contentsMouseMoveEvent(e); +} + +void ConfigList::contentsMouseDoubleClickEvent(QMouseEvent* e) +{ + QPoint p(contentsToViewport(e->pos())); + ConfigItem* item = (ConfigItem*)itemAt(p); + struct menu *menu; + enum prop_type ptype; + + if (!item) + goto skip; + if (item->goParent) { + emit parentSelected(); + goto skip; + } + menu = item->menu; + if (!menu) + goto skip; + ptype = menu->prompt ? menu->prompt->type : P_UNKNOWN; + if (ptype == P_MENU && (mode == singleMode || mode == symbolMode)) + emit menuSelected(menu); + else if (menu->sym) + changeValue(item); + +skip: + //printf("contentsMouseDoubleClickEvent: %d,%d\n", p.x(), p.y()); + Parent::contentsMouseDoubleClickEvent(e); +} + +void ConfigList::focusInEvent(QFocusEvent *e) +{ + struct menu *menu = NULL; + + Parent::focusInEvent(e); + + ConfigItem* item = (ConfigItem *)currentItem(); + if (item) { + setSelected(item, TRUE); + menu = item->menu; + } + emit gotFocus(menu); +} + +void ConfigList::contextMenuEvent(QContextMenuEvent *e) +{ + if (e->y() <= header()->geometry().bottom()) { + if (!headerPopup) { + QAction *action; + + headerPopup = new QPopupMenu(this); + action = new QAction(NULL, _("Show Name"), 0, this); + action->setToggleAction(TRUE); + connect(action, SIGNAL(toggled(bool)), + parent(), SLOT(setShowName(bool))); + connect(parent(), SIGNAL(showNameChanged(bool)), + action, SLOT(setOn(bool))); + action->setOn(showName); + action->addTo(headerPopup); + action = new QAction(NULL, _("Show Range"), 0, this); + action->setToggleAction(TRUE); + connect(action, SIGNAL(toggled(bool)), + parent(), SLOT(setShowRange(bool))); + connect(parent(), SIGNAL(showRangeChanged(bool)), + action, SLOT(setOn(bool))); + action->setOn(showRange); + action->addTo(headerPopup); + action = new QAction(NULL, _("Show Data"), 0, this); + action->setToggleAction(TRUE); + connect(action, SIGNAL(toggled(bool)), + parent(), SLOT(setShowData(bool))); + connect(parent(), SIGNAL(showDataChanged(bool)), + action, SLOT(setOn(bool))); + action->setOn(showData); + action->addTo(headerPopup); + } + headerPopup->exec(e->globalPos()); + e->accept(); + } else + e->ignore(); +} + +ConfigView* ConfigView::viewList; + +ConfigView::ConfigView(QWidget* parent, const char *name) + : Parent(parent, name) +{ + list = new ConfigList(this, name); + lineEdit = new ConfigLineEdit(this); + lineEdit->hide(); + + this->nextView = viewList; + viewList = this; +} + +ConfigView::~ConfigView(void) +{ + ConfigView** vp; + + for (vp = &viewList; *vp; vp = &(*vp)->nextView) { + if (*vp == this) { + *vp = nextView; + break; + } + } +} + +void ConfigView::setShowAll(bool b) +{ + if (list->showAll != b) { + list->showAll = b; + list->updateListAll(); + emit showAllChanged(b); + } +} + +void ConfigView::setShowName(bool b) +{ + if (list->showName != b) { + list->showName = b; + list->reinit(); + emit showNameChanged(b); + } +} + +void ConfigView::setShowRange(bool b) +{ + if (list->showRange != b) { + list->showRange = b; + list->reinit(); + emit showRangeChanged(b); + } +} + +void ConfigView::setShowData(bool b) +{ + if (list->showData != b) { + list->showData = b; + list->reinit(); + emit showDataChanged(b); + } +} + +void ConfigList::setAllOpen(bool open) +{ + QListViewItemIterator it(this); + + for (; it.current(); it++) + it.current()->setOpen(open); +} + +void ConfigView::updateList(ConfigItem* item) +{ + ConfigView* v; + + for (v = viewList; v; v = v->nextView) + v->list->updateList(item); +} + +void ConfigView::updateListAll(void) +{ + ConfigView* v; + + for (v = viewList; v; v = v->nextView) + v->list->updateListAll(); +} + +ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name) + : Parent(parent, name), menu(0), sym(0) +{ + if (name) { + configSettings->beginGroup(name); + _showDebug = configSettings->readBoolEntry("/showDebug", false); + configSettings->endGroup(); + connect(configApp, SIGNAL(aboutToQuit()), SLOT(saveSettings())); + } +} + +void ConfigInfoView::saveSettings(void) +{ + if (name()) { + configSettings->beginGroup(name()); + configSettings->writeEntry("/showDebug", showDebug()); + configSettings->endGroup(); + } +} + +void ConfigInfoView::setShowDebug(bool b) +{ + if (_showDebug != b) { + _showDebug = b; + if (menu) + menuInfo(); + else if (sym) + symbolInfo(); + emit showDebugChanged(b); + } +} + +void ConfigInfoView::setInfo(struct menu *m) +{ + if (menu == m) + return; + menu = m; + sym = NULL; + if (!menu) + clear(); + else + menuInfo(); +} + +void ConfigInfoView::setSource(const QString& name) +{ + const char *p = name.latin1(); + + menu = NULL; + sym = NULL; + + switch (p[0]) { + case 'm': + struct menu *m; + + if (sscanf(p, "m%p", &m) == 1 && menu != m) { + menu = m; + menuInfo(); + emit menuSelected(menu); + } + break; + case 's': + struct symbol *s; + + if (sscanf(p, "s%p", &s) == 1 && sym != s) { + sym = s; + symbolInfo(); + } + break; + } +} + +void ConfigInfoView::symbolInfo(void) +{ + QString str; + + str += "<big>Symbol: <b>"; + str += print_filter(sym->name); + str += "</b></big><br><br>value: "; + str += print_filter(sym_get_string_value(sym)); + str += "<br>visibility: "; + str += sym->visible == yes ? "y" : sym->visible == mod ? "m" : "n"; + str += "<br>"; + str += debug_info(sym); + + setText(str); +} + +void ConfigInfoView::menuInfo(void) +{ + struct symbol* sym; + QString head, debug, help; + + sym = menu->sym; + if (sym) { + if (menu->prompt) { + head += "<big><b>"; + head += print_filter(_(menu->prompt->text)); + head += "</b></big>"; + if (sym->name) { + head += " ("; + if (showDebug()) + head += QString().sprintf("<a href=\"s%p\">", sym); + head += print_filter(sym->name); + if (showDebug()) + head += "</a>"; + head += ")"; + } + } else if (sym->name) { + head += "<big><b>"; + if (showDebug()) + head += QString().sprintf("<a href=\"s%p\">", sym); + head += print_filter(sym->name); + if (showDebug()) + head += "</a>"; + head += "</b></big>"; + } + head += "<br><br>"; + + if (showDebug()) + debug = debug_info(sym); + + help = menu_get_help(menu); + /* Gettextize if the help text not empty */ + if (help.isEmpty()) + help = print_filter(menu_get_help(menu)); + else + help = print_filter(_(menu_get_help(menu))); + } else if (menu->prompt) { + head += "<big><b>"; + head += print_filter(_(menu->prompt->text)); + head += "</b></big><br><br>"; + if (showDebug()) { + if (menu->prompt->visible.expr) { + debug += "  dep: "; + expr_print(menu->prompt->visible.expr, expr_print_help, &debug, E_NONE); + debug += "<br><br>"; + } + } + } + if (showDebug()) + debug += QString().sprintf("defined at %s:%d<br><br>", menu->file->name, menu->lineno); + + setText(head + debug + help); +} + +QString ConfigInfoView::debug_info(struct symbol *sym) +{ + QString debug; + + debug += "type: "; + debug += print_filter(sym_type_name(sym->type)); + if (sym_is_choice(sym)) + debug += " (choice)"; + debug += "<br>"; + if (sym->rev_dep.expr) { + debug += "reverse dep: "; + expr_print(sym->rev_dep.expr, expr_print_help, &debug, E_NONE); + debug += "<br>"; + } + for (struct property *prop = sym->prop; prop; prop = prop->next) { + switch (prop->type) { + case P_PROMPT: + case P_MENU: + debug += QString().sprintf("prompt: <a href=\"m%p\">", prop->menu); + debug += print_filter(_(prop->text)); + debug += "</a><br>"; + break; + case P_DEFAULT: + case P_SELECT: + case P_RANGE: + case P_ENV: + debug += prop_get_type_name(prop->type); + debug += ": "; + expr_print(prop->expr, expr_print_help, &debug, E_NONE); + debug += "<br>"; + break; + case P_CHOICE: + if (sym_is_choice(sym)) { + debug += "choice: "; + expr_print(prop->expr, expr_print_help, &debug, E_NONE); + debug += "<br>"; + } + break; + default: + debug += "unknown property: "; + debug += prop_get_type_name(prop->type); + debug += "<br>"; + } + if (prop->visible.expr) { + debug += "    dep: "; + expr_print(prop->visible.expr, expr_print_help, &debug, E_NONE); + debug += "<br>"; + } + } + debug += "<br>"; + + return debug; +} + +QString ConfigInfoView::print_filter(const QString &str) +{ + QRegExp re("[<>&\"\\n]"); + QString res = str; + for (int i = 0; (i = res.find(re, i)) >= 0;) { + switch (res[i].latin1()) { + case '<': + res.replace(i, 1, "<"); + i += 4; + break; + case '>': + res.replace(i, 1, ">"); + i += 4; + break; + case '&': + res.replace(i, 1, "&"); + i += 5; + break; + case '"': + res.replace(i, 1, """); + i += 6; + break; + case '\n': + res.replace(i, 1, "<br>"); + i += 4; + break; + } + } + return res; +} + +void ConfigInfoView::expr_print_help(void *data, struct symbol *sym, const char *str) +{ + QString* text = reinterpret_cast<QString*>(data); + QString str2 = print_filter(str); + + if (sym && sym->name && !(sym->flags & SYMBOL_CONST)) { + *text += QString().sprintf("<a href=\"s%p\">", sym); + *text += str2; + *text += "</a>"; + } else + *text += str2; +} + +QPopupMenu* ConfigInfoView::createPopupMenu(const QPoint& pos) +{ + QPopupMenu* popup = Parent::createPopupMenu(pos); + QAction* action = new QAction(NULL, _("Show Debug Info"), 0, popup); + action->setToggleAction(TRUE); + connect(action, SIGNAL(toggled(bool)), SLOT(setShowDebug(bool))); + connect(this, SIGNAL(showDebugChanged(bool)), action, SLOT(setOn(bool))); + action->setOn(showDebug()); + popup->insertSeparator(); + action->addTo(popup); + return popup; +} + +void ConfigInfoView::contentsContextMenuEvent(QContextMenuEvent *e) +{ + Parent::contentsContextMenuEvent(e); +} + +ConfigSearchWindow::ConfigSearchWindow(ConfigMainWindow* parent, const char *name) + : Parent(parent, name), result(NULL) +{ + setCaption("Search Config"); + + QVBoxLayout* layout1 = new QVBoxLayout(this, 11, 6); + QHBoxLayout* layout2 = new QHBoxLayout(0, 0, 6); + layout2->addWidget(new QLabel(_("Find:"), this)); + editField = new QLineEdit(this); + connect(editField, SIGNAL(returnPressed()), SLOT(search())); + layout2->addWidget(editField); + searchButton = new QPushButton(_("Search"), this); + searchButton->setAutoDefault(FALSE); + connect(searchButton, SIGNAL(clicked()), SLOT(search())); + layout2->addWidget(searchButton); + layout1->addLayout(layout2); + + split = new QSplitter(this); + split->setOrientation(QSplitter::Vertical); + list = new ConfigView(split, name); + list->list->mode = listMode; + info = new ConfigInfoView(split, name); + connect(list->list, SIGNAL(menuChanged(struct menu *)), + info, SLOT(setInfo(struct menu *))); + connect(list->list, SIGNAL(menuChanged(struct menu *)), + parent, SLOT(setMenuLink(struct menu *))); + + layout1->addWidget(split); + + if (name) { + int x, y, width, height; + bool ok; + + configSettings->beginGroup(name); + width = configSettings->readNumEntry("/window width", parent->width() / 2); + height = configSettings->readNumEntry("/window height", parent->height() / 2); + resize(width, height); + x = configSettings->readNumEntry("/window x", 0, &ok); + if (ok) + y = configSettings->readNumEntry("/window y", 0, &ok); + if (ok) + move(x, y); + QValueList<int> sizes = configSettings->readSizes("/split", &ok); + if (ok) + split->setSizes(sizes); + configSettings->endGroup(); + connect(configApp, SIGNAL(aboutToQuit()), SLOT(saveSettings())); + } +} + +void ConfigSearchWindow::saveSettings(void) +{ + if (name()) { + configSettings->beginGroup(name()); + configSettings->writeEntry("/window x", pos().x()); + configSettings->writeEntry("/window y", pos().y()); + configSettings->writeEntry("/window width", size().width()); + configSettings->writeEntry("/window height", size().height()); + configSettings->writeSizes("/split", split->sizes()); + configSettings->endGroup(); + } +} + +void ConfigSearchWindow::search(void) +{ + struct symbol **p; + struct property *prop; + ConfigItem *lastItem = NULL; + + free(result); + list->list->clear(); + info->clear(); + + result = sym_re_search(editField->text().latin1()); + if (!result) + return; + for (p = result; *p; p++) { + for_all_prompts((*p), prop) + lastItem = new ConfigItem(list->list, lastItem, prop->menu, + menu_is_visible(prop->menu)); + } +} + +/* + * Construct the complete config widget + */ +ConfigMainWindow::ConfigMainWindow(void) + : searchWindow(0) +{ + QMenuBar* menu; + bool ok; + int x, y, width, height; + char title[256]; + + QWidget *d = configApp->desktop(); + snprintf(title, sizeof(title), _("buildrom v%s Configuration"), + getenv("KERNELVERSION")); + setCaption(title); + + width = configSettings->readNumEntry("/window width", d->width() - 64); + height = configSettings->readNumEntry("/window height", d->height() - 64); + resize(width, height); + x = configSettings->readNumEntry("/window x", 0, &ok); + if (ok) + y = configSettings->readNumEntry("/window y", 0, &ok); + if (ok) + move(x, y); + + split1 = new QSplitter(this); + split1->setOrientation(QSplitter::Horizontal); + setCentralWidget(split1); + + menuView = new ConfigView(split1, "menu"); + menuList = menuView->list; + + split2 = new QSplitter(split1); + split2->setOrientation(QSplitter::Vertical); + + // create config tree + configView = new ConfigView(split2, "config"); + configList = configView->list; + + helpText = new ConfigInfoView(split2, "help"); + helpText->setTextFormat(Qt::RichText); + + setTabOrder(configList, helpText); + configList->setFocus(); + + menu = menuBar(); + toolBar = new QToolBar("Tools", this); + + backAction = new QAction("Back", QPixmap(xpm_back), _("Back"), 0, this); + connect(backAction, SIGNAL(activated()), SLOT(goBack())); + backAction->setEnabled(FALSE); + QAction *quitAction = new QAction("Quit", _("&Quit"), CTRL+Key_Q, this); + connect(quitAction, SIGNAL(activated()), SLOT(close())); + QAction *loadAction = new QAction("Load", QPixmap(xpm_load), _("&Load"), CTRL+Key_L, this); + connect(loadAction, SIGNAL(activated()), SLOT(loadConfig())); + saveAction = new QAction("Save", QPixmap(xpm_save), _("&Save"), CTRL+Key_S, this); + connect(saveAction, SIGNAL(activated()), SLOT(saveConfig())); + conf_set_changed_callback(conf_changed); + // Set saveAction's initial state + conf_changed(); + QAction *saveAsAction = new QAction("Save As...", _("Save &As..."), 0, this); + connect(saveAsAction, SIGNAL(activated()), SLOT(saveConfigAs())); + QAction *searchAction = new QAction("Find", _("&Find"), CTRL+Key_F, this); + connect(searchAction, SIGNAL(activated()), SLOT(searchConfig())); + QAction *singleViewAction = new QAction("Single View", QPixmap(xpm_single_view), _("Single View"), 0, this); + connect(singleViewAction, SIGNAL(activated()), SLOT(showSingleView())); + QAction *splitViewAction = new QAction("Split View", QPixmap(xpm_split_view), _("Split View"), 0, this); + connect(splitViewAction, SIGNAL(activated()), SLOT(showSplitView())); + QAction *fullViewAction = new QAction("Full View", QPixmap(xpm_tree_view), _("Full View"), 0, this); + connect(fullViewAction, SIGNAL(activated()), SLOT(showFullView())); + + QAction *showNameAction = new QAction(NULL, _("Show Name"), 0, this); + showNameAction->setToggleAction(TRUE); + connect(showNameAction, SIGNAL(toggled(bool)), configView, SLOT(setShowName(bool))); + connect(configView, SIGNAL(showNameChanged(bool)), showNameAction, SLOT(setOn(bool))); + showNameAction->setOn(configView->showName()); + QAction *showRangeAction = new QAction(NULL, _("Show Range"), 0, this); + showRangeAction->setToggleAction(TRUE); + connect(showRangeAction, SIGNAL(toggled(bool)), configView, SLOT(setShowRange(bool))); + connect(configView, SIGNAL(showRangeChanged(bool)), showRangeAction, SLOT(setOn(bool))); + showRangeAction->setOn(configList->showRange); + QAction *showDataAction = new QAction(NULL, _("Show Data"), 0, this); + showDataAction->setToggleAction(TRUE); + connect(showDataAction, SIGNAL(toggled(bool)), configView, SLOT(setShowData(bool))); + connect(configView, SIGNAL(showDataChanged(bool)), showDataAction, SLOT(setOn(bool))); + showDataAction->setOn(configList->showData); + QAction *showAllAction = new QAction(NULL, _("Show All Options"), 0, this); + showAllAction->setToggleAction(TRUE); + connect(showAllAction, SIGNAL(toggled(bool)), configView, SLOT(setShowAll(bool))); + connect(showAllAction, SIGNAL(toggled(bool)), menuView, SLOT(setShowAll(bool))); + showAllAction->setOn(configList->showAll); + QAction *showDebugAction = new QAction(NULL, _("Show Debug Info"), 0, this); + showDebugAction->setToggleAction(TRUE); + connect(showDebugAction, SIGNAL(toggled(bool)), helpText, SLOT(setShowDebug(bool))); + connect(helpText, SIGNAL(showDebugChanged(bool)), showDebugAction, SLOT(setOn(bool))); + showDebugAction->setOn(helpText->showDebug()); + + QAction *showIntroAction = new QAction(NULL, _("Introduction"), 0, this); + connect(showIntroAction, SIGNAL(activated()), SLOT(showIntro())); + QAction *showAboutAction = new QAction(NULL, _("About"), 0, this); + connect(showAboutAction, SIGNAL(activated()), SLOT(showAbout())); + + // init tool bar + backAction->addTo(toolBar); + toolBar->addSeparator(); + loadAction->addTo(toolBar); + saveAction->addTo(toolBar); + toolBar->addSeparator(); + singleViewAction->addTo(toolBar); + splitViewAction->addTo(toolBar); + fullViewAction->addTo(toolBar); + + // create config menu + QPopupMenu* config = new QPopupMenu(this); + menu->insertItem(_("&File"), config); + loadAction->addTo(config); + saveAction->addTo(config); + saveAsAction->addTo(config); + config->insertSeparator(); + quitAction->addTo(config); + + // create edit menu + QPopupMenu* editMenu = new QPopupMenu(this); + menu->insertItem(_("&Edit"), editMenu); + searchAction->addTo(editMenu); + + // create options menu + QPopupMenu* optionMenu = new QPopupMenu(this); + menu->insertItem(_("&Option"), optionMenu); + showNameAction->addTo(optionMenu); + showRangeAction->addTo(optionMenu); + showDataAction->addTo(optionMenu); + optionMenu->insertSeparator(); + showAllAction->addTo(optionMenu); + showDebugAction->addTo(optionMenu); + + // create help menu + QPopupMenu* helpMenu = new QPopupMenu(this); + menu->insertSeparator(); + menu->insertItem(_("&Help"), helpMenu); + showIntroAction->addTo(helpMenu); + showAboutAction->addTo(helpMenu); + + connect(configList, SIGNAL(menuChanged(struct menu *)), + helpText, SLOT(setInfo(struct menu *))); + connect(configList, SIGNAL(menuSelected(struct menu *)), + SLOT(changeMenu(struct menu *))); + connect(configList, SIGNAL(parentSelected()), + SLOT(goBack())); + connect(menuList, SIGNAL(menuChanged(struct menu *)), + helpText, SLOT(setInfo(struct menu *))); + connect(menuList, SIGNAL(menuSelected(struct menu *)), + SLOT(changeMenu(struct menu *))); + + connect(configList, SIGNAL(gotFocus(struct menu *)), + helpText, SLOT(setInfo(struct menu *))); + connect(menuList, SIGNAL(gotFocus(struct menu *)), + helpText, SLOT(setInfo(struct menu *))); + connect(menuList, SIGNAL(gotFocus(struct menu *)), + SLOT(listFocusChanged(void))); + connect(helpText, SIGNAL(menuSelected(struct menu *)), + SLOT(setMenuLink(struct menu *))); + + QString listMode = configSettings->readEntry("/listMode", "symbol"); + if (listMode == "single") + showSingleView(); + else if (listMode == "full") + showFullView(); + else /*if (listMode == "split")*/ + showSplitView(); + + // UI setup done, restore splitter positions + QValueList<int> sizes = configSettings->readSizes("/split1", &ok); + if (ok) + split1->setSizes(sizes); + + sizes = configSettings->readSizes("/split2", &ok); + if (ok) + split2->setSizes(sizes); +} + +void ConfigMainWindow::loadConfig(void) +{ + QString s = QFileDialog::getOpenFileName(".config", NULL, this); + if (s.isNull()) + return; + if (conf_read(QFile::encodeName(s))) + QMessageBox::information(this, "qconf", _("Unable to load configuration!")); + ConfigView::updateListAll(); +} + +void ConfigMainWindow::saveConfig(void) +{ + if (conf_write(NULL)) + QMessageBox::information(this, "qconf", _("Unable to save configuration!")); + if (conf_write_autoconf()) + QMessageBox::information(this, "qconf", _("Unable to save configuration!")); +} + +void ConfigMainWindow::saveConfigAs(void) +{ + QString s = QFileDialog::getSaveFileName(".config", NULL, this); + if (s.isNull()) + return; + if (conf_write(QFile::encodeName(s))) + QMessageBox::information(this, "qconf", _("Unable to save configuration!")); + if (conf_write_autoconf()) + QMessageBox::information(this, "qconf", _("Unable to save configuration!")); +} + +void ConfigMainWindow::searchConfig(void) +{ + if (!searchWindow) + searchWindow = new ConfigSearchWindow(this, "search"); + searchWindow->show(); +} + +void ConfigMainWindow::changeMenu(struct menu *menu) +{ + configList->setRootMenu(menu); + if (configList->rootEntry->parent == &rootmenu) + backAction->setEnabled(FALSE); + else + backAction->setEnabled(TRUE); +} + +void ConfigMainWindow::setMenuLink(struct menu *menu) +{ + struct menu *parent; + ConfigList* list = NULL; + ConfigItem* item; + + if (!menu_is_visible(menu) && !configView->showAll()) + return; + + switch (configList->mode) { + case singleMode: + list = configList; + parent = menu_get_parent_menu(menu); + if (!parent) + return; + list->setRootMenu(parent); + break; + case symbolMode: + if (menu->flags & MENU_ROOT) { + configList->setRootMenu(menu); + configList->clearSelection(); + list = menuList; + } else { + list = configList; + parent = menu_get_parent_menu(menu->parent); + if (!parent) + return; + item = menuList->findConfigItem(parent); + if (item) { + menuList->setSelected(item, TRUE); + menuList->ensureItemVisible(item); + } + list->setRootMenu(parent); + } + break; + case fullMode: + list = configList; + break; + } + + if (list) { + item = list->findConfigItem(menu); + if (item) { + list->setSelected(item, TRUE); + list->ensureItemVisible(item); + list->setFocus(); + } + } +} + +void ConfigMainWindow::listFocusChanged(void) +{ + if (menuList->mode == menuMode) + configList->clearSelection(); +} + +void ConfigMainWindow::goBack(void) +{ + ConfigItem* item; + + configList->setParentMenu(); + if (configList->rootEntry == &rootmenu) + backAction->setEnabled(FALSE); + item = (ConfigItem*)menuList->selectedItem(); + while (item) { + if (item->menu == configList->rootEntry) { + menuList->setSelected(item, TRUE); + break; + } + item = (ConfigItem*)item->parent(); + } +} + +void ConfigMainWindow::showSingleView(void) +{ + menuView->hide(); + menuList->setRootMenu(0); + configList->mode = singleMode; + if (configList->rootEntry == &rootmenu) + configList->updateListAll(); + else + configList->setRootMenu(&rootmenu); + configList->setAllOpen(TRUE); + configList->setFocus(); +} + +void ConfigMainWindow::showSplitView(void) +{ + configList->mode = symbolMode; + if (configList->rootEntry == &rootmenu) + configList->updateListAll(); + else + configList->setRootMenu(&rootmenu); + configList->setAllOpen(TRUE); + configApp->processEvents(); + menuList->mode = menuMode; + menuList->setRootMenu(&rootmenu); + menuList->setAllOpen(TRUE); + menuView->show(); + menuList->setFocus(); +} + +void ConfigMainWindow::showFullView(void) +{ + menuView->hide(); + menuList->setRootMenu(0); + configList->mode = fullMode; + if (configList->rootEntry == &rootmenu) + configList->updateListAll(); + else + configList->setRootMenu(&rootmenu); + configList->setAllOpen(FALSE); + configList->setFocus(); +} + +/* + * ask for saving configuration before quitting + * TODO ask only when something changed + */ +void ConfigMainWindow::closeEvent(QCloseEvent* e) +{ + if (!conf_get_changed()) { + e->accept(); + return; + } + QMessageBox mb("qconf", _("Save configuration?"), QMessageBox::Warning, + QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, QMessageBox::Cancel | QMessageBox::Escape); + mb.setButtonText(QMessageBox::Yes, _("&Save Changes")); + mb.setButtonText(QMessageBox::No, _("&Discard Changes")); + mb.setButtonText(QMessageBox::Cancel, _("Cancel Exit")); + switch (mb.exec()) { + case QMessageBox::Yes: + conf_write(NULL); + conf_write_autoconf(); + case QMessageBox::No: + e->accept(); + break; + case QMessageBox::Cancel: + e->ignore(); + break; + } +} + +void ConfigMainWindow::showIntro(void) +{ + static const QString str = _("Welcome to the qconf graphical configuration tool for buildrom.\n\n" + "For each option, a blank box indicates the feature is disabled, a check\n" + "indicates it is enabled, and a dot indicates that it is to be compiled\n" + "as a module. Clicking on the box will cycle through the three states.\n\n" + "If you do not see an option (e.g., a device driver) that you believe\n" + "should be present, try turning on Show All Options under the Options menu.\n" + "Although there is no cross reference yet to help you figure out what other\n" + "options must be enabled to support the option you are interested in, you can\n" + "still view the help of a grayed-out option.\n\n" + "Toggling Show Debug Info under the Options menu will show the dependencies,\n" + "which you can then match by examining other options.\n\n"); + + QMessageBox::information(this, "qconf", str); +} + +void ConfigMainWindow::showAbout(void) +{ + static const QString str = _("qconf is Copyright (C) 2002 Roman Zippel <zippel at linux-m68k.org>.\n\n" + "Bug reports and feature request can also be entered at http://bugzilla.kernel.org/\n"); + + QMessageBox::information(this, "qconf", str); +} + +void ConfigMainWindow::saveSettings(void) +{ + configSettings->writeEntry("/window x", pos().x()); + configSettings->writeEntry("/window y", pos().y()); + configSettings->writeEntry("/window width", size().width()); + configSettings->writeEntry("/window height", size().height()); + + QString entry; + switch(configList->mode) { + case singleMode : + entry = "single"; + break; + + case symbolMode : + entry = "split"; + break; + + case fullMode : + entry = "full"; + break; + } + configSettings->writeEntry("/listMode", entry); + + configSettings->writeSizes("/split1", split1->sizes()); + configSettings->writeSizes("/split2", split2->sizes()); +} + +void ConfigMainWindow::conf_changed(void) +{ + if (saveAction) + saveAction->setEnabled(conf_get_changed()); +} + +void fixup_rootmenu(struct menu *menu) +{ + struct menu *child; + static int menu_cnt = 0; + + menu->flags |= MENU_ROOT; + for (child = menu->list; child; child = child->next) { + if (child->prompt && child->prompt->type == P_MENU) { + menu_cnt++; + fixup_rootmenu(child); + menu_cnt--; + } else if (!menu_cnt) + fixup_rootmenu(child); + } +} + +static const char *progname; + +static void usage(void) +{ + printf(_("%s <config>\n"), progname); + exit(0); +} + +int main(int ac, char** av) +{ + ConfigMainWindow* v; + const char *name; + + bindtextdomain(PACKAGE, LOCALEDIR); + textdomain(PACKAGE); + +#ifndef LKC_DIRECT_LINK + kconfig_load(); +#endif + + progname = av[0]; + configApp = new QApplication(ac, av); + if (ac > 1 && av[1][0] == '-') { + switch (av[1][1]) { + case 'h': + case '?': + usage(); + } + name = av[2]; + } else + name = av[1]; + if (!name) + usage(); + + conf_parse(name); + fixup_rootmenu(&rootmenu); + conf_read(NULL); + //zconfdump(stdout); + + configSettings = new ConfigSettings(); + configSettings->beginGroup("/kconfig/qconf"); + v = new ConfigMainWindow(); + + //zconfdump(stdout); + configApp->setMainWidget(v); + configApp->connect(configApp, SIGNAL(lastWindowClosed()), SLOT(quit())); + configApp->connect(configApp, SIGNAL(aboutToQuit()), v, SLOT(saveSettings())); + v->show(); + configApp->exec(); + + configSettings->endGroup(); + delete configSettings; + + return 0; +} Added: buildrom-devel/scripts/kconfig/qconf.h =================================================================== --- buildrom-devel/scripts/kconfig/qconf.h (rev 0) +++ buildrom-devel/scripts/kconfig/qconf.h 2008-07-02 19:45:34 UTC (rev 210) @@ -0,0 +1,334 @@ +/* + * Copyright (C) 2002 Roman Zippel <zippel at linux-m68k.org> + * Released under the terms of the GNU GPL v2.0. + */ + +#include <qlistview.h> +#if QT_VERSION >= 300 +#include <qsettings.h> +#else +class QSettings { +public: + void beginGroup(const QString& group) { } + void endGroup(void) { } + bool readBoolEntry(const QString& key, bool def = FALSE, bool* ok = 0) const + { if (ok) *ok = FALSE; return def; } + int readNumEntry(const QString& key, int def = 0, bool* ok = 0) const + { if (ok) *ok = FALSE; return def; } + QString readEntry(const QString& key, const QString& def = QString::null, bool* ok = 0) const + { if (ok) *ok = FALSE; return def; } + QStringList readListEntry(const QString& key, bool* ok = 0) const + { if (ok) *ok = FALSE; return QStringList(); } + template <class t> + bool writeEntry(const QString& key, t value) + { return TRUE; } +}; +#endif + +class ConfigView; +class ConfigList; +class ConfigItem; +class ConfigLineEdit; +class ConfigMainWindow; + + +class ConfigSettings : public QSettings { +public: + QValueList<int> readSizes(const QString& key, bool *ok); + bool writeSizes(const QString& key, const QValueList<int>& value); +}; + +enum colIdx { + promptColIdx, nameColIdx, noColIdx, modColIdx, yesColIdx, dataColIdx, colNr +}; +enum listMode { + singleMode, menuMode, symbolMode, fullMode, listMode +}; + +class ConfigList : public QListView { + Q_OBJECT + typedef class QListView Parent; +public: + ConfigList(ConfigView* p, const char *name = 0); + void reinit(void); + ConfigView* parent(void) const + { + return (ConfigView*)Parent::parent(); + } + ConfigItem* findConfigItem(struct menu *); + +protected: + void keyPressEvent(QKeyEvent *e); + void contentsMousePressEvent(QMouseEvent *e); + void contentsMouseReleaseEvent(QMouseEvent *e); + void contentsMouseMoveEvent(QMouseEvent *e); + void contentsMouseDoubleClickEvent(QMouseEvent *e); + void focusInEvent(QFocusEvent *e); + void contextMenuEvent(QContextMenuEvent *e); + +public slots: + void setRootMenu(struct menu *menu); + + void updateList(ConfigItem *item); + void setValue(ConfigItem* item, tristate val); + void changeValue(ConfigItem* item); + void updateSelection(void); + void saveSettings(void); +signals: + void menuChanged(struct menu *menu); + void menuSelected(struct menu *menu); + void parentSelected(void); + void gotFocus(struct menu *); + +public: + void updateListAll(void) + { + updateAll = true; + updateList(NULL); + updateAll = false; + } + ConfigList* listView() + { + return this; + } + ConfigItem* firstChild() const + { + return (ConfigItem *)Parent::firstChild(); + } + int mapIdx(colIdx idx) + { + return colMap[idx]; + } + void addColumn(colIdx idx, const QString& label) + { + colMap[idx] = Parent::addColumn(label); + colRevMap[colMap[idx]] = idx; + } + void removeColumn(colIdx idx) + { + int col = colMap[idx]; + if (col >= 0) { + Parent::removeColumn(col); + colRevMap[col] = colMap[idx] = -1; + } + } + void setAllOpen(bool open); + void setParentMenu(void); + + template <class P> + void updateMenuList(P*, struct menu*); + + bool updateAll; + + QPixmap symbolYesPix, symbolModPix, symbolNoPix; + QPixmap choiceYesPix, choiceNoPix; + QPixmap menuPix, menuInvPix, menuBackPix, voidPix; + + bool showAll, showName, showRange, showData; + enum listMode mode; + struct menu *rootEntry; + QColorGroup disabledColorGroup; + QColorGroup inactivedColorGroup; + QPopupMenu* headerPopup; + +private: + int colMap[colNr]; + int colRevMap[colNr]; +}; + +class ConfigItem : public QListViewItem { + typedef class QListViewItem Parent; +public: + ConfigItem(QListView *parent, ConfigItem *after, struct menu *m, bool v) + : Parent(parent, after), menu(m), visible(v), goParent(false) + { + init(); + } + ConfigItem(ConfigItem *parent, ConfigItem *after, struct menu *m, bool v) + : Parent(parent, after), menu(m), visible(v), goParent(false) + { + init(); + } + ConfigItem(QListView *parent, ConfigItem *after, bool v) + : Parent(parent, after), menu(0), visible(v), goParent(true) + { + init(); + } + ~ConfigItem(void); + void init(void); +#if QT_VERSION >= 300 + void okRename(int col); +#endif + void updateMenu(void); + void testUpdateMenu(bool v); + ConfigList* listView() const + { + return (ConfigList*)Parent::listView(); + } + ConfigItem* firstChild() const + { + return (ConfigItem *)Parent::firstChild(); + } + ConfigItem* nextSibling() const + { + return (ConfigItem *)Parent::nextSibling(); + } + void setText(colIdx idx, const QString& text) + { + Parent::setText(listView()->mapIdx(idx), text); + } + QString text(colIdx idx) const + { + return Parent::text(listView()->mapIdx(idx)); + } + void setPixmap(colIdx idx, const QPixmap& pm) + { + Parent::setPixmap(listView()->mapIdx(idx), pm); + } + const QPixmap* pixmap(colIdx idx) const + { + return Parent::pixmap(listView()->mapIdx(idx)); + } + void paintCell(QPainter* p, const QColorGroup& cg, int column, int width, int align); + + ConfigItem* nextItem; + struct menu *menu; + bool visible; + bool goParent; +}; + +class ConfigLineEdit : public QLineEdit { + Q_OBJECT + typedef class QLineEdit Parent; +public: + ConfigLineEdit(ConfigView* parent); + ConfigView* parent(void) const + { + return (ConfigView*)Parent::parent(); + } + void show(ConfigItem *i); + void keyPressEvent(QKeyEvent *e); + +public: + ConfigItem *item; +}; + +class ConfigView : public QVBox { + Q_OBJECT + typedef class QVBox Parent; +public: + ConfigView(QWidget* parent, const char *name = 0); + ~ConfigView(void); + static void updateList(ConfigItem* item); + static void updateListAll(void); + + bool showAll(void) const { return list->showAll; } + bool showName(void) const { return list->showName; } + bool showRange(void) const { return list->showRange; } + bool showData(void) const { return list->showData; } +public slots: + void setShowAll(bool); + void setShowName(bool); + void setShowRange(bool); + void setShowData(bool); +signals: + void showAllChanged(bool); + void showNameChanged(bool); + void showRangeChanged(bool); + void showDataChanged(bool); +public: + ConfigList* list; + ConfigLineEdit* lineEdit; + + static ConfigView* viewList; + ConfigView* nextView; +}; + +class ConfigInfoView : public QTextBrowser { + Q_OBJECT + typedef class QTextBrowser Parent; +public: + ConfigInfoView(QWidget* parent, const char *name = 0); + bool showDebug(void) const { return _showDebug; } + +public slots: + void setInfo(struct menu *menu); + void saveSettings(void); + void setSource(const QString& name); + void setShowDebug(bool); + +signals: + void showDebugChanged(bool); + void menuSelected(struct menu *); + +protected: + void symbolInfo(void); + void menuInfo(void); + QString debug_info(struct symbol *sym); + static QString print_filter(const QString &str); + static void expr_print_help(void *data, struct symbol *sym, const char *str); + QPopupMenu* createPopupMenu(const QPoint& pos); + void contentsContextMenuEvent(QContextMenuEvent *e); + + struct symbol *sym; + struct menu *menu; + bool _showDebug; +}; + +class ConfigSearchWindow : public QDialog { + Q_OBJECT + typedef class QDialog Parent; +public: + ConfigSearchWindow(ConfigMainWindow* parent, const char *name = 0); + +public slots: + void saveSettings(void); + void search(void); + +protected: + QLineEdit* editField; + QPushButton* searchButton; + QSplitter* split; + ConfigView* list; + ConfigInfoView* info; + + struct symbol **result; +}; + +class ConfigMainWindow : public QMainWindow { + Q_OBJECT + + static QAction *saveAction; + static void conf_changed(void); +public: + ConfigMainWindow(void); +public slots: + void changeMenu(struct menu *); + void setMenuLink(struct menu *); + void listFocusChanged(void); + void goBack(void); + void loadConfig(void); + void saveConfig(void); + void saveConfigAs(void); + void searchConfig(void); + void showSingleView(void); + void showSplitView(void); + void showFullView(void); + void showIntro(void); + void showAbout(void); + void saveSettings(void); + +protected: + void closeEvent(QCloseEvent *e); + + ConfigSearchWindow *searchWindow; + ConfigView *menuView; + ConfigList *menuList; + ConfigView *configView; + ConfigList *configList; + ConfigInfoView *helpText; + QToolBar *toolBar; + QAction *backAction; + QSplitter* split1; + QSplitter* split2; +}; Modified: buildrom-devel/scripts/kconfig/symbol.c =================================================================== --- buildrom-devel/scripts/kconfig/symbol.c 2008-07-01 21:13:46 UTC (rev 209) +++ buildrom-devel/scripts/kconfig/symbol.c 2008-07-02 19:45:34 UTC (rev 210) @@ -15,25 +15,27 @@ struct symbol symbol_yes = { .name = "y", .curr = { "y", yes }, - .flags = SYMBOL_YES|SYMBOL_VALID, + .flags = SYMBOL_CONST|SYMBOL_VALID, }, symbol_mod = { .name = "m", .curr = { "m", mod }, - .flags = SYMBOL_MOD|SYMBOL_VALID, + .flags = SYMBOL_CONST|SYMBOL_VALID, }, symbol_no = { .name = "n", .curr = { "n", no }, - .flags = SYMBOL_NO|SYMBOL_VALID, + .flags = SYMBOL_CONST|SYMBOL_VALID, }, symbol_empty = { .name = "", .curr = { "", no }, .flags = SYMBOL_VALID, }; -int sym_change_count; +struct symbol *sym_defconfig_list; struct symbol *modules_sym; tristate modules_val; +struct expr *sym_env_list; + void sym_add_default(struct symbol *sym, const char *def) { struct property *prop = prop_alloc(P_DEFAULT, sym); @@ -45,7 +47,6 @@ { struct symbol *sym; struct utsname uts; - char *p; static bool inited = false; if (inited) @@ -54,20 +55,6 @@ uname(&uts); - sym = sym_lookup("ARCH", 0); - sym->type = S_STRING; - sym->flags |= SYMBOL_AUTO; - p = getenv("ARCH"); - if (p) - sym_add_default(sym, p); - - sym = sym_lookup("KERNELVERSION", 0); - sym->type = S_STRING; - sym->flags |= SYMBOL_AUTO; - p = getenv("KERNELVERSION"); - if (p) - sym_add_default(sym, p); - sym = sym_lookup("UNAME_RELEASE", 0); sym->type = S_STRING; sym->flags |= SYMBOL_AUTO; @@ -117,6 +104,15 @@ return NULL; } +struct property *sym_get_env_prop(struct symbol *sym) +{ + struct property *prop; + + for_all_properties(sym, prop, P_ENV) + return prop; + return NULL; +} + struct property *sym_get_default_prop(struct symbol *sym) { struct property *prop; @@ -199,7 +195,7 @@ tri = no; for_all_prompts(sym, prop) { prop->visible.tri = expr_calc_value(prop->visible.expr); - tri = E_OR(tri, prop->visible.tri); + tri = EXPR_OR(tri, prop->visible.tri); } if (tri == mod && (sym->type != S_TRISTATE || modules_val == no)) tri = yes; @@ -227,7 +223,7 @@ struct expr *e; /* is the user choice visible? */ - def_sym = sym->user.val; + def_sym = sym->def[S_DEF_USER].val; if (def_sym) { sym_calc_visibility(def_sym); if (def_sym->visible != no) @@ -247,8 +243,7 @@ /* just get the first visible value */ prop = sym_get_choice_prop(sym); - for (e = prop->expr; e; e = e->left.expr) { - def_sym = e->right.sym; + expr_list_for_each_sym(prop->expr, e, def_sym) { sym_calc_visibility(def_sym); if (def_sym->visible != no) return def_sym; @@ -303,22 +298,30 @@ if (sym_is_choice_value(sym) && sym->visible == yes) { prop = sym_get_choice_prop(sym); newval.tri = (prop_get_symbol(prop)->curr.val == sym) ? yes : no; - } else if (E_OR(sym->visible, sym->rev_dep.tri) != no) { - sym->flags |= SYMBOL_WRITE; - if (sym_has_value(sym)) - newval.tri = sym->user.tri; - else if (!sym_is_choice(sym)) { - prop = sym_get_default_prop(sym); - if (prop) - newval.tri = expr_calc_value(prop->expr); + } else { + if (sym->visible != no) { + /* if the symbol is visible use the user value + * if available, otherwise try the default value + */ + sym->flags |= SYMBOL_WRITE; + if (sym_has_value(sym)) { + newval.tri = EXPR_AND(sym->def[S_DEF_USER].tri, + sym->visible); + goto calc_newval; + } } - newval.tri = E_OR(E_AND(newval.tri, sym->visible), sym->rev_dep.tri); - } else if (!sym_is_choice(sym)) { - prop = sym_get_default_prop(sym); - if (prop) { + if (sym->rev_dep.tri != no) sym->flags |= SYMBOL_WRITE; - newval.tri = expr_calc_value(prop->expr); + if (!sym_is_choice(sym)) { + prop = sym_get_default_prop(sym); + if (prop) { + sym->flags |= SYMBOL_WRITE; + newval.tri = EXPR_AND(expr_calc_value(prop->expr), + prop->visible.tri); + } } + calc_newval: + newval.tri = EXPR_OR(newval.tri, sym->rev_dep.tri); } if (newval.tri == mod && sym_get_type(sym) == S_BOOLEAN) newval.tri = yes; @@ -329,7 +332,7 @@ if (sym->visible != no) { sym->flags |= SYMBOL_WRITE; if (sym_has_value(sym)) { - newval.val = sym->user.val; + newval.val = sym->def[S_DEF_USER].val; break; } } @@ -347,23 +350,31 @@ ; } + if (sym->flags & SYMBOL_AUTO) + sym->flags &= ~SYMBOL_WRITE; + sym->curr = newval; if (sym_is_choice(sym) && newval.tri == yes) sym->curr.val = sym_calc_choice(sym); sym_validate_range(sym); - if (memcmp(&oldval, &sym->curr, sizeof(oldval))) + if (memcmp(&oldval, &sym->curr, sizeof(oldval))) { sym_set_changed(sym); - if (modules_sym == sym) - modules_val = modules_sym->curr.tri; + if (modules_sym == sym) { + sym_set_all_changed(); + modules_val = modules_sym->curr.tri; + } + } if (sym_is_choice(sym)) { + struct symbol *choice_sym; int flags = sym->flags & (SYMBOL_CHANGED | SYMBOL_WRITE); + prop = sym_get_choice_prop(sym); - for (e = prop->expr; e; e = e->left.expr) { - e->right.sym->flags |= flags; + expr_list_for_each_sym(prop->expr, e, choice_sym) { + choice_sym->flags |= flags; if (flags & SYMBOL_CHANGED) - sym_set_changed(e->right.sym); + sym_set_changed(choice_sym); } } } @@ -375,7 +386,7 @@ for_all_symbols(i, sym) sym->flags &= ~SYMBOL_VALID; - sym_change_count++; + sym_add_change_count(1); if (modules_sym) sym_calc_value(modules_sym); } @@ -426,8 +437,8 @@ if (oldval != val && !sym_tristate_within_range(sym, val)) return false; - if (sym->flags & SYMBOL_NEW) { - sym->flags &= ~SYMBOL_NEW; + if (!(sym->flags & SYMBOL_DEF_USER)) { + sym->flags |= SYMBOL_DEF_USER; sym_set_changed(sym); } /* @@ -439,21 +450,18 @@ struct property *prop; struct expr *e; - cs->user.val = sym; - cs->flags &= ~SYMBOL_NEW; + cs->def[S_DEF_USER].val = sym; + cs->flags |= SYMBOL_DEF_USER; prop = sym_get_choice_prop(cs); for (e = prop->expr; e; e = e->left.expr) { if (e->right.sym->visible != no) - e->right.sym->flags &= ~SYMBOL_NEW; + e->right.sym->flags |= SYMBOL_DEF_USER; } } - sym->user.tri = val; - if (oldval != val) { + sym->def[S_DEF_USER].tri = val; + if (oldval != val) sym_clear_all_valid(); - if (sym == modules_sym) - sym_set_all_changed(); - } return true; } @@ -591,20 +599,20 @@ if (!sym_string_within_range(sym, newval)) return false; - if (sym->flags & SYMBOL_NEW) { - sym->flags &= ~SYMBOL_NEW; + if (!(sym->flags & SYMBOL_DEF_USER)) { + sym->flags |= SYMBOL_DEF_USER; sym_set_changed(sym); } - oldval = sym->user.val; + oldval = sym->def[S_DEF_USER].val; size = strlen(newval) + 1; if (sym->type == S_HEX && (newval[0] != '0' || (newval[1] != 'x' && newval[1] != 'X'))) { size += 2; - sym->user.val = val = malloc(size); + sym->def[S_DEF_USER].val = val = malloc(size); *val++ = '0'; *val++ = 'x'; } else if (!oldval || strcmp(oldval, newval)) - sym->user.val = val = malloc(size); + sym->def[S_DEF_USER].val = val = malloc(size); else return true; @@ -679,7 +687,6 @@ memset(symbol, 0, sizeof(*symbol)); symbol->name = new_name; symbol->type = S_UNKNOWN; - symbol->flags = SYMBOL_NEW; if (isconst) symbol->flags |= SYMBOL_CONST; @@ -787,13 +794,15 @@ return NULL; } +/* return NULL when dependencies are OK */ struct symbol *sym_check_deps(struct symbol *sym) { struct symbol *sym2; struct property *prop; if (sym->flags & SYMBOL_CHECK) { - printf("Warning! Found recursive dependency: %s", sym->name); + fprintf(stderr, "%s:%d:error: found recursive dependency: %s", + sym->prop->file->name, sym->prop->lineno, sym->name); return sym; } if (sym->flags & SYMBOL_CHECKED) @@ -817,13 +826,8 @@ goto out; } out: - if (sym2) { - printf(" %s", sym->name); - if (sym2 == sym) { - printf("\n"); - sym2 = NULL; - } - } + if (sym2) + fprintf(stderr, " -> %s%s", sym->name, sym2 == sym? "\n": ""); sym->flags &= ~SYMBOL_CHECK; return sym2; } @@ -853,7 +857,7 @@ struct symbol *prop_get_symbol(struct property *prop) { if (prop->expr && (prop->expr->type == E_SYMBOL || - prop->expr->type == E_CHOICE)) + prop->expr->type == E_LIST)) return prop->expr->left.sym; return NULL; } @@ -863,6 +867,8 @@ switch (type) { case P_PROMPT: return "prompt"; + case P_ENV: + return "env"; case P_COMMENT: return "comment"; case P_MENU: @@ -880,3 +886,32 @@ } return "unknown"; } + +void prop_add_env(const char *env) +{ + struct symbol *sym, *sym2; + struct property *prop; + char *p; + + sym = current_entry->sym; + sym->flags |= SYMBOL_AUTO; + for_all_properties(sym, prop, P_ENV) { + sym2 = prop_get_symbol(prop); + if (strcmp(sym2->name, env)) + menu_warn(current_entry, "redefining environment symbol from %s", + sym2->name); + return; + } + + prop = prop_alloc(P_ENV, sym); + prop->expr = expr_alloc_symbol(sym_lookup(env, 1)); + + sym_env_list = expr_alloc_one(E_LIST, sym_env_list); + sym_env_list->right.sym = sym; + + p = getenv(env); + if (p) + sym_add_default(sym, p); + else + menu_warn(current_entry, "environment variable %s undefined", env); +} Modified: buildrom-devel/scripts/kconfig/util.c =================================================================== --- buildrom-devel/scripts/kconfig/util.c 2008-07-01 21:13:46 UTC (rev 209) +++ buildrom-devel/scripts/kconfig/util.c 2008-07-02 19:45:34 UTC (rev 210) @@ -29,6 +29,8 @@ /* write a dependency file as used by kbuild to track dependencies */ int file_write_dep(const char *name) { + struct symbol *sym, *env_sym; + struct expr *e; struct file *file; FILE *out; @@ -44,7 +46,26 @@ else fprintf(out, "\t%s\n", file->name); } - fprintf(out, "\n.config include/autoconf.h: $(deps_config)\n\n$(deps_config):\n"); + fprintf(out, "\nbuild/auto.conf: \\\n" + "\t$(deps_config)\n\n"); + + expr_list_for_each_sym(sym_env_list, e, sym) { + struct property *prop; + const char *value; + + prop = sym_get_env_prop(sym); + env_sym = prop_get_symbol(prop); + if (!env_sym) + continue; + value = getenv(env_sym->name); + if (!value) + value = ""; + fprintf(out, "ifneq \"$(%s)\" \"%s\"\n", env_sym->name, value); + fprintf(out, "build/auto.conf: FORCE\n"); + fprintf(out, "endif\n"); + } + + fprintf(out, "\n$(deps_config): ;\n"); fclose(out); rename("..config.tmp", name); return 0; @@ -82,12 +103,15 @@ /* Append to growable string */ void str_append(struct gstr *gs, const char *s) { - size_t l = strlen(gs->s) + strlen(s) + 1; - if (l > gs->len) { - gs->s = realloc(gs->s, l); - gs->len = l; + size_t l; + if (s) { + l = strlen(gs->s) + strlen(s) + 1; + if (l > gs->len) { + gs->s = realloc(gs->s, l); + gs->len = l; + } + strcat(gs->s, s); } - strcat(gs->s, s); } /* Append printf formatted string to growable string */ Modified: buildrom-devel/scripts/kconfig/zconf.gperf =================================================================== --- buildrom-devel/scripts/kconfig/zconf.gperf 2008-07-01 21:13:46 UTC (rev 209) +++ buildrom-devel/scripts/kconfig/zconf.gperf 2008-07-02 19:45:34 UTC (rev 210) @@ -23,7 +23,6 @@ if, T_IF, TF_COMMAND|TF_PARAM endif, T_ENDIF, TF_COMMAND depends, T_DEPENDS, TF_COMMAND -requires, T_REQUIRES, TF_COMMAND optional, T_OPTIONAL, TF_COMMAND default, T_DEFAULT, TF_COMMAND, S_UNKNOWN prompt, T_PROMPT, TF_COMMAND @@ -32,12 +31,14 @@ bool, T_TYPE, TF_COMMAND, S_BOOLEAN boolean, T_TYPE, TF_COMMAND, S_BOOLEAN def_bool, T_DEFAULT, TF_COMMAND, S_BOOLEAN -def_boolean, T_DEFAULT, TF_COMMAND, S_BOOLEAN int, T_TYPE, TF_COMMAND, S_INT hex, T_TYPE, TF_COMMAND, S_HEX string, T_TYPE, TF_COMMAND, S_STRING select, T_SELECT, TF_COMMAND -enable, T_SELECT, TF_COMMAND range, T_RANGE, TF_COMMAND +option, T_OPTION, TF_COMMAND on, T_ON, TF_PARAM +modules, T_OPT_MODULES, TF_OPTION +defconfig_list, T_OPT_DEFCONFIG_LIST,TF_OPTION +env, T_OPT_ENV, TF_OPTION %% Deleted: buildrom-devel/scripts/kconfig/zconf.hash.c =================================================================== --- buildrom-devel/scripts/kconfig/zconf.hash.c 2008-07-01 21:13:46 UTC (rev 209) +++ buildrom-devel/scripts/kconfig/zconf.hash.c 2008-07-02 19:45:34 UTC (rev 210) @@ -1,231 +0,0 @@ -/* ANSI-C code produced by gperf version 3.0.1 */ -/* Command-line: gperf */ -/* Computed positions: -k'1,3' */ - -#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ - && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ - && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ - && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \ - && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \ - && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ - && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \ - && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \ - && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \ - && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \ - && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \ - && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \ - && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \ - && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \ - && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \ - && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \ - && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \ - && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \ - && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \ - && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \ - && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \ - && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \ - && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)) -/* The character set is not based on ISO-646. */ -#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf at gnu.org>." -#endif - -struct kconf_id; -/* maximum key range = 45, duplicates = 0 */ - -#ifdef __GNUC__ -__inline -#else -#ifdef __cplusplus -inline -#endif -#endif -static unsigned int -kconf_id_hash (register const char *str, register unsigned int len) -{ - static unsigned char asso_values[] = - { - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 25, 10, 15, - 0, 0, 5, 47, 0, 0, 47, 47, 0, 10, - 0, 20, 20, 20, 5, 0, 0, 20, 47, 47, - 20, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47 - }; - register int hval = len; - - switch (hval) - { - default: - hval += asso_values[(unsigned char)str[2]]; - /*FALLTHROUGH*/ - case 2: - case 1: - hval += asso_values[(unsigned char)str[0]]; - break; - } - return hval; -} - -struct kconf_id_strings_t - { - char kconf_id_strings_str2[sizeof("if")]; - char kconf_id_strings_str3[sizeof("int")]; - char kconf_id_strings_str4[sizeof("help")]; - char kconf_id_strings_str5[sizeof("endif")]; - char kconf_id_strings_str6[sizeof("select")]; - char kconf_id_strings_str7[sizeof("endmenu")]; - char kconf_id_strings_str8[sizeof("tristate")]; - char kconf_id_strings_str9[sizeof("endchoice")]; - char kconf_id_strings_str10[sizeof("range")]; - char kconf_id_strings_str11[sizeof("string")]; - char kconf_id_strings_str12[sizeof("default")]; - char kconf_id_strings_str13[sizeof("def_bool")]; - char kconf_id_strings_str14[sizeof("menu")]; - char kconf_id_strings_str16[sizeof("def_boolean")]; - char kconf_id_strings_str17[sizeof("def_tristate")]; - char kconf_id_strings_str18[sizeof("mainmenu")]; - char kconf_id_strings_str20[sizeof("menuconfig")]; - char kconf_id_strings_str21[sizeof("config")]; - char kconf_id_strings_str22[sizeof("on")]; - char kconf_id_strings_str23[sizeof("hex")]; - char kconf_id_strings_str26[sizeof("source")]; - char kconf_id_strings_str27[sizeof("depends")]; - char kconf_id_strings_str28[sizeof("optional")]; - char kconf_id_strings_str31[sizeof("enable")]; - char kconf_id_strings_str32[sizeof("comment")]; - char kconf_id_strings_str33[sizeof("requires")]; - char kconf_id_strings_str34[sizeof("bool")]; - char kconf_id_strings_str37[sizeof("boolean")]; - char kconf_id_strings_str41[sizeof("choice")]; - char kconf_id_strings_str46[sizeof("prompt")]; - }; -static struct kconf_id_strings_t kconf_id_strings_contents = - { - "if", - "int", - "help", - "endif", - "select", - "endmenu", - "tristate", - "endchoice", - "range", - "string", - "default", - "def_bool", - "menu", - "def_boolean", - "def_tristate", - "mainmenu", - "menuconfig", - "config", - "on", - "hex", - "source", - "depends", - "optional", - "enable", - "comment", - "requires", - "bool", - "boolean", - "choice", - "prompt" - }; -#define kconf_id_strings ((const char *) &kconf_id_strings_contents) -#ifdef __GNUC__ -__inline -#endif -struct kconf_id * -kconf_id_lookup (register const char *str, register unsigned int len) -{ - enum - { - TOTAL_KEYWORDS = 30, - MIN_WORD_LENGTH = 2, - MAX_WORD_LENGTH = 12, - MIN_HASH_VALUE = 2, - MAX_HASH_VALUE = 46 - }; - - static struct kconf_id wordlist[] = - { - {-1}, {-1}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str2, T_IF, TF_COMMAND|TF_PARAM}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str3, T_TYPE, TF_COMMAND, S_INT}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str4, T_HELP, TF_COMMAND}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str5, T_ENDIF, TF_COMMAND}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str6, T_SELECT, TF_COMMAND}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str7, T_ENDMENU, TF_COMMAND}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str8, T_TYPE, TF_COMMAND, S_TRISTATE}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str9, T_ENDCHOICE, TF_COMMAND}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str10, T_RANGE, TF_COMMAND}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str11, T_TYPE, TF_COMMAND, S_STRING}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str12, T_DEFAULT, TF_COMMAND, S_UNKNOWN}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str13, T_DEFAULT, TF_COMMAND, S_BOOLEAN}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str14, T_MENU, TF_COMMAND}, - {-1}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str16, T_DEFAULT, TF_COMMAND, S_BOOLEAN}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str17, T_DEFAULT, TF_COMMAND, S_TRISTATE}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str18, T_MAINMENU, TF_COMMAND}, - {-1}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str20, T_MENUCONFIG, TF_COMMAND}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str21, T_CONFIG, TF_COMMAND}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str22, T_ON, TF_PARAM}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str23, T_TYPE, TF_COMMAND, S_HEX}, - {-1}, {-1}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str26, T_SOURCE, TF_COMMAND}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str27, T_DEPENDS, TF_COMMAND}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str28, T_OPTIONAL, TF_COMMAND}, - {-1}, {-1}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str31, T_SELECT, TF_COMMAND}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str32, T_COMMENT, TF_COMMAND}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str33, T_REQUIRES, TF_COMMAND}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str34, T_TYPE, TF_COMMAND, S_BOOLEAN}, - {-1}, {-1}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str37, T_TYPE, TF_COMMAND, S_BOOLEAN}, - {-1}, {-1}, {-1}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str41, T_CHOICE, TF_COMMAND}, - {-1}, {-1}, {-1}, {-1}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str46, T_PROMPT, TF_COMMAND} - }; - - if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) - { - register int key = kconf_id_hash (str, len); - - if (key <= MAX_HASH_VALUE && key >= 0) - { - register int o = wordlist[key].name; - if (o >= 0) - { - register const char *s = o + kconf_id_strings; - - if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0') - return &wordlist[key]; - } - } - } - return 0; -} - Modified: buildrom-devel/scripts/kconfig/zconf.hash.c_shipped =================================================================== --- buildrom-devel/scripts/kconfig/zconf.hash.c_shipped 2008-07-01 21:13:46 UTC (rev 209) +++ buildrom-devel/scripts/kconfig/zconf.hash.c_shipped 2008-07-02 19:45:34 UTC (rev 210) @@ -1,4 +1,4 @@ -/* ANSI-C code produced by gperf version 3.0.1 */ +/* ANSI-C code produced by gperf version 3.0.3 */ /* Command-line: gperf */ /* Computed positions: -k'1,3' */ @@ -30,7 +30,7 @@ #endif struct kconf_id; -/* maximum key range = 45, duplicates = 0 */ +/* maximum key range = 47, duplicates = 0 */ #ifdef __GNUC__ __inline @@ -44,32 +44,32 @@ { static unsigned char asso_values[] = { - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 25, 10, 15, - 0, 0, 5, 47, 0, 0, 47, 47, 0, 10, - 0, 20, 20, 20, 5, 0, 0, 20, 47, 47, - 20, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47 + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 11, 5, + 0, 0, 5, 49, 5, 20, 49, 49, 5, 20, + 5, 0, 30, 49, 0, 15, 0, 10, 0, 49, + 25, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49 }; register int hval = len; @@ -88,126 +88,132 @@ struct kconf_id_strings_t { - char kconf_id_strings_str2[sizeof("if")]; - char kconf_id_strings_str3[sizeof("int")]; - char kconf_id_strings_str4[sizeof("help")]; + char kconf_id_strings_str2[sizeof("on")]; + char kconf_id_strings_str3[sizeof("env")]; char kconf_id_strings_str5[sizeof("endif")]; - char kconf_id_strings_str6[sizeof("select")]; + char kconf_id_strings_str6[sizeof("option")]; char kconf_id_strings_str7[sizeof("endmenu")]; - char kconf_id_strings_str8[sizeof("tristate")]; + char kconf_id_strings_str8[sizeof("optional")]; char kconf_id_strings_str9[sizeof("endchoice")]; char kconf_id_strings_str10[sizeof("range")]; - char kconf_id_strings_str11[sizeof("string")]; + char kconf_id_strings_str11[sizeof("choice")]; char kconf_id_strings_str12[sizeof("default")]; char kconf_id_strings_str13[sizeof("def_bool")]; - char kconf_id_strings_str14[sizeof("menu")]; - char kconf_id_strings_str16[sizeof("def_boolean")]; + char kconf_id_strings_str14[sizeof("help")]; + char kconf_id_strings_str15[sizeof("bool")]; + char kconf_id_strings_str16[sizeof("config")]; char kconf_id_strings_str17[sizeof("def_tristate")]; - char kconf_id_strings_str18[sizeof("mainmenu")]; - char kconf_id_strings_str20[sizeof("menuconfig")]; - char kconf_id_strings_str21[sizeof("config")]; - char kconf_id_strings_str22[sizeof("on")]; - char kconf_id_strings_str23[sizeof("hex")]; - char kconf_id_strings_str26[sizeof("source")]; - char kconf_id_strings_str27[sizeof("depends")]; - char kconf_id_strings_str28[sizeof("optional")]; - char kconf_id_strings_str31[sizeof("enable")]; + char kconf_id_strings_str18[sizeof("boolean")]; + char kconf_id_strings_str19[sizeof("defconfig_list")]; + char kconf_id_strings_str21[sizeof("string")]; + char kconf_id_strings_str22[sizeof("if")]; + char kconf_id_strings_str23[sizeof("int")]; + char kconf_id_strings_str26[sizeof("select")]; + char kconf_id_strings_str27[sizeof("modules")]; + char kconf_id_strings_str28[sizeof("tristate")]; + char kconf_id_strings_str29[sizeof("menu")]; + char kconf_id_strings_str31[sizeof("source")]; char kconf_id_strings_str32[sizeof("comment")]; - char kconf_id_strings_str33[sizeof("requires")]; - char kconf_id_strings_str34[sizeof("bool")]; - char kconf_id_strings_str37[sizeof("boolean")]; - char kconf_id_strings_str41[sizeof("choice")]; - char kconf_id_strings_str46[sizeof("prompt")]; + char kconf_id_strings_str33[sizeof("hex")]; + char kconf_id_strings_str35[sizeof("menuconfig")]; + char kconf_id_strings_str36[sizeof("prompt")]; + char kconf_id_strings_str37[sizeof("depends")]; + char kconf_id_strings_str48[sizeof("mainmenu")]; }; static struct kconf_id_strings_t kconf_id_strings_contents = { - "if", - "int", - "help", + "on", + "env", "endif", - "select", + "option", "endmenu", - "tristate", + "optional", "endchoice", "range", - "string", + "choice", "default", "def_bool", + "help", + "bool", + "config", + "def_tristate", + "boolean", + "defconfig_list", + "string", + "if", + "int", + "select", + "modules", + "tristate", "menu", - "def_boolean", - "def_tristate", - "mainmenu", + "source", + "comment", + "hex", "menuconfig", - "config", - "on", - "hex", - "source", + "prompt", "depends", - "optional", - "enable", - "comment", - "requires", - "bool", - "boolean", - "choice", - "prompt" + "mainmenu" }; #define kconf_id_strings ((const char *) &kconf_id_strings_contents) #ifdef __GNUC__ __inline +#ifdef __GNUC_STDC_INLINE__ +__attribute__ ((__gnu_inline__)) #endif +#endif struct kconf_id * kconf_id_lookup (register const char *str, register unsigned int len) { enum { - TOTAL_KEYWORDS = 30, + TOTAL_KEYWORDS = 31, MIN_WORD_LENGTH = 2, - MAX_WORD_LENGTH = 12, + MAX_WORD_LENGTH = 14, MIN_HASH_VALUE = 2, - MAX_HASH_VALUE = 46 + MAX_HASH_VALUE = 48 }; static struct kconf_id wordlist[] = { {-1}, {-1}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str2, T_IF, TF_COMMAND|TF_PARAM}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str3, T_TYPE, TF_COMMAND, S_INT}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str4, T_HELP, TF_COMMAND}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str2, T_ON, TF_PARAM}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str3, T_OPT_ENV, TF_OPTION}, + {-1}, {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str5, T_ENDIF, TF_COMMAND}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str6, T_SELECT, TF_COMMAND}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str6, T_OPTION, TF_COMMAND}, {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str7, T_ENDMENU, TF_COMMAND}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str8, T_TYPE, TF_COMMAND, S_TRISTATE}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str8, T_OPTIONAL, TF_COMMAND}, {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str9, T_ENDCHOICE, TF_COMMAND}, {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str10, T_RANGE, TF_COMMAND}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str11, T_TYPE, TF_COMMAND, S_STRING}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str11, T_CHOICE, TF_COMMAND}, {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str12, T_DEFAULT, TF_COMMAND, S_UNKNOWN}, {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str13, T_DEFAULT, TF_COMMAND, S_BOOLEAN}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str14, T_MENU, TF_COMMAND}, - {-1}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str16, T_DEFAULT, TF_COMMAND, S_BOOLEAN}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str14, T_HELP, TF_COMMAND}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str15, T_TYPE, TF_COMMAND, S_BOOLEAN}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str16, T_CONFIG, TF_COMMAND}, {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str17, T_DEFAULT, TF_COMMAND, S_TRISTATE}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str18, T_MAINMENU, TF_COMMAND}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str18, T_TYPE, TF_COMMAND, S_BOOLEAN}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str19, T_OPT_DEFCONFIG_LIST,TF_OPTION}, {-1}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str20, T_MENUCONFIG, TF_COMMAND}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str21, T_CONFIG, TF_COMMAND}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str22, T_ON, TF_PARAM}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str23, T_TYPE, TF_COMMAND, S_HEX}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str21, T_TYPE, TF_COMMAND, S_STRING}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str22, T_IF, TF_COMMAND|TF_PARAM}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str23, T_TYPE, TF_COMMAND, S_INT}, {-1}, {-1}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str26, T_SOURCE, TF_COMMAND}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str27, T_DEPENDS, TF_COMMAND}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str28, T_OPTIONAL, TF_COMMAND}, - {-1}, {-1}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str31, T_SELECT, TF_COMMAND}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str26, T_SELECT, TF_COMMAND}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str27, T_OPT_MODULES, TF_OPTION}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str28, T_TYPE, TF_COMMAND, S_TRISTATE}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str29, T_MENU, TF_COMMAND}, + {-1}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str31, T_SOURCE, TF_COMMAND}, {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str32, T_COMMENT, TF_COMMAND}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str33, T_REQUIRES, TF_COMMAND}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str34, T_TYPE, TF_COMMAND, S_BOOLEAN}, - {-1}, {-1}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str37, T_TYPE, TF_COMMAND, S_BOOLEAN}, - {-1}, {-1}, {-1}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str41, T_CHOICE, TF_COMMAND}, - {-1}, {-1}, {-1}, {-1}, - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str46, T_PROMPT, TF_COMMAND} + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str33, T_TYPE, TF_COMMAND, S_HEX}, + {-1}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str35, T_MENUCONFIG, TF_COMMAND}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str36, T_PROMPT, TF_COMMAND}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str37, T_DEPENDS, TF_COMMAND}, + {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, + {-1}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str48, T_MAINMENU, TF_COMMAND} }; if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) Modified: buildrom-devel/scripts/kconfig/zconf.l =================================================================== --- buildrom-devel/scripts/kconfig/zconf.l 2008-07-01 21:13:46 UTC (rev 209) +++ buildrom-devel/scripts/kconfig/zconf.l 2008-07-02 19:45:34 UTC (rev 210) @@ -217,6 +217,11 @@ append_string("\n", 1); } [^ \t\n].* { + while (yyleng) { + if ((yytext[yyleng-1] != ' ') && (yytext[yyleng-1] != '\t')) + break; + yyleng--; + } append_string(yytext, yyleng); if (!first_ts) first_ts = last_ts; @@ -265,7 +270,7 @@ FILE *f; f = fopen(name, "r"); - if (!f && name[0] != '/') { + if (!f && name != NULL && name[0] != '/') { env = getenv(SRCTREE); if (env) { sprintf(fullname, "%s/%s", env, name); Modified: buildrom-devel/scripts/kconfig/zconf.tab.c_shipped =================================================================== --- buildrom-devel/scripts/kconfig/zconf.tab.c_shipped 2008-07-01 21:13:46 UTC (rev 209) +++ buildrom-devel/scripts/kconfig/zconf.tab.c_shipped 2008-07-02 19:45:34 UTC (rev 210) @@ -1,8 +1,10 @@ -/* A Bison parser, made by GNU Bison 2.0. */ +/* A Bison parser, made by GNU Bison 2.3. */ -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +/* Skeleton implementation for Bison's Yacc-like parsers in C + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) @@ -15,17 +17,25 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. -/* Written by Richard Stallman by simplifying the original so called - ``semantic'' parser. */ + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. @@ -36,6 +46,9 @@ /* Identify Bison output. */ #define YYBISON 1 +/* Bison version. */ +#define YYBISON_VERSION "2.3" + /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -75,13 +88,13 @@ T_IF = 269, T_ENDIF = 270, T_DEPENDS = 271, - T_REQUIRES = 272, - T_OPTIONAL = 273, - T_PROMPT = 274, - T_TYPE = 275, - T_DEFAULT = 276, - T_SELECT = 277, - T_RANGE = 278, + T_OPTIONAL = 272, + T_PROMPT = 273, + T_TYPE = 274, + T_DEFAULT = 275, + T_SELECT = 276, + T_RANGE = 277, + T_OPTION = 278, T_ON = 279, T_WORD = 280, T_WORD_QUOTE = 281, @@ -95,6 +108,7 @@ T_NOT = 289 }; #endif +/* Tokens. */ #define T_MAINMENU 258 #define T_MENU 259 #define T_ENDMENU 260 @@ -109,13 +123,13 @@ #define T_IF 269 #define T_ENDIF 270 #define T_DEPENDS 271 -#define T_REQUIRES 272 -#define T_OPTIONAL 273 -#define T_PROMPT 274 -#define T_TYPE 275 -#define T_DEFAULT 276 -#define T_SELECT 277 -#define T_RANGE 278 +#define T_OPTIONAL 272 +#define T_PROMPT 273 +#define T_TYPE 274 +#define T_DEFAULT 275 +#define T_SELECT 276 +#define T_RANGE 277 +#define T_OPTION 278 #define T_ON 279 #define T_WORD 280 #define T_WORD_QUOTE 281 @@ -187,18 +201,25 @@ # define YYERROR_VERBOSE 0 #endif -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif -typedef union YYSTYPE { +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE + +{ char *string; struct file *file; struct symbol *symbol; struct expr *expr; struct menu *menu; struct kconf_id *id; -} YYSTYPE; -/* Line 190 of yacc.c. */ +} +/* Line 187 of yacc.c. */ + YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 @@ -209,52 +230,171 @@ /* Copy the second part of user declarations. */ -/* Line 213 of yacc.c. */ +/* Line 216 of yacc.c. */ -#if ! defined (yyoverflow) || YYERROR_VERBOSE +#ifdef short +# undef short +#endif -# ifndef YYFREE -# define YYFREE free +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; +#endif + +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#elif (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +typedef signed char yytype_int8; +#else +typedef short int yytype_int8; +#endif + +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif + +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned int # endif -# ifndef YYMALLOC -# define YYMALLOC malloc +#endif + +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + +#ifndef YY_ +# if YYENABLE_NLS +# if ENABLE_NLS +# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif # endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(e) ((void) (e)) +#else +# define YYUSE(e) /* empty */ +#endif + +/* Identity function, used to suppress warnings about constant conditions. */ +#ifndef lint +# define YYID(n) (n) +#else +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static int +YYID (int i) +#else +static int +YYID (i) + int i; +#endif +{ + return i; +} +#endif + +#if ! defined yyoverflow || YYERROR_VERBOSE + /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include <alloca.h> /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include <malloc.h> /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca # else # define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif # endif # endif # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif # else -# if defined (__STDC__) || defined (__cplusplus) +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined _STDLIB_H \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif # endif -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif # endif -#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ -#if (! defined (yyoverflow) \ - && (! defined (__cplusplus) \ - || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { - short int yyss; + yytype_int16 yyss; YYSTYPE yyvs; }; @@ -264,24 +404,24 @@ /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY -# if defined (__GNUC__) && 1 < __GNUC__ +# if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ - register YYSIZE_T yyi; \ + YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ - while (0) + while (YYID (0)) # endif # endif @@ -299,39 +439,33 @@ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ - while (0) + while (YYID (0)) #endif -#if defined (__STDC__) || defined (__cplusplus) - typedef signed char yysigned_char; -#else - typedef short int yysigned_char; -#endif - -/* YYFINAL -- State number of the termination state. */ +/* YYFINAL -- State number of the termination state. */ #define YYFINAL 3 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 264 +#define YYLAST 258 -/* YYNTOKENS -- Number of terminals. */ +/* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 35 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 42 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 104 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 175 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 45 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 108 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 178 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 289 -#define YYTRANSLATE(YYX) \ +#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const unsigned char yytranslate[] = +static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -367,102 +501,103 @@ #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ -static const unsigned short int yyprhs[] = +static const yytype_uint16 yyprhs[] = { 0, 0, 3, 5, 6, 9, 12, 15, 20, 23, 28, 33, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 67, 70, 74, 77, - 81, 84, 85, 88, 91, 94, 97, 100, 104, 109, - 114, 119, 125, 128, 131, 133, 137, 138, 141, 144, - 147, 150, 153, 158, 162, 165, 170, 171, 174, 178, - 180, 184, 185, 188, 191, 194, 198, 201, 203, 207, - 208, 211, 214, 217, 221, 225, 228, 231, 234, 235, - 238, 241, 244, 249, 253, 257, 258, 261, 263, 265, - 268, 271, 274, 276, 279, 280, 283, 285, 289, 293, - 297, 300, 304, 308, 310 + 81, 84, 85, 88, 91, 94, 97, 100, 103, 107, + 112, 117, 122, 128, 132, 133, 137, 138, 141, 144, + 147, 149, 153, 154, 157, 160, 163, 166, 169, 174, + 178, 181, 186, 187, 190, 194, 196, 200, 201, 204, + 207, 210, 214, 217, 219, 223, 224, 227, 230, 233, + 237, 241, 244, 247, 250, 251, 254, 257, 260, 265, + 266, 269, 271, 273, 276, 279, 282, 284, 287, 288, + 291, 293, 297, 301, 305, 308, 312, 316, 318 }; -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yysigned_char yyrhs[] = +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yytype_int8 yyrhs[] = { 36, 0, -1, 37, -1, -1, 37, 39, -1, 37, - 50, -1, 37, 61, -1, 37, 3, 71, 73, -1, - 37, 72, -1, 37, 25, 1, 30, -1, 37, 38, - 1, 30, -1, 37, 1, 30, -1, 16, -1, 19, - -1, 20, -1, 22, -1, 18, -1, 23, -1, 21, - -1, 30, -1, 56, -1, 65, -1, 42, -1, 44, - -1, 63, -1, 25, 1, 30, -1, 1, 30, -1, + 53, -1, 37, 64, -1, 37, 3, 74, 76, -1, + 37, 75, -1, 37, 25, 1, 30, -1, 37, 38, + 1, 30, -1, 37, 1, 30, -1, 16, -1, 18, + -1, 19, -1, 21, -1, 17, -1, 22, -1, 20, + -1, 30, -1, 59, -1, 68, -1, 42, -1, 44, + -1, 66, -1, 25, 1, 30, -1, 1, 30, -1, 10, 25, 30, -1, 41, 45, -1, 11, 25, 30, - -1, 43, 45, -1, -1, 45, 46, -1, 45, 69, - -1, 45, 67, -1, 45, 40, -1, 45, 30, -1, - 20, 70, 30, -1, 19, 71, 74, 30, -1, 21, - 75, 74, 30, -1, 22, 25, 74, 30, -1, 23, - 76, 76, 74, 30, -1, 7, 30, -1, 47, 51, - -1, 72, -1, 48, 53, 49, -1, -1, 51, 52, - -1, 51, 69, -1, 51, 67, -1, 51, 30, -1, - 51, 40, -1, 19, 71, 74, 30, -1, 20, 70, - 30, -1, 18, 30, -1, 21, 25, 74, 30, -1, - -1, 53, 39, -1, 14, 75, 73, -1, 72, -1, - 54, 57, 55, -1, -1, 57, 39, -1, 57, 61, - -1, 57, 50, -1, 4, 71, 30, -1, 58, 68, - -1, 72, -1, 59, 62, 60, -1, -1, 62, 39, - -1, 62, 61, -1, 62, 50, -1, 6, 71, 30, - -1, 9, 71, 30, -1, 64, 68, -1, 12, 30, - -1, 66, 13, -1, -1, 68, 69, -1, 68, 30, - -1, 68, 40, -1, 16, 24, 75, 30, -1, 16, - 75, 30, -1, 17, 75, 30, -1, -1, 71, 74, - -1, 25, -1, 26, -1, 5, 30, -1, 8, 30, - -1, 15, 30, -1, 30, -1, 73, 30, -1, -1, - 14, 75, -1, 76, -1, 76, 33, 76, -1, 76, - 27, 76, -1, 29, 75, 28, -1, 34, 75, -1, - 75, 31, 75, -1, 75, 32, 75, -1, 25, -1, - 26, -1 + -1, 43, 45, -1, -1, 45, 46, -1, 45, 47, + -1, 45, 72, -1, 45, 70, -1, 45, 40, -1, + 45, 30, -1, 19, 73, 30, -1, 18, 74, 77, + 30, -1, 20, 78, 77, 30, -1, 21, 25, 77, + 30, -1, 22, 79, 79, 77, 30, -1, 23, 48, + 30, -1, -1, 48, 25, 49, -1, -1, 33, 74, + -1, 7, 30, -1, 50, 54, -1, 75, -1, 51, + 56, 52, -1, -1, 54, 55, -1, 54, 72, -1, + 54, 70, -1, 54, 30, -1, 54, 40, -1, 18, + 74, 77, 30, -1, 19, 73, 30, -1, 17, 30, + -1, 20, 25, 77, 30, -1, -1, 56, 39, -1, + 14, 78, 76, -1, 75, -1, 57, 60, 58, -1, + -1, 60, 39, -1, 60, 64, -1, 60, 53, -1, + 4, 74, 30, -1, 61, 71, -1, 75, -1, 62, + 65, 63, -1, -1, 65, 39, -1, 65, 64, -1, + 65, 53, -1, 6, 74, 30, -1, 9, 74, 30, + -1, 67, 71, -1, 12, 30, -1, 69, 13, -1, + -1, 71, 72, -1, 71, 30, -1, 71, 40, -1, + 16, 24, 78, 30, -1, -1, 74, 77, -1, 25, + -1, 26, -1, 5, 30, -1, 8, 30, -1, 15, + 30, -1, 30, -1, 76, 30, -1, -1, 14, 78, + -1, 79, -1, 79, 33, 79, -1, 79, 27, 79, + -1, 29, 78, 28, -1, 34, 78, -1, 78, 31, + 78, -1, 78, 32, 78, -1, 25, -1, 26, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const unsigned short int yyrline[] = +static const yytype_uint16 yyrline[] = { - 0, 103, 103, 105, 107, 108, 109, 110, 111, 112, - 113, 117, 121, 121, 121, 121, 121, 121, 121, 125, - 126, 127, 128, 129, 130, 134, 135, 141, 149, 155, - 163, 173, 175, 176, 177, 178, 179, 182, 190, 196, - 206, 212, 220, 229, 234, 242, 245, 247, 248, 249, - 250, 251, 254, 260, 271, 277, 287, 289, 294, 302, - 310, 313, 315, 316, 317, 322, 329, 334, 342, 345, - 347, 348, 349, 352, 360, 367, 374, 380, 387, 389, - 390, 391, 394, 399, 404, 412, 414, 419, 420, 423, - 424, 425, 429, 430, 433, 434, 437, 438, 439, 440, - 441, 442, 443, 446, 447 + 0, 104, 104, 106, 108, 109, 110, 111, 112, 113, + 114, 118, 122, 122, 122, 122, 122, 122, 122, 126, + 127, 128, 129, 130, 131, 135, 136, 142, 150, 156, + 164, 174, 176, 177, 178, 179, 180, 181, 184, 192, + 198, 208, 214, 220, 223, 225, 236, 237, 242, 251, + 256, 264, 267, 269, 270, 271, 272, 273, 276, 282, + 293, 299, 309, 311, 316, 324, 332, 335, 337, 338, + 339, 344, 351, 356, 364, 367, 369, 370, 371, 374, + 382, 389, 396, 402, 409, 411, 412, 413, 416, 424, + 426, 431, 432, 435, 436, 437, 441, 442, 445, 446, + 449, 450, 451, 452, 453, 454, 455, 458, 459 }; #endif -#if YYDEBUG || YYERROR_VERBOSE -/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "T_MAINMENU", "T_MENU", "T_ENDMENU", "T_SOURCE", "T_CHOICE", "T_ENDCHOICE", "T_COMMENT", "T_CONFIG", "T_MENUCONFIG", "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS", - "T_REQUIRES", "T_OPTIONAL", "T_PROMPT", "T_TYPE", "T_DEFAULT", - "T_SELECT", "T_RANGE", "T_ON", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL", + "T_OPTIONAL", "T_PROMPT", "T_TYPE", "T_DEFAULT", "T_SELECT", "T_RANGE", + "T_OPTION", "T_ON", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL", "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_EOL", "T_OR", "T_AND", "T_EQUAL", "T_NOT", "$accept", "input", "stmt_list", "option_name", "common_stmt", "option_error", "config_entry_start", "config_stmt", "menuconfig_entry_start", "menuconfig_stmt", "config_option_list", - "config_option", "choice", "choice_entry", "choice_end", "choice_stmt", - "choice_option_list", "choice_option", "choice_block", "if_entry", - "if_end", "if_stmt", "if_block", "menu", "menu_entry", "menu_end", - "menu_stmt", "menu_block", "source_stmt", "comment", "comment_stmt", - "help_start", "help", "depends_list", "depends", "prompt_stmt_opt", - "prompt", "end", "nl", "if_expr", "expr", "symbol", 0 + "config_option", "symbol_option", "symbol_option_list", + "symbol_option_arg", "choice", "choice_entry", "choice_end", + "choice_stmt", "choice_option_list", "choice_option", "choice_block", + "if_entry", "if_end", "if_stmt", "if_block", "menu", "menu_entry", + "menu_end", "menu_stmt", "menu_block", "source_stmt", "comment", + "comment_stmt", "help_start", "help", "depends_list", "depends", + "prompt_stmt_opt", "prompt", "end", "nl", "if_expr", "expr", "symbol", 0 }; #endif # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ -static const unsigned short int yytoknum[] = +static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, @@ -472,214 +607,196 @@ # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const unsigned char yyr1[] = +static const yytype_uint8 yyr1[] = { 0, 35, 36, 37, 37, 37, 37, 37, 37, 37, 37, 37, 38, 38, 38, 38, 38, 38, 38, 39, 39, 39, 39, 39, 39, 40, 40, 41, 42, 43, - 44, 45, 45, 45, 45, 45, 45, 46, 46, 46, - 46, 46, 47, 48, 49, 50, 51, 51, 51, 51, - 51, 51, 52, 52, 52, 52, 53, 53, 54, 55, - 56, 57, 57, 57, 57, 58, 59, 60, 61, 62, - 62, 62, 62, 63, 64, 65, 66, 67, 68, 68, - 68, 68, 69, 69, 69, 70, 70, 71, 71, 72, - 72, 72, 73, 73, 74, 74, 75, 75, 75, 75, - 75, 75, 75, 76, 76 + 44, 45, 45, 45, 45, 45, 45, 45, 46, 46, + 46, 46, 46, 47, 48, 48, 49, 49, 50, 51, + 52, 53, 54, 54, 54, 54, 54, 54, 55, 55, + 55, 55, 56, 56, 57, 58, 59, 60, 60, 60, + 60, 61, 62, 63, 64, 65, 65, 65, 65, 66, + 67, 68, 69, 70, 71, 71, 71, 71, 72, 73, + 73, 74, 74, 75, 75, 75, 76, 76, 77, 77, + 78, 78, 78, 78, 78, 78, 78, 79, 79 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const unsigned char yyr2[] = +static const yytype_uint8 yyr2[] = { 0, 2, 1, 0, 2, 2, 2, 4, 2, 4, 4, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 2, 3, 2, 3, - 2, 0, 2, 2, 2, 2, 2, 3, 4, 4, - 4, 5, 2, 2, 1, 3, 0, 2, 2, 2, - 2, 2, 4, 3, 2, 4, 0, 2, 3, 1, - 3, 0, 2, 2, 2, 3, 2, 1, 3, 0, - 2, 2, 2, 3, 3, 2, 2, 2, 0, 2, - 2, 2, 4, 3, 3, 0, 2, 1, 1, 2, - 2, 2, 1, 2, 0, 2, 1, 3, 3, 3, - 2, 3, 3, 1, 1 + 2, 0, 2, 2, 2, 2, 2, 2, 3, 4, + 4, 4, 5, 3, 0, 3, 0, 2, 2, 2, + 1, 3, 0, 2, 2, 2, 2, 2, 4, 3, + 2, 4, 0, 2, 3, 1, 3, 0, 2, 2, + 2, 3, 2, 1, 3, 0, 2, 2, 2, 3, + 3, 2, 2, 2, 0, 2, 2, 2, 4, 0, + 2, 1, 1, 2, 2, 2, 1, 2, 0, 2, + 1, 3, 3, 3, 2, 3, 3, 1, 1 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ -static const unsigned char yydefact[] = +static const yytype_uint8 yydefact[] = { 3, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 16, 13, 14, 18, 15, 17, 0, 19, 0, 4, 31, 22, 31, - 23, 46, 56, 5, 61, 20, 78, 69, 6, 24, - 78, 21, 8, 11, 87, 88, 0, 0, 89, 0, - 42, 90, 0, 0, 0, 103, 104, 0, 0, 0, - 96, 91, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 92, 7, 65, 73, 74, 27, 29, 0, - 100, 0, 0, 58, 0, 0, 9, 10, 0, 0, - 0, 0, 0, 85, 0, 0, 0, 0, 36, 35, - 32, 0, 34, 33, 0, 0, 85, 0, 50, 51, - 47, 49, 48, 57, 45, 44, 62, 64, 60, 63, - 59, 80, 81, 79, 70, 72, 68, 71, 67, 93, - 99, 101, 102, 98, 97, 26, 76, 0, 0, 0, - 94, 0, 94, 94, 94, 0, 0, 77, 54, 94, - 0, 94, 0, 83, 84, 0, 0, 37, 86, 0, - 0, 94, 25, 0, 53, 0, 82, 95, 38, 39, - 40, 0, 52, 55, 41 + 23, 52, 62, 5, 67, 20, 84, 75, 6, 24, + 84, 21, 8, 11, 91, 92, 0, 0, 93, 0, + 48, 94, 0, 0, 0, 107, 108, 0, 0, 0, + 100, 95, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 96, 7, 71, 79, 80, 27, 29, 0, + 104, 0, 0, 64, 0, 0, 9, 10, 0, 0, + 0, 0, 89, 0, 0, 0, 44, 0, 37, 36, + 32, 33, 0, 35, 34, 0, 0, 89, 0, 56, + 57, 53, 55, 54, 63, 51, 50, 68, 70, 66, + 69, 65, 86, 87, 85, 76, 78, 74, 77, 73, + 97, 103, 105, 106, 102, 101, 26, 82, 0, 98, + 0, 98, 98, 98, 0, 0, 0, 83, 60, 98, + 0, 98, 0, 0, 0, 38, 90, 0, 0, 98, + 46, 43, 25, 0, 59, 0, 88, 99, 39, 40, + 41, 0, 0, 45, 58, 61, 42, 47 }; -/* YYDEFGOTO[NTERM-NUM]. */ -static const short int yydefgoto[] = +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = { -1, 1, 2, 25, 26, 99, 27, 28, 29, 30, - 64, 100, 31, 32, 114, 33, 66, 110, 67, 34, - 118, 35, 68, 36, 37, 126, 38, 70, 39, 40, - 41, 101, 102, 69, 103, 141, 142, 42, 73, 156, - 59, 60 + 64, 100, 101, 145, 173, 31, 32, 115, 33, 66, + 111, 67, 34, 119, 35, 68, 36, 37, 127, 38, + 70, 39, 40, 41, 102, 103, 69, 104, 140, 141, + 42, 73, 154, 59, 60 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -78 -static const short int yypact[] = +static const yytype_int16 yypact[] = { - -78, 2, 159, -78, -21, 0, 0, -12, 0, 1, - 4, 0, 27, 38, 60, 58, -78, -78, -78, -78, - -78, -78, -78, 100, -78, 104, -78, -78, -78, -78, + -78, 33, 130, -78, -28, 73, 73, 7, 73, 36, + 41, 73, 26, 52, -4, 58, -78, -78, -78, -78, + -78, -78, -78, 90, -78, 94, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, 86, 113, -78, 114, - -78, -78, 125, 127, 128, -78, -78, 60, 60, 210, - 65, -78, 141, 142, 39, 103, 182, 200, 6, 66, - 6, 131, -78, 146, -78, -78, -78, -78, -78, 196, - -78, 60, 60, 146, 40, 40, -78, -78, 155, 156, - -2, 60, 0, 0, 60, 105, 40, 194, -78, -78, - -78, 206, -78, -78, 183, 0, 0, 195, -78, -78, + -78, -78, -78, -78, -78, -78, 74, 85, -78, 96, + -78, -78, 131, 134, 147, -78, -78, -4, -4, 193, + -10, -78, 162, 164, 38, 102, 64, 148, 5, 192, + 5, 165, -78, 174, -78, -78, -78, -78, -78, 65, + -78, -4, -4, 174, 103, 103, -78, -78, 175, 185, + 197, 73, 73, -4, 194, 103, -78, 231, -78, -78, + -78, -78, 220, -78, -78, 204, 73, 73, 210, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, 197, -78, -78, -78, -78, -78, 60, 213, 216, - 212, 203, 212, 190, 212, 40, 208, -78, -78, 212, - 222, 212, 219, -78, -78, 60, 223, -78, -78, 224, - 225, 212, -78, 226, -78, 227, -78, 47, -78, -78, - -78, 228, -78, -78, -78 + -78, -78, 205, -78, -78, -78, -78, -78, -4, 222, + 208, 222, 195, 222, 103, 2, 209, -78, -78, 222, + 211, 222, 199, -4, 212, -78, -78, 213, 214, 222, + 207, -78, -78, 215, -78, 216, -78, 111, -78, -78, + -78, 217, 73, -78, -78, -78, -78, -78 }; /* YYPGOTO[NTERM-NUM]. */ -static const short int yypgoto[] = +static const yytype_int16 yypgoto[] = { - -78, -78, -78, -78, 164, -36, -78, -78, -78, -78, - 230, -78, -78, -78, -78, 29, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, 59, -78, -78, -78, - -78, -78, 198, 220, 24, 157, -5, 169, 202, 74, - -53, -77 + -78, -78, -78, -78, 121, -35, -78, -78, -78, -78, + 219, -78, -78, -78, -78, -78, -78, -78, -44, -78, + -78, -78, -78, -78, -78, -78, -78, -78, -78, -6, + -78, -78, -78, -78, -78, 183, 218, 21, 143, -5, + 146, 196, 69, -53, -77 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -76 -static const short int yytable[] = +#define YYTABLE_NINF -82 +static const yytype_int16 yytable[] = { - 46, 47, 3, 49, 79, 80, 52, 133, 134, 43, - 6, 7, 8, 9, 10, 11, 12, 13, 48, 145, - 14, 15, 137, 55, 56, 44, 45, 57, 131, 132, - 109, 50, 58, 122, 51, 122, 24, 138, 139, -28, - 88, 143, -28, -28, -28, -28, -28, -28, -28, -28, - -28, 89, 53, -28, -28, 90, 91, -28, 92, 93, - 94, 95, 96, 54, 97, 55, 56, 88, 161, 98, - -66, -66, -66, -66, -66, -66, -66, -66, 81, 82, - -66, -66, 90, 91, 152, 55, 56, 140, 61, 57, - 112, 97, 84, 123, 58, 123, 121, 117, 85, 125, - 149, 62, 167, -30, 88, 63, -30, -30, -30, -30, - -30, -30, -30, -30, -30, 89, 72, -30, -30, 90, - 91, -30, 92, 93, 94, 95, 96, 119, 97, 127, - 144, -75, 88, 98, -75, -75, -75, -75, -75, -75, - -75, -75, -75, 74, 75, -75, -75, 90, 91, -75, - -75, -75, -75, -75, -75, 76, 97, 77, 78, -2, - 4, 121, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 86, 87, 14, 15, 16, 129, 17, 18, 19, - 20, 21, 22, 88, 23, 135, 136, -43, -43, 24, - -43, -43, -43, -43, 89, 146, -43, -43, 90, 91, - 104, 105, 106, 107, 155, 7, 8, 97, 10, 11, - 12, 13, 108, 148, 14, 15, 158, 159, 160, 147, - 151, 81, 82, 163, 130, 165, 155, 81, 82, 82, - 24, 113, 116, 157, 124, 171, 115, 120, 162, 128, - 72, 81, 82, 153, 81, 82, 154, 81, 82, 166, - 81, 82, 164, 168, 169, 170, 172, 173, 174, 65, - 71, 83, 0, 150, 111 + 46, 47, 43, 49, 79, 80, 52, 134, 135, 6, + 7, 8, 9, 10, 11, 12, 13, 84, 144, 14, + 15, 55, 56, 85, 118, 57, 126, 160, 132, 133, + 58, 110, 161, 3, 123, 24, 123, 48, -28, 88, + 142, -28, -28, -28, -28, -28, -28, -28, -28, -28, + 89, 53, -28, -28, 90, -28, 91, 92, 93, 94, + 95, 96, 120, 97, 128, 88, 50, 159, 98, -49, + -49, 51, -49, -49, -49, -49, 89, 54, -49, -49, + 90, 105, 106, 107, 108, 152, 139, 113, 61, 97, + 124, 62, 124, 131, 109, 63, 81, 82, 44, 45, + 167, 149, -30, 88, 72, -30, -30, -30, -30, -30, + -30, -30, -30, -30, 89, 74, -30, -30, 90, -30, + 91, 92, 93, 94, 95, 96, 75, 97, 55, 56, + -2, 4, 98, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 81, 82, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 7, 8, 23, 10, 11, 12, 13, + 24, 76, 14, 15, 77, -81, 88, 177, -81, -81, + -81, -81, -81, -81, -81, -81, -81, 78, 24, -81, + -81, 90, -81, -81, -81, -81, -81, -81, 114, 117, + 97, 125, 86, 88, 87, 122, -72, -72, -72, -72, + -72, -72, -72, -72, 130, 136, -72, -72, 90, 153, + 156, 157, 158, 116, 121, 137, 129, 97, 163, 143, + 165, 138, 122, 72, 81, 82, 81, 82, 171, 166, + 81, 82, 146, 147, 148, 151, 153, 82, 155, 162, + 172, 164, 168, 169, 170, 174, 175, 176, 65, 112, + 150, 0, 0, 0, 0, 83, 0, 0, 71 }; -static const short int yycheck[] = +static const yytype_int16 yycheck[] = { - 5, 6, 0, 8, 57, 58, 11, 84, 85, 30, - 4, 5, 6, 7, 8, 9, 10, 11, 30, 96, - 14, 15, 24, 25, 26, 25, 26, 29, 81, 82, - 66, 30, 34, 69, 30, 71, 30, 90, 91, 0, - 1, 94, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 25, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 25, 25, 25, 26, 1, 145, 30, - 4, 5, 6, 7, 8, 9, 10, 11, 31, 32, - 14, 15, 16, 17, 137, 25, 26, 92, 30, 29, - 66, 25, 27, 69, 34, 71, 30, 68, 33, 70, - 105, 1, 155, 0, 1, 1, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 30, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 68, 25, 70, - 25, 0, 1, 30, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 30, 30, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 30, 25, 30, 30, 0, - 1, 30, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 30, 30, 14, 15, 16, 30, 18, 19, 20, - 21, 22, 23, 1, 25, 30, 30, 5, 6, 30, - 8, 9, 10, 11, 12, 1, 14, 15, 16, 17, - 18, 19, 20, 21, 14, 5, 6, 25, 8, 9, - 10, 11, 30, 30, 14, 15, 142, 143, 144, 13, - 25, 31, 32, 149, 28, 151, 14, 31, 32, 32, - 30, 67, 68, 30, 70, 161, 67, 68, 30, 70, - 30, 31, 32, 30, 31, 32, 30, 31, 32, 30, - 31, 32, 30, 30, 30, 30, 30, 30, 30, 29, - 40, 59, -1, 106, 66 + 5, 6, 30, 8, 57, 58, 11, 84, 85, 4, + 5, 6, 7, 8, 9, 10, 11, 27, 95, 14, + 15, 25, 26, 33, 68, 29, 70, 25, 81, 82, + 34, 66, 30, 0, 69, 30, 71, 30, 0, 1, + 93, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 25, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 68, 25, 70, 1, 30, 144, 30, 5, + 6, 30, 8, 9, 10, 11, 12, 25, 14, 15, + 16, 17, 18, 19, 20, 138, 91, 66, 30, 25, + 69, 1, 71, 28, 30, 1, 31, 32, 25, 26, + 153, 106, 0, 1, 30, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 30, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 30, 25, 25, 26, + 0, 1, 30, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 31, 32, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 5, 6, 25, 8, 9, 10, 11, + 30, 30, 14, 15, 30, 0, 1, 172, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 30, 30, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 67, 68, + 25, 70, 30, 1, 30, 30, 4, 5, 6, 7, + 8, 9, 10, 11, 30, 30, 14, 15, 16, 14, + 141, 142, 143, 67, 68, 30, 70, 25, 149, 25, + 151, 24, 30, 30, 31, 32, 31, 32, 159, 30, + 31, 32, 1, 13, 30, 25, 14, 32, 30, 30, + 33, 30, 30, 30, 30, 30, 30, 30, 29, 66, + 107, -1, -1, -1, -1, 59, -1, -1, 40 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ -static const unsigned char yystos[] = +static const yytype_uint8 yystos[] = { 0, 36, 37, 0, 1, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 14, 15, 16, 18, 19, 20, - 21, 22, 23, 25, 30, 38, 39, 41, 42, 43, - 44, 47, 48, 50, 54, 56, 58, 59, 61, 63, - 64, 65, 72, 30, 25, 26, 71, 71, 30, 71, - 30, 30, 71, 25, 25, 25, 26, 29, 34, 75, - 76, 30, 1, 1, 45, 45, 51, 53, 57, 68, - 62, 68, 30, 73, 30, 30, 30, 30, 30, 75, - 75, 31, 32, 73, 27, 33, 30, 30, 1, 12, - 16, 17, 19, 20, 21, 22, 23, 25, 30, 40, - 46, 66, 67, 69, 18, 19, 20, 21, 30, 40, - 52, 67, 69, 39, 49, 72, 39, 50, 55, 61, - 72, 30, 40, 69, 39, 50, 60, 61, 72, 30, - 28, 75, 75, 76, 76, 30, 30, 24, 75, 75, - 71, 70, 71, 75, 25, 76, 1, 13, 30, 71, - 70, 25, 75, 30, 30, 14, 74, 30, 74, 74, - 74, 76, 30, 74, 30, 74, 30, 75, 30, 30, - 30, 74, 30, 30, 30 + 8, 9, 10, 11, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 25, 30, 38, 39, 41, 42, 43, + 44, 50, 51, 53, 57, 59, 61, 62, 64, 66, + 67, 68, 75, 30, 25, 26, 74, 74, 30, 74, + 30, 30, 74, 25, 25, 25, 26, 29, 34, 78, + 79, 30, 1, 1, 45, 45, 54, 56, 60, 71, + 65, 71, 30, 76, 30, 30, 30, 30, 30, 78, + 78, 31, 32, 76, 27, 33, 30, 30, 1, 12, + 16, 18, 19, 20, 21, 22, 23, 25, 30, 40, + 46, 47, 69, 70, 72, 17, 18, 19, 20, 30, + 40, 55, 70, 72, 39, 52, 75, 39, 53, 58, + 64, 75, 30, 40, 72, 39, 53, 63, 64, 75, + 30, 28, 78, 78, 79, 79, 30, 30, 24, 74, + 73, 74, 78, 25, 79, 48, 1, 13, 30, 74, + 73, 25, 78, 14, 77, 30, 77, 77, 77, 79, + 25, 30, 30, 77, 30, 77, 30, 78, 30, 30, + 30, 77, 33, 49, 30, 30, 30, 74 }; -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) -# define YYSIZE_T __SIZE_TYPE__ -#endif -#if ! defined (YYSIZE_T) && defined (size_t) -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) -# if defined (__STDC__) || defined (__cplusplus) -# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# endif -#endif -#if ! defined (YYSIZE_T) -# define YYSIZE_T unsigned int -#endif - #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) @@ -705,15 +822,15 @@ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ + YYPOPSTACK (1); \ goto yybackup; \ } \ else \ - { \ - yyerror ("syntax error: cannot back up");\ + { \ + yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ -while (0) +while (YYID (0)) #define YYTERROR 1 @@ -728,7 +845,7 @@ #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ - if (N) \ + if (YYID (N)) \ { \ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ @@ -742,7 +859,7 @@ (Current).first_column = (Current).last_column = \ YYRHSLOC (Rhs, 0).last_column; \ } \ - while (0) + while (YYID (0)) #endif @@ -754,8 +871,8 @@ # if YYLTYPE_IS_TRIVIAL # define YY_LOCATION_PRINT(File, Loc) \ fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) # else # define YY_LOCATION_PRINT(File, Loc) ((void) 0) # endif @@ -782,36 +899,96 @@ do { \ if (yydebug) \ YYFPRINTF Args; \ -} while (0) +} while (YYID (0)) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yysymprint (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (YYID (0)) + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_value_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (!yyvaluep) + return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# else + YYUSE (yyoutput); +# endif + switch (yytype) + { + default: + break; + } +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + yy_symbol_value_print (yyoutput, yytype, yyvaluep); + YYFPRINTF (yyoutput, ")"); +} + /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ -#if defined (__STDC__) || defined (__cplusplus) +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void -yy_stack_print (short int *bottom, short int *top) +yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) #else static void yy_stack_print (bottom, top) - short int *bottom; - short int *top; + yytype_int16 *bottom; + yytype_int16 *top; #endif { YYFPRINTF (stderr, "Stack now"); - for (/* Nothing. */; bottom <= top; ++bottom) + for (; bottom <= top; ++bottom) YYFPRINTF (stderr, " %d", *bottom); YYFPRINTF (stderr, "\n"); } @@ -820,37 +997,45 @@ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ -} while (0) +} while (YYID (0)) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if defined (__STDC__) || defined (__cplusplus) +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void -yy_reduce_print (int yyrule) +yy_reduce_print (YYSTYPE *yyvsp, int yyrule) #else static void -yy_reduce_print (yyrule) +yy_reduce_print (yyvsp, yyrule) + YYSTYPE *yyvsp; int yyrule; #endif { + int yynrhs = yyr2[yyrule]; int yyi; - unsigned int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", - yyrule - 1, yylno); - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) - YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); - YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + fprintf (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); + fprintf (stderr, "\n"); + } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ - yy_reduce_print (Rule); \ -} while (0) + yy_reduce_print (yyvsp, Rule); \ +} while (YYID (0)) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ @@ -872,7 +1057,7 @@ if the built-in stack extension method is used). Do not make this value too large; the results are undefined if - SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH @@ -884,45 +1069,47 @@ #if YYERROR_VERBOSE # ifndef yystrlen -# if defined (__GLIBC__) && defined (_STRING_H) +# if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static YYSIZE_T -# if defined (__STDC__) || defined (__cplusplus) yystrlen (const char *yystr) -# else +#else +static YYSIZE_T yystrlen (yystr) - const char *yystr; -# endif + const char *yystr; +#endif { - register const char *yys = yystr; - - while (*yys++ != '\0') + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) continue; - - return yys - yystr - 1; + return yylen; } # endif # endif # ifndef yystpcpy -# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static char * -# if defined (__STDC__) || defined (__cplusplus) yystpcpy (char *yydest, const char *yysrc) -# else +#else +static char * yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -# endif + char *yydest; + const char *yysrc; +#endif { - register char *yyd = yydest; - register const char *yys = yysrc; + char *yyd = yydest; + const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; @@ -932,53 +1119,171 @@ # endif # endif -#endif /* !YYERROR_VERBOSE */ +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; - + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; -#if YYDEBUG -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; -#if defined (__STDC__) || defined (__cplusplus) -static void -yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) -#else -static void -yysymprint (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE *yyvaluep; -#endif + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) { - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; + int yyn = yypact[yystate]; - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + { + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; +# if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +# endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - switch (yytype) - { - default: - break; + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + + if (yysize_overflow) + return YYSIZE_MAXIMUM; + + if (yyresult) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; } - YYFPRINTF (yyoutput, ")"); } +#endif /* YYERROR_VERBOSE */ + -#endif /* ! YYDEBUG */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ -#if defined (__STDC__) || defined (__cplusplus) +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) #else @@ -989,8 +1294,7 @@ YYSTYPE *yyvaluep; #endif { - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; + YYUSE (yyvaluep); if (!yymsg) yymsg = "Deleting"; @@ -998,39 +1302,39 @@ switch (yytype) { - case 48: /* choice_entry */ + case 51: /* "choice_entry" */ - { + { fprintf(stderr, "%s:%d: missing end statement for this entry\n", (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno); if (current_menu == (yyvaluep->menu)) menu_end_menu(); }; - break; - case 54: /* if_entry */ + break; + case 57: /* "if_entry" */ - { + { fprintf(stderr, "%s:%d: missing end statement for this entry\n", (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno); if (current_menu == (yyvaluep->menu)) menu_end_menu(); }; - break; - case 59: /* menu_entry */ + break; + case 62: /* "menu_entry" */ - { + { fprintf(stderr, "%s:%d: missing end statement for this entry\n", (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno); if (current_menu == (yyvaluep->menu)) menu_end_menu(); }; - break; + break; default: - break; + break; } } @@ -1038,13 +1342,13 @@ /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) +#if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); -# else +#else int yyparse (); -# endif +#endif #else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) +#if defined __STDC__ || defined __cplusplus int yyparse (void); #else int yyparse (); @@ -1069,14 +1373,18 @@ `----------*/ #ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM) -# else -int yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -# endif +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void *YYPARSE_PARAM) +#else +int +yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +#endif #else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) int yyparse (void) #else @@ -1086,14 +1394,20 @@ #endif #endif { - - register int yystate; - register int yyn; + + int yystate; + int yyn; int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* Look-ahead token as an internal (translated) token number. */ int yytoken = 0; +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif /* Three stacks and their tools: `yyss': related to states, @@ -1104,18 +1418,18 @@ to reallocate them elsewhere. */ /* The state stack. */ - short int yyssa[YYINITDEPTH]; - short int *yyss = yyssa; - register short int *yyssp; + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss = yyssa; + yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; - register YYSTYPE *yyvsp; + YYSTYPE *yyvsp; -#define YYPOPSTACK (yyvsp--, yyssp--) +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) YYSIZE_T yystacksize = YYINITDEPTH; @@ -1124,9 +1438,9 @@ YYSTYPE yyval; - /* When reducing, the number of symbols on the RHS of the reduced - rule. */ - int yylen; + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; YYDPRINTF ((stderr, "Starting parse\n")); @@ -1143,9 +1457,6 @@ yyssp = yyss; yyvsp = yyvs; - - yyvsp[0] = yylval; - goto yysetstate; /*------------------------------------------------------------. @@ -1153,8 +1464,7 @@ `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. - */ + have just been pushed. So pushing a state here evens the stacks. */ yyssp++; yysetstate: @@ -1167,18 +1477,18 @@ #ifdef yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of + /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; - short int *yyss1 = yyss; + yytype_int16 *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ - yyoverflow ("parser stack overflow", + yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), @@ -1189,21 +1499,21 @@ } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE - goto yyoverflowlab; + goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyoverflowlab; + goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { - short int *yyss1 = yyss; + yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) - goto yyoverflowlab; + goto yyexhaustedlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); @@ -1234,12 +1544,10 @@ `-----------*/ yybackup: -/* Do appropriate processing given the current state. */ -/* Read a look-ahead token if we need one and don't already have one. */ -/* yyresume: */ + /* Do appropriate processing given the current state. Read a + look-ahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to look-ahead token. */ - yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; @@ -1281,22 +1589,21 @@ if (yyn == YYFINAL) YYACCEPT; + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + /* Shift the look-ahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - /* Discard the token being shifted unless it is eof. */ + /* Discard the shifted token unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; + yystate = yyn; *++yyvsp = yylval; - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - yystate = yyn; goto yynewstate; @@ -1338,13 +1645,13 @@ case 9: - { zconf_error("unknown statement \"%s\"", (yyvsp[-2].string)); ;} + { zconf_error("unknown statement \"%s\"", (yyvsp[(2) - (4)].string)); ;} break; case 10: { - zconf_error("unexpected option \"%s\"", kconf_id_strings + (yyvsp[-2].id)->name); + zconf_error("unexpected option \"%s\"", kconf_id_strings + (yyvsp[(2) - (4)].id)->name); ;} break; @@ -1355,7 +1662,7 @@ case 25: - { zconf_error("unknown option \"%s\"", (yyvsp[-2].string)); ;} + { zconf_error("unknown option \"%s\"", (yyvsp[(1) - (3)].string)); ;} break; case 26: @@ -1366,10 +1673,10 @@ case 27: { - struct symbol *sym = sym_lookup((yyvsp[-1].string), 0); + struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0); sym->flags |= SYMBOL_OPTIONAL; menu_add_entry(sym); - printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), (yyvsp[-1].string)); + printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string)); ;} break; @@ -1384,10 +1691,10 @@ case 29: { - struct symbol *sym = sym_lookup((yyvsp[-1].string), 0); + struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0); sym->flags |= SYMBOL_OPTIONAL; menu_add_entry(sym); - printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), (yyvsp[-1].string)); + printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string)); ;} break; @@ -1403,55 +1710,77 @@ ;} break; - case 37: + case 38: { - menu_set_type((yyvsp[-2].id)->stype); + menu_set_type((yyvsp[(1) - (3)].id)->stype); printd(DEBUG_PARSE, "%s:%d:type(%u)\n", zconf_curname(), zconf_lineno(), - (yyvsp[-2].id)->stype); + (yyvsp[(1) - (3)].id)->stype); ;} break; - case 38: + case 39: { - menu_add_prompt(P_PROMPT, (yyvsp[-2].string), (yyvsp[-1].expr)); + menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr)); printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno()); ;} break; - case 39: + case 40: { - menu_add_expr(P_DEFAULT, (yyvsp[-2].expr), (yyvsp[-1].expr)); - if ((yyvsp[-3].id)->stype != S_UNKNOWN) - menu_set_type((yyvsp[-3].id)->stype); + menu_add_expr(P_DEFAULT, (yyvsp[(2) - (4)].expr), (yyvsp[(3) - (4)].expr)); + if ((yyvsp[(1) - (4)].id)->stype != S_UNKNOWN) + menu_set_type((yyvsp[(1) - (4)].id)->stype); printd(DEBUG_PARSE, "%s:%d:default(%u)\n", zconf_curname(), zconf_lineno(), - (yyvsp[-3].id)->stype); + (yyvsp[(1) - (4)].id)->stype); ;} break; - case 40: + case 41: { - menu_add_symbol(P_SELECT, sym_lookup((yyvsp[-2].string), 0), (yyvsp[-1].expr)); + menu_add_symbol(P_SELECT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr)); printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno()); ;} break; - case 41: + case 42: { - menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,(yyvsp[-3].symbol), (yyvsp[-2].symbol)), (yyvsp[-1].expr)); + menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,(yyvsp[(2) - (5)].symbol), (yyvsp[(3) - (5)].symbol)), (yyvsp[(4) - (5)].expr)); printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno()); ;} break; - case 42: + case 45: { + struct kconf_id *id = kconf_id_lookup((yyvsp[(2) - (3)].string), strlen((yyvsp[(2) - (3)].string))); + if (id && id->flags & TF_OPTION) + menu_add_option(id->token, (yyvsp[(3) - (3)].string)); + else + zconfprint("warning: ignoring unknown option %s", (yyvsp[(2) - (3)].string)); + free((yyvsp[(2) - (3)].string)); +;} + break; + + case 46: + + { (yyval.string) = NULL; ;} + break; + + case 47: + + { (yyval.string) = (yyvsp[(2) - (2)].string); ;} + break; + + case 48: + + { struct symbol *sym = sym_lookup(NULL, 0); sym->flags |= SYMBOL_CHOICE; menu_add_entry(sym); @@ -1460,45 +1789,45 @@ ;} break; - case 43: + case 49: { (yyval.menu) = menu_add_menu(); ;} break; - case 44: + case 50: { - if (zconf_endtoken((yyvsp[0].id), T_CHOICE, T_ENDCHOICE)) { + if (zconf_endtoken((yyvsp[(1) - (1)].id), T_CHOICE, T_ENDCHOICE)) { menu_end_menu(); printd(DEBUG_PARSE, "%s:%d:endchoice\n", zconf_curname(), zconf_lineno()); } ;} break; - case 52: + case 58: { - menu_add_prompt(P_PROMPT, (yyvsp[-2].string), (yyvsp[-1].expr)); + menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr)); printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno()); ;} break; - case 53: + case 59: { - if ((yyvsp[-2].id)->stype == S_BOOLEAN || (yyvsp[-2].id)->stype == S_TRISTATE) { - menu_set_type((yyvsp[-2].id)->stype); + if ((yyvsp[(1) - (3)].id)->stype == S_BOOLEAN || (yyvsp[(1) - (3)].id)->stype == S_TRISTATE) { + menu_set_type((yyvsp[(1) - (3)].id)->stype); printd(DEBUG_PARSE, "%s:%d:type(%u)\n", zconf_curname(), zconf_lineno(), - (yyvsp[-2].id)->stype); + (yyvsp[(1) - (3)].id)->stype); } else YYERROR; ;} break; - case 54: + case 60: { current_entry->sym->flags |= SYMBOL_OPTIONAL; @@ -1506,11 +1835,11 @@ ;} break; - case 55: + case 61: { - if ((yyvsp[-3].id)->stype == S_UNKNOWN) { - menu_add_symbol(P_DEFAULT, sym_lookup((yyvsp[-2].string), 0), (yyvsp[-1].expr)); + if ((yyvsp[(1) - (4)].id)->stype == S_UNKNOWN) { + menu_add_symbol(P_DEFAULT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr)); printd(DEBUG_PARSE, "%s:%d:default\n", zconf_curname(), zconf_lineno()); } else @@ -1518,77 +1847,77 @@ ;} break; - case 58: + case 64: { printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno()); menu_add_entry(NULL); - menu_add_dep((yyvsp[-1].expr)); + menu_add_dep((yyvsp[(2) - (3)].expr)); (yyval.menu) = menu_add_menu(); ;} break; - case 59: + case 65: { - if (zconf_endtoken((yyvsp[0].id), T_IF, T_ENDIF)) { + if (zconf_endtoken((yyvsp[(1) - (1)].id), T_IF, T_ENDIF)) { menu_end_menu(); printd(DEBUG_PARSE, "%s:%d:endif\n", zconf_curname(), zconf_lineno()); } ;} break; - case 65: + case 71: { menu_add_entry(NULL); - menu_add_prompt(P_MENU, (yyvsp[-1].string), NULL); + menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL); printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno()); ;} break; - case 66: + case 72: { (yyval.menu) = menu_add_menu(); ;} break; - case 67: + case 73: { - if (zconf_endtoken((yyvsp[0].id), T_MENU, T_ENDMENU)) { + if (zconf_endtoken((yyvsp[(1) - (1)].id), T_MENU, T_ENDMENU)) { menu_end_menu(); printd(DEBUG_PARSE, "%s:%d:endmenu\n", zconf_curname(), zconf_lineno()); } ;} break; - case 73: + case 79: { - printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), (yyvsp[-1].string)); - zconf_nextfile((yyvsp[-1].string)); + printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string)); + zconf_nextfile((yyvsp[(2) - (3)].string)); ;} break; - case 74: + case 80: { menu_add_entry(NULL); - menu_add_prompt(P_COMMENT, (yyvsp[-1].string), NULL); + menu_add_prompt(P_COMMENT, (yyvsp[(2) - (3)].string), NULL); printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno()); ;} break; - case 75: + case 81: { menu_end_entry(); ;} break; - case 76: + case 82: { printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno()); @@ -1596,124 +1925,107 @@ ;} break; - case 77: + case 83: { - current_entry->sym->help = (yyvsp[0].string); + current_entry->help = (yyvsp[(2) - (2)].string); ;} break; - case 82: + case 88: { - menu_add_dep((yyvsp[-1].expr)); + menu_add_dep((yyvsp[(3) - (4)].expr)); printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno()); ;} break; - case 83: + case 90: { - menu_add_dep((yyvsp[-1].expr)); - printd(DEBUG_PARSE, "%s:%d:depends\n", zconf_curname(), zconf_lineno()); + menu_add_prompt(P_PROMPT, (yyvsp[(1) - (2)].string), (yyvsp[(2) - (2)].expr)); ;} break; - case 84: + case 93: - { - menu_add_dep((yyvsp[-1].expr)); - printd(DEBUG_PARSE, "%s:%d:requires\n", zconf_curname(), zconf_lineno()); -;} + { (yyval.id) = (yyvsp[(1) - (2)].id); ;} break; - case 86: + case 94: - { - menu_add_prompt(P_PROMPT, (yyvsp[-1].string), (yyvsp[0].expr)); -;} + { (yyval.id) = (yyvsp[(1) - (2)].id); ;} break; - case 89: + case 95: - { (yyval.id) = (yyvsp[-1].id); ;} + { (yyval.id) = (yyvsp[(1) - (2)].id); ;} break; - case 90: + case 98: - { (yyval.id) = (yyvsp[-1].id); ;} + { (yyval.expr) = NULL; ;} break; - case 91: + case 99: - { (yyval.id) = (yyvsp[-1].id); ;} + { (yyval.expr) = (yyvsp[(2) - (2)].expr); ;} break; - case 94: + case 100: - { (yyval.expr) = NULL; ;} + { (yyval.expr) = expr_alloc_symbol((yyvsp[(1) - (1)].symbol)); ;} break; - case 95: + case 101: - { (yyval.expr) = (yyvsp[0].expr); ;} + { (yyval.expr) = expr_alloc_comp(E_EQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;} break; - case 96: + case 102: - { (yyval.expr) = expr_alloc_symbol((yyvsp[0].symbol)); ;} + { (yyval.expr) = expr_alloc_comp(E_UNEQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;} break; - case 97: + case 103: - { (yyval.expr) = expr_alloc_comp(E_EQUAL, (yyvsp[-2].symbol), (yyvsp[0].symbol)); ;} + { (yyval.expr) = (yyvsp[(2) - (3)].expr); ;} break; - case 98: + case 104: - { (yyval.expr) = expr_alloc_comp(E_UNEQUAL, (yyvsp[-2].symbol), (yyvsp[0].symbol)); ;} + { (yyval.expr) = expr_alloc_one(E_NOT, (yyvsp[(2) - (2)].expr)); ;} break; - case 99: + case 105: - { (yyval.expr) = (yyvsp[-1].expr); ;} + { (yyval.expr) = expr_alloc_two(E_OR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;} break; - case 100: + case 106: - { (yyval.expr) = expr_alloc_one(E_NOT, (yyvsp[0].expr)); ;} + { (yyval.expr) = expr_alloc_two(E_AND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;} break; - case 101: + case 107: - { (yyval.expr) = expr_alloc_two(E_OR, (yyvsp[-2].expr), (yyvsp[0].expr)); ;} + { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), 0); free((yyvsp[(1) - (1)].string)); ;} break; - case 102: + case 108: - { (yyval.expr) = expr_alloc_two(E_AND, (yyvsp[-2].expr), (yyvsp[0].expr)); ;} + { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), 1); free((yyvsp[(1) - (1)].string)); ;} break; - case 103: - { (yyval.symbol) = sym_lookup((yyvsp[0].string), 0); free((yyvsp[0].string)); ;} - break; +/* Line 1267 of yacc.c. */ - case 104: - - { (yyval.symbol) = sym_lookup((yyvsp[0].string), 1); free((yyvsp[0].string)); ;} - break; - - + default: break; } + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); -/* Line 1037 of yacc.c. */ - - - yyvsp -= yylen; - yyssp -= yylen; - - + YYPOPSTACK (yylen); + yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; @@ -1742,66 +2054,41 @@ if (!yyerrstatus) { ++yynerrs; -#if YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (YYPACT_NINF < yyn && yyn < YYLAST) - { - YYSIZE_T yysize = 0; - int yytype = YYTRANSLATE (yychar); - const char* yyprefix; - char *yymsg; - int yyx; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 0; - - yyprefix = ", expecting "; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) +#if ! YYERROR_VERBOSE + yyerror (YY_("syntax error")); +#else + { + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else { - yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]); - yycount += 1; - if (yycount == 5) - { - yysize = 0; - break; - } + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; } - yysize += (sizeof ("syntax error, unexpected ") - + yystrlen (yytname[yytype])); - yymsg = (char *) YYSTACK_ALLOC (yysize); - if (yymsg != 0) - { - char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); - yyp = yystpcpy (yyp, yytname[yytype]); + } - if (yycount < 5) - { - yyprefix = ", expecting "; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - yyp = yystpcpy (yyp, yyprefix); - yyp = yystpcpy (yyp, yytname[yyx]); - yyprefix = " or "; - } - } - yyerror (yymsg); - YYSTACK_FREE (yymsg); - } - else - yyerror ("syntax error; also virtual memory exhausted"); - } - else -#endif /* YYERROR_VERBOSE */ - yyerror ("syntax error"); + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (yymsg); + } + else + { + yyerror (YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } + } +#endif } @@ -1812,23 +2099,15 @@ error, discard it. */ if (yychar <= YYEOF) - { - /* If at end of input, pop the error token, - then the rest of the stack, then return failure. */ + { + /* Return failure if at end of input. */ if (yychar == YYEOF) - for (;;) - { - - YYPOPSTACK; - if (yyssp == yyss) - YYABORT; - yydestruct ("Error: popping", - yystos[*yyssp], yyvsp); - } - } + YYABORT; + } else { - yydestruct ("Error: discarding", yytoken, &yylval); + yydestruct ("Error: discarding", + yytoken, &yylval); yychar = YYEMPTY; } } @@ -1843,15 +2122,17 @@ `---------------------------------------------------*/ yyerrorlab: -#ifdef __GNUC__ - /* Pacify GCC when the user code never invokes YYERROR and the label - yyerrorlab therefore never appears in user code. */ - if (0) + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) goto yyerrorlab; -#endif -yyvsp -= yylen; - yyssp -= yylen; + /* Do not reclaim the symbols of the rule which action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; @@ -1881,8 +2162,9 @@ YYABORT; - yydestruct ("Error: popping", yystos[yystate], yyvsp); - YYPOPSTACK; + yydestruct ("Error: popping", + yystos[yystate], yyvsp); + YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } @@ -1893,7 +2175,7 @@ *++yyvsp = yylval; - /* Shift the error token. */ + /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; @@ -1911,28 +2193,43 @@ | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: - yydestruct ("Error: discarding lookahead", - yytoken, &yylval); - yychar = YYEMPTY; yyresult = 1; goto yyreturn; #ifndef yyoverflow -/*----------------------------------------------. -| yyoverflowlab -- parser overflow comes here. | -`----------------------------------------------*/ -yyoverflowlab: - yyerror ("parser stack overflow"); +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: + if (yychar != YYEOF && yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + /* Do not reclaim the symbols of the rule which action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK (1); + } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif - return yyresult; +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + /* Make sure YYID is used. */ + return YYID (yyresult); } @@ -1948,8 +2245,10 @@ sym_init(); menu_init(); - modules_sym = sym_lookup("MODULES", 0); - rootmenu.prompt = menu_add_prompt(P_MENU, "Buildrom Configuration", NULL); + modules_sym = sym_lookup(NULL, 0); + modules_sym->type = S_BOOLEAN; + modules_sym->flags |= SYMBOL_AUTO; + rootmenu.prompt = menu_add_prompt(P_MENU, "buildrom Configuration", NULL); #if YYDEBUG if (getenv("ZCONF_DEBUG")) @@ -1958,12 +2257,20 @@ zconfparse(); if (zconfnerrs) exit(1); + if (!modules_sym->prop) { + struct property *prop; + + prop = prop_alloc(P_DEFAULT, modules_sym); + prop->expr = expr_alloc_symbol(sym_lookup("MODULES", 0)); + } menu_finalize(&rootmenu); for_all_symbols(i, sym) { - sym_check_deps(sym); + if (sym_check_deps(sym)) + zconfnerrs++; } - - sym_change_count = 1; + if (zconfnerrs) + exit(1); + sym_set_change_count(1); } const char *zconf_tokenname(int token) @@ -2106,11 +2413,11 @@ break; } } - if (sym->help) { - int len = strlen(sym->help); - while (sym->help[--len] == '\n') - sym->help[len] = 0; - fprintf(out, " help\n%s\n", sym->help); + if (menu->help) { + int len = strlen(menu->help); + while (menu->help[--len] == '\n') + menu->help[len] = 0; + fprintf(out, " help\n%s\n", menu->help); } fputc('\n', out); } @@ -2170,4 +2477,3 @@ #include "symbol.c" #include "menu.c" - Modified: buildrom-devel/scripts/kconfig/zconf.y =================================================================== --- buildrom-devel/scripts/kconfig/zconf.y 2008-07-01 21:13:46 UTC (rev 209) +++ buildrom-devel/scripts/kconfig/zconf.y 2008-07-02 19:45:34 UTC (rev 210) @@ -64,13 +64,13 @@ %token <id>T_IF %token <id>T_ENDIF %token <id>T_DEPENDS -%token <id>T_REQUIRES %token <id>T_OPTIONAL %token <id>T_PROMPT %token <id>T_TYPE %token <id>T_DEFAULT %token <id>T_SELECT %token <id>T_RANGE +%token <id>T_OPTION %token <id>T_ON %token <string> T_WORD %token <string> T_WORD_QUOTE @@ -91,6 +91,7 @@ %type <id> end %type <id> option_name %type <menu> if_entry menu_entry choice_entry +%type <string> symbol_option_arg %destructor { fprintf(stderr, "%s:%d: missing end statement for this entry\n", @@ -173,6 +174,7 @@ config_option_list: /* empty */ | config_option_list config_option + | config_option_list symbol_option | config_option_list depends | config_option_list help | config_option_list option_error @@ -215,6 +217,26 @@ printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno()); }; +symbol_option: T_OPTION symbol_option_list T_EOL +; + +symbol_option_list: + /* empty */ + | symbol_option_list T_WORD symbol_option_arg +{ + struct kconf_id *id = kconf_id_lookup($2, strlen($2)); + if (id && id->flags & TF_OPTION) + menu_add_option(id->token, $3); + else + zconfprint("warning: ignoring unknown option %s", $2); + free($2); +}; + +symbol_option_arg: + /* empty */ { $$ = NULL; } + | T_EQUAL prompt { $$ = $2; } +; + /* choice entry */ choice: T_CHOICE T_EOL @@ -379,7 +401,7 @@ help: help_start T_HELPTEXT { - current_entry->sym->help = $2; + current_entry->help = $2; }; /* depends option */ @@ -395,16 +417,6 @@ { menu_add_dep($3); printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno()); -} - | T_DEPENDS expr T_EOL -{ - menu_add_dep($2); - printd(DEBUG_PARSE, "%s:%d:depends\n", zconf_curname(), zconf_lineno()); -} - | T_REQUIRES expr T_EOL -{ - menu_add_dep($2); - printd(DEBUG_PARSE, "%s:%d:requires\n", zconf_curname(), zconf_lineno()); }; /* prompt statement */ @@ -458,8 +470,10 @@ sym_init(); menu_init(); - modules_sym = sym_lookup("MODULES", 0); - rootmenu.prompt = menu_add_prompt(P_MENU, "Buildrom Configuration", NULL); + modules_sym = sym_lookup(NULL, 0); + modules_sym->type = S_BOOLEAN; + modules_sym->flags |= SYMBOL_AUTO; + rootmenu.prompt = menu_add_prompt(P_MENU, "buildrom Configuration", NULL); #if YYDEBUG if (getenv("ZCONF_DEBUG")) @@ -468,12 +482,20 @@ zconfparse(); if (zconfnerrs) exit(1); + if (!modules_sym->prop) { + struct property *prop; + + prop = prop_alloc(P_DEFAULT, modules_sym); + prop->expr = expr_alloc_symbol(sym_lookup("MODULES", 0)); + } menu_finalize(&rootmenu); for_all_symbols(i, sym) { - sym_check_deps(sym); + if (sym_check_deps(sym)) + zconfnerrs++; } - - sym_change_count = 1; + if (zconfnerrs) + exit(1); + sym_set_change_count(1); } const char *zconf_tokenname(int token) @@ -616,11 +638,11 @@ break; } } - if (sym->help) { - int len = strlen(sym->help); - while (sym->help[--len] == '\n') - sym->help[len] = 0; - fprintf(out, " help\n%s\n", sym->help); + if (menu->help) { + int len = strlen(menu->help); + while (menu->help[--len] == '\n') + menu->help[len] = 0; + fprintf(out, " help\n%s\n", menu->help); } fputc('\n', out); } From uwe at hermann-uwe.de Wed Jul 2 22:37:29 2008 From: uwe at hermann-uwe.de (Uwe Hermann) Date: Wed, 2 Jul 2008 22:37:29 +0200 Subject: [coreboot] [PATCH] buildrom: Update kconfig to recent version In-Reply-To: <2831fecf0807011435r5d290ea4jc2af9b86e1c817be@mail.gmail.com> References: <20080425000631.GA32238@greenwood> <2831fecf0807011435r5d290ea4jc2af9b86e1c817be@mail.gmail.com> Message-ID: <20080702203729.GA18205@greenwood> On Tue, Jul 01, 2008 at 03:35:05PM -0600, Myles Watson wrote: > It doesn't change the behavior of my favorite builds. It does get rid > of the invalid value warnings. > > In Makefile, you can remove the declaration of KCONFIG_DIR, since you > deleted all other references to it. > > Acked-by: Myles Watson <mylesgw at gmail.com> Thanks, r210. Will look into KCONFIG_DIR (and test it). Thanks, Uwe. -- http://www.hermann-uwe.de | http://www.holsham-traders.de http://www.crazy-hacks.org | http://www.unmaintained-free-software.org From c-d.hailfinger.devel.2006 at gmx.net Thu Jul 3 03:16:34 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Thu, 03 Jul 2008 03:16:34 +0200 Subject: [coreboot] flashrom: Remove Makefile pciutils check, and don't rm *~ in clean In-Reply-To: <20080702030500.14860.qmail@stuge.se> References: <20080701221822.18719.qmail@stuge.se> <486AEAA2.6080709@gmx.net> <20080702030500.14860.qmail@stuge.se> Message-ID: <486C2872.8090306@gmx.net> On 02.07.2008 05:05, Peter Stuge wrote: > On Wed, Jul 02, 2008 at 04:40:34AM +0200, Carl-Daniel Hailfinger wrote: > >>> It is also a waste of time to do the check on every single make >>> invocation. >>> >> Stefan alread commented on this. >> > > How do you feel about configure? > Well, the configure scripts i've seen in the past are completely unreadable hideous blobs. Sourcing the requirement checks out to another script is OK, though, as long as that script is human readable and short. However, that leads me to the question why we don't want to keep it inside the makefile. Thoughts? Regards, Carl-Daniel From kevin at koconnor.net Thu Jul 3 05:21:47 2008 From: kevin at koconnor.net (Kevin O'Connor) Date: Wed, 2 Jul 2008 23:21:47 -0400 Subject: [coreboot] help with win-xp and legacybios/coreboot In-Reply-To: <2831fecf0807011536t16304457q9041f0d5b8461d28@mail.gmail.com> References: <20080628174539.GB11061@morn.localdomain> <2831fecf0807011536t16304457q9041f0d5b8461d28@mail.gmail.com> Message-ID: <20080703032147.GA31076@morn.localdomain> Hi Myles, On Tue, Jul 01, 2008 at 04:36:29PM -0600, Myles Watson wrote: > > It would be helpful if others could try installing / booting win-xp > > on real hardware. If you can do this, please follow the directions > > at: > > > > http://www.coreboot.org/pipermail/coreboot/2008-June/036108.html > > I must be missing something, because my boot fails with this message > on my s2892: [...] > move mptable from 0x20 to 0xfffffc00, size 0xdff03e0 That message should never occur if one were to apply the patch in the email from the url above. Basically, the mptabling moving should have gotten disabled by the '#if 0' change. > BTW: when I was trying to get XP to boot before, I was having timing > problems. Have you tested the timer tick with factory BIOS and > coreboot? As far as I know it works - SeaBIOS will enable the timer during its post stage. -Kevin From corey.osgood at gmail.com Thu Jul 3 07:48:33 2008 From: corey.osgood at gmail.com (Corey Osgood) Date: Thu, 3 Jul 2008 01:48:33 -0400 Subject: [coreboot] flashrom: Remove Makefile pciutils check, and don't rm *~ in clean In-Reply-To: <20080702012316.1575.qmail@stuge.se> References: <20080701221822.18719.qmail@stuge.se> <486AC6F2.8050509@coresystems.de> <20080702012316.1575.qmail@stuge.se> Message-ID: <dd3c80060807022248i496ec1bes2239f9950a44ba39@mail.gmail.com> On Tue, Jul 1, 2008 at 9:23 PM, Peter Stuge <peter at stuge.se> wrote: > On Wed, Jul 02, 2008 at 02:08:18AM +0200, Stefan Reinauer wrote: >> > but the fact is that the check is not precise enough. >> >> It is very precise. It does not check for a compiler, because >> having a compiler installed for compiling is obvious. >> Having those additional packages installed is less obvious. > > True, but because the compiler is so obvious it is easy to overlook. > > At the very least the message is not clear enough. It claims to check > for this package but in fact it isn't the only requirements, and when > the check says that the package wasn't found, that can be incorrect. > I don't think we should have error messages that can be false like > that. I've seen this too, where I had a compiler installed but forgot to set CC or link it to gcc or some such thing. Wouldn't the more correct workaround be to do a compiler check? -Corey From peter at stuge.se Thu Jul 3 11:41:10 2008 From: peter at stuge.se (Peter Stuge) Date: Thu, 3 Jul 2008 11:41:10 +0200 Subject: [coreboot] flashrom: Remove Makefile pciutils check, and don't rm *~ in clean In-Reply-To: <dd3c80060807022248i496ec1bes2239f9950a44ba39@mail.gmail.com> <486C2872.8090306@gmx.net> References: <20080701221822.18719.qmail@stuge.se> <486AC6F2.8050509@coresystems.de> <20080702012316.1575.qmail@stuge.se> <dd3c80060807022248i496ec1bes2239f9950a44ba39@mail.gmail.com> <20080701221822.18719.qmail@stuge.se> <486AEAA2.6080709@gmx.net> <20080702030500.14860.qmail@stuge.se> <486C2872.8090306@gmx.net> Message-ID: <20080703094110.30495.qmail@stuge.se> On Thu, Jul 03, 2008 at 03:16:34AM +0200, Carl-Daniel Hailfinger wrote: > > How do you feel about configure? > > Well, the configure scripts i've seen in the past are completely > unreadable hideous blobs. Yeah, they're generated by autoconf, from a pretty readable configure.in file. Just to be clear, I am not advocating autoconf+automake. I don't think we need that. > Sourcing the requirement checks out to another script is OK, > though, as long as that script is human readable and short. Great, that's the plan. > However, that leads me to the question why we don't want to keep it > inside the makefile. I think Makefile should deal only with the internal dependency graph. I haven't seen a single Makefile that tries to tie into package management before (outside ports, where they _are_ the package management, well sort-of anyway :) and for good reason I believe. System variations are too large for this to be handled in Makefile. I think Makefile must assume ideal circumstances, and let the plumbing (compiler, linker, install, etc) report error conditions as they are encountered, lest Makefile becomes like those configure scripts. Another example would be that it does not make much sense to first check if we have permission to write to $prefix before actually executing /usr/bin/install in the install: target. On Thu, Jul 03, 2008 at 01:48:33AM -0400, Corey Osgood wrote: > > At the very least the message is not clear enough. > > I've seen this too, where I had a compiler installed but forgot to > set CC or link it to gcc or some such thing. Wouldn't the more > correct workaround be to do a compiler check? Yes, that's what I'm thinking too. I am pieceing something together with parts of coresystems' xcompile script. :) //Peter From svn at coreboot.org Thu Jul 3 11:57:24 2008 From: svn at coreboot.org (coreboot) Date: Thu, 03 Jul 2008 09:57:24 -0000 Subject: [coreboot] #105: flashrom: add documentation files (ChangeLog etc) that need to be in the release In-Reply-To: <041.43c89429f4bc2b157cdb53f0a41b38c3@coreboot.org> References: <041.43c89429f4bc2b157cdb53f0a41b38c3@coreboot.org> Message-ID: <050.09402c1608dd6716b41111a0db2adcfe@coreboot.org> #105: flashrom: add documentation files (ChangeLog etc) that need to be in the release ----------------------------+----------------------------------------------- Reporter: stuge | Owner: somebody Type: enhancement | Status: new Priority: blocker | Milestone: flashrom v1.0 Component: flashrom | Version: Resolution: | Keywords: documentation Dependencies: | Patchstatus: there is no patch ----------------------------+----------------------------------------------- Comment(by stuge): <Q-FUNK> right. lack of an upstream ChangeLog has been the main worry at Debian. I cannot think of anything else. <Q-FUNK> CareBear\: generating the changelog from the commit log, then tagging the last commit as 1.0, so that it appears in the ChangeLog marked as e.g. "Calling this our release 1.0" should be enough. -- Ticket URL: <http://tracker.coreboot.org/trac/coreboot/ticket/105#comment:1> coreboot <http://www.coreboot.org/> From bjoern.gerhart at wincor-nixdorf.com Thu Jul 3 11:38:12 2008 From: bjoern.gerhart at wincor-nixdorf.com (Gerhart, Bjoern) Date: Thu, 3 Jul 2008 11:38:12 +0200 Subject: [coreboot] flashrom with Winbond W25x80 - Testreport Message-ID: <5E5D87015BF8A54A93DAD6F808B1129AAE08FE@DEEXVS13.wincor-nixdorf.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, we tested the untested flash chip "Winbond W25x80" with flashrom revision 3407. Reading and Erasing the chip went okay, but we encountered an error on writing back the previously read image. Please see the below output for further information: - ---> Reading BIOS: [root at g1 flashrom]# ./flashrom -r g1-bios.rom Calibrating delay loop... OK. No coreboot table found. Found chipset "Intel ICH7/ICH7R", enabling flash write... OK. Found chip "Winbond W25x80" (1024 KB) at physical address 0xfff00000. === This flash part has status UNTESTED for operations: PROBE READ ERASE WRITE Please email a report to flashrom at coreboot.org if any of the above operations work correctly for you with this flash part. Please include the full output from the program, including chipset found. Thank you for your help! === Reading Flash...done - ---> Erasing BIOS: [root at g1 flashrom]# ./flashrom -E Calibrating delay loop... OK. No coreboot table found. Found chipset "Intel ICH7/ICH7R", enabling flash write... OK. Found chip "Winbond W25x80" (1024 KB) at physical address 0xfff00000. === This flash part has status UNTESTED for operations: PROBE READ ERASE WRITE Please email a report to flashrom at coreboot.org if any of the above operations work correctly for you with this flash part. Please include the full output from the program, including chipset found. Thank you for your help! === Erasing flash chip. [root at g1 flashrom]# ./flashrom -r empty.rom Calibrating delay loop... OK. No coreboot table found. Found chipset "Intel ICH7/ICH7R", enabling flash write... OK. Found chip "Winbond W25x80" (1024 KB) at physical address 0xfff00000. === This flash part has status UNTESTED for operations: PROBE READ ERASE WRITE Please email a report to flashrom at coreboot.org if any of the above operations work correctly for you with this flash part. Please include the full output from the program, including chipset found. Thank you for your help! === Reading Flash...done [root at g1 flashrom]# hexdump empty.rom 0000000 ffff ffff ffff ffff ffff ffff ffff ffff * 0100000 - ---> Writing BIOS: [root at g1 flashrom]# ./flashrom -w g1-bios.rom Calibrating delay loop... OK. No coreboot table found. Found chipset "Intel ICH7/ICH7R", enabling flash write... OK. Found chip "Winbond W25x80" (1024 KB) at physical address 0xfff00000. === This flash part has status UNTESTED for operations: PROBE READ ERASE WRITE Please email a report to flashrom at coreboot.org if any of the above operations work correctly for you with this flash part. Please include the full output from the program, including chipset found. Thank you for your help! === Segmentation fault - ---> gdb Backtrace of BIOS write attempt: [root at flashrom]# gdb --args ./flashrom -w g1-bios.rom GNU gdb Red Hat Linux (6.3.0.0-1.21rh) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1". (gdb) r Starting program: /tmp/flashrom/flashrom -w g1-bios.rom Reading symbols from shared object read from target memory...done. Loaded system supplied DSO at 0x6ea000 Calibrating delay loop... OK. No coreboot table found. Found chipset "Intel ICH7/ICH7R", enabling flash write... OK. Found chip "Winbond W25x80" (1024 KB) at physical address 0xfff00000. === This flash part has status UNTESTED for operations: PROBE READ ERASE WRITE Please email a report to flashrom at coreboot.org if any of the above operations work correctly for you with this flash part. Please include the full output from the program, including chipset found. Thank you for your help! === Program received signal SIGSEGV, Segmentation fault. 0x00ec7d0d in strdup () from /lib/libc.so.6 (gdb) bt #0 0x00ec7d0d in strdup () from /lib/libc.so.6 #1 0x0804c89d in show_id (bios=0xb7c69008 "?", size=1048576, force=0) at layout.c:73 #2 0x0804da29 in main (argc=3, argv=0xbfd77034) at flashrom.c:565 (gdb) - ---> write attempt with verbose option: === coreboot last image size (not ROM size) is -1533804544 bytes. Segmentation fault Does this information help you to figure out what's going wrong? Best Regards Bj?rn Gerhart WINCOR NIXDORF International GmbH Retail Store Solutions M24 Rohrdamm 7, Haus 16 13629 Berlin Germany Phone +49 (30) 5017 - 1343 FAX +49 (30) 5017 - 1305 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (MingW32) iD8DBQFIbJ39cF0qh1XQxhgRAjkSAJ9+70EBkODyd2W2DcznOm2ga9jKmQCeLZJX TPqugkZh9vWY8GcKxGL5Fyk= =YDMi -----END PGP SIGNATURE----- -- WINCOR NIXDORF International GmbH Sitz der Gesellschaft: Paderborn Registergericht Paderborn HRB 3507 Gesch?ftsf?hrer: Eckard Heidloff (Vorsitzender), Stefan Auerbach, Dr. J?rgen Wunram Vorsitzender des Aufsichtsrats: Karl-Heinz Stiller Steuernummer: 339/5884/0020 - Ust-ID Nr.: DE812927716 - WEEE-Reg.-Nr. DE44477193 Diese E-Mail enth?lt vertrauliche Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrt?mlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser E-Mail ist nicht gestattet. This e-mail may contain confidential information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden. From peter at stuge.se Thu Jul 3 12:19:21 2008 From: peter at stuge.se (Peter Stuge) Date: Thu, 3 Jul 2008 12:19:21 +0200 Subject: [coreboot] flashrom with Winbond W25x80 - Testreport In-Reply-To: <5E5D87015BF8A54A93DAD6F808B1129AAE08FE@DEEXVS13.wincor-nixdorf.com> References: <5E5D87015BF8A54A93DAD6F808B1129AAE08FE@DEEXVS13.wincor-nixdorf.com> Message-ID: <20080703101921.28211.qmail@stuge.se> Hi Bj?rn, On Thu, Jul 03, 2008 at 11:38:12AM +0200, Gerhart, Bjoern wrote: > we tested the untested flash chip "Winbond W25x80" with flashrom > revision 3407. Reading and Erasing the chip went okay, Great! > but we encountered an error on writing back the previously read > image. Please see the below output for further information: .. > Program received signal SIGSEGV, Segmentation fault. > 0x00ec7d0d in strdup () from /lib/libc.so.6 > (gdb) bt > #0 0x00ec7d0d in strdup () from /lib/libc.so.6 > #1 0x0804c89d in show_id (bios=0xb7c69008 "?", size=1048576, force=0) at layout.c:73 > #2 0x0804da29 in main (argc=3, argv=0xbfd77034) at flashrom.c:565 > (gdb) > > coreboot last image size (not ROM size) is -1533804544 bytes. > Segmentation fault Thanks for the very detailed report! :) > Does this information help you to figure out what's going wrong? Sure does. This is a known bug. I've attached a kludge fix to disable the offending code to the ticket: http://tracker.coreboot.org/trac/coreboot/ticket/102 Please let me know if -wv works with the patch, and I'll update test status for the chip. //Peter From bjoern.gerhart at wincor-nixdorf.com Thu Jul 3 13:36:11 2008 From: bjoern.gerhart at wincor-nixdorf.com (Gerhart, Bjoern) Date: Thu, 3 Jul 2008 13:36:11 +0200 Subject: [coreboot] flashrom with Winbond W25x80 - Testreport Message-ID: <5E5D87015BF8A54A93DAD6F808B1129AAE0954@DEEXVS13.wincor-nixdorf.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Peter, thanks for your fast response. On Thu Jul 3 12:19:21 CEST 2008, Peter Stuge wrote: > I've attached a kludge fix to disable > the offending code to the ticket: > > http://tracker.coreboot.org/trac/coreboot/ticket/102 With this workaround the write attempt works successfully (see below), so in my opinion the status of the W25x80 can be set to "tested" :-) - ----> successfull writing: [root at g1 flashrom]# ./flashrom -wv ../g1-bios.rom Calibrating delay loop... OK. No coreboot table found. Found chipset "Intel ICH7/ICH7R", enabling flash write... OK. Found chip "Winbond W25x80" (1024 KB) at physical address 0xfff00000. === This flash part has status UNTESTED for operations: PROBE READ ERASE WRITE Please email a report to flashrom at coreboot.org if any of the above operations work correctly for you with this flash part. Please include the full output from the program, including chipset found. Thank you for your help! === Flash image seems to be a legacy BIOS. Disabling checks. Programming page: DONE BLOCK 0x0 DONE BLOCK 0x10000 DONE BLOCK 0x20000 DONE BLOCK 0x30000 DONE BLOCK 0x40000 DONE BLOCK 0x50000 DONE BLOCK 0x60000 DONE BLOCK 0x70000 DONE BLOCK 0x80000 DONE BLOCK 0x90000 DONE BLOCK 0xa0000 DONE BLOCK 0xb0000 DONE BLOCK 0xc0000 DONE BLOCK 0xd0000 DONE BLOCK 0xe0000 DONE BLOCK 0xf0000 Verifying flash... VERIFIED. Best Regards Bj?rn -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (MingW32) iD8DBQFIbLmicF0qh1XQxhgRAqP8AKCyrtm6529RWp9IQD4c5rnxStzw5wCcD6xz X21IQH7DYQ/18KBsXBs0u2w= =yR7O -----END PGP SIGNATURE----- -- WINCOR NIXDORF International GmbH Sitz der Gesellschaft: Paderborn Registergericht Paderborn HRB 3507 Gesch?ftsf?hrer: Eckard Heidloff (Vorsitzender), Stefan Auerbach, Dr. J?rgen Wunram Vorsitzender des Aufsichtsrats: Karl-Heinz Stiller Steuernummer: 339/5884/0020 - Ust-ID Nr.: DE812927716 - WEEE-Reg.-Nr. DE44477193 Diese E-Mail enth?lt vertrauliche Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrt?mlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser E-Mail ist nicht gestattet. This e-mail may contain confidential information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden. From joe at settoplinux.org Thu Jul 3 14:45:15 2008 From: joe at settoplinux.org (Joseph Smith) Date: Thu, 03 Jul 2008 08:45:15 -0400 Subject: [coreboot] USB debug cables and emulation In-Reply-To: <AA28F077645B324881335614E4F7C4284A4954@win-ex01.bench.com> References: <AA28F077645B324881335614E4F7C4284A4954@win-ex01.bench.com> Message-ID: <aa908b5795d8db20e9f32c94700cc949@imap.1and1.com> >>> Here's an old USB Debug Port presentation that may be useful to >>> those new to the concept: >>> >>> http://www.usb.org/developers/presentations/pres0602/john_keys.pdf >>> >>> Is the NET20DC really the only USB Debug Device available? I tried >>> searching for others, but didn't find any. >>> >>> >> I think the design might become easier if you just create the debug >> part of the device and use the serial side of a plain usbserial >> device as direct interface. > Actually I suggested something along those lines already in the wiki > page. :) Well it looks like in the pdf presentation above they have a Serial->USB debugger. It looks like a development board though because there are a bunch of unnecessary stuff on it. I'm thinking a Serial->USB debugger is the way to go to keep the costs down, and it gives the terminal PC (serial end) more flexability. If one wanted to have it USB on both ends they could always use a USB->Serial adapter for the terminal PC (serial end). Also, this way there would be no need for any kind of a special driver for windows/linux, it would just show up as a serial communications device. Any suggestions, questions, comments? -- Thanks, Joseph Smith Set-Top-Linux www.settoplinux.org From c-d.hailfinger.devel.2006 at gmx.net Thu Jul 3 16:09:28 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Thu, 03 Jul 2008 16:09:28 +0200 Subject: [coreboot] flashrom with Winbond W25x80 - Testreport In-Reply-To: <5E5D87015BF8A54A93DAD6F808B1129AAE0954@DEEXVS13.wincor-nixdorf.com> References: <5E5D87015BF8A54A93DAD6F808B1129AAE0954@DEEXVS13.wincor-nixdorf.com> Message-ID: <486CDD98.5090107@gmx.net> Hi Bj?rn, could you please test the attached patch as well? It's the final fix I hope to commit. Thanks! Regards, Carl-Daniel -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: flashrom_layout_better_coreboot_heuristic.diff URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20080703/0e59713c/attachment.ksh> From svn at coreboot.org Thu Jul 3 16:12:07 2008 From: svn at coreboot.org (coreboot) Date: Thu, 03 Jul 2008 14:12:07 -0000 Subject: [coreboot] #102: flashrom: coreboot ROM image file identification heuristic is broken In-Reply-To: <041.d02ed69d3d641142e64c5b79feb8cb4e@coreboot.org> References: <041.d02ed69d3d641142e64c5b79feb8cb4e@coreboot.org> Message-ID: <050.7df778992a2ce96a5d5c98bf341fa6eb@coreboot.org> #102: flashrom: coreboot ROM image file identification heuristic is broken -------------------------+-------------------------------------------------- Reporter: stuge | Owner: somebody Type: defect | Status: new Priority: blocker | Milestone: flashrom v1.0 Component: flashrom | Version: Resolution: | Keywords: rom image heuristic Dependencies: | Patchstatus: patch needs work -------------------------+-------------------------------------------------- Comment(by hailfinger): New proposed heuristic. This should be almost foolproof. -- Ticket URL: <http://tracker.coreboot.org/trac/coreboot/ticket/102#comment:1> coreboot <http://www.coreboot.org/> From svn at coreboot.org Thu Jul 3 16:12:47 2008 From: svn at coreboot.org (coreboot) Date: Thu, 03 Jul 2008 14:12:47 -0000 Subject: [coreboot] #102: flashrom: coreboot ROM image file identification heuristic is broken In-Reply-To: <041.d02ed69d3d641142e64c5b79feb8cb4e@coreboot.org> References: <041.d02ed69d3d641142e64c5b79feb8cb4e@coreboot.org> Message-ID: <050.8ea1a5b100a6cb95093a52614fae199b@coreboot.org> #102: flashrom: coreboot ROM image file identification heuristic is broken -------------------------+-------------------------------------------------- Reporter: stuge | Owner: somebody Type: defect | Status: new Priority: blocker | Milestone: flashrom v1.0 Component: flashrom | Version: Resolution: | Keywords: rom image heuristic Dependencies: | Patchstatus: patch needs review -------------------------+-------------------------------------------------- Changes (by hailfinger): * patchstatus: patch needs work => patch needs review -- Ticket URL: <http://tracker.coreboot.org/trac/coreboot/ticket/102#comment:2> coreboot <http://www.coreboot.org/> From hansolofalcon at worldnet.att.net Thu Jul 3 16:19:36 2008 From: hansolofalcon at worldnet.att.net (Gregg C Levine) Date: Thu, 3 Jul 2008 10:19:36 -0400 Subject: [coreboot] USB Debug support In-Reply-To: <20080702122748.3011.qmail@stuge.se> Message-ID: <000001c8dd17$d46ba5b0$6401a8c0@who8> Hello! (Duplicated message.) Okay. Thank you folks for breaking down the complexity of this issue. I didn't want to go into the complexity of that logic area that the parts are wearing as I've been given to understand from reading the message traffic on the Linux-USB regarding gadgets that this is indeed a moving target. Now as to obtaining that Net20DC gizmo, well I'm not that closer to doing that. I've not chosen my target, nor decided how far I want to dig into things. Ideally there's a list of things I want to work on, or will be RSN, and naturally one of them does include your notes regarding the configuration of the bridges. As for the reading (and understanding) of the documentation from the site, and the USB group, that's first on the list. I am resending this just to the list because it still hasn't arrived that way. Peter if you've got a complaint, or even a comment please do so in the usual fashion. -- Gregg C Levine hansolofalcon at worldnet.att.net "The Force will be with you always." Obi-Wan Kenobi ? > -----Original Message----- > From: coreboot-bounces at coreboot.org [mailto:coreboot-bounces at coreboot.org] On > Behalf Of Peter Stuge > Sent: Wednesday, July 02, 2008 8:28 AM > To: Coreboot > Subject: Re: [coreboot] USB Debug support > > Hi, > > On Wed, Jul 02, 2008 at 07:45:25AM -0400, Gregg C Levine wrote: > > A USB cable configured to connect two systems together, such as a > > laptop to receive files from a desktop is simply two USB-A cables > > wired to an appropriate logic array. This would (Or "should be". > > Either way) probably be the latest generation in USB Gadget > > hardware. > > Yes. But the logic "array" is quite complex, and implements several > layers of protocol. Please look at chapters 5, 8 and 9 in the USB > specification for a description of the protocol. > > > > Ideally a Linux system can use this to talk to an appropriately > > configured system, provided the target was built using the debug > > features turned on for the USB stack layer. > > Not enough. These are the hardware requirements: > > * The target USB controller must be EHCI > * The target USB controller must implement the optional Debug Port > * The target board must have a USB connector for the physical port > that supports Debug Port. It is always only one particular port. > * The "cable" must implement the Debug Device functional > specification. See links on http://coreboot.org/EHCI_Debug_Port > > > > While I have here hardware for trying out this idea, namely my > > Linux development station, I have not as yet chosen a target. > > You will also need the debug device. I suggest ordering the NET20DC > product from semiconductorstore.com. > > > //Peter > > -- > coreboot mailing list > coreboot at coreboot.org > http://www.coreboot.org/mailman/listinfo/coreboot From c-d.hailfinger.devel.2006 at gmx.net Thu Jul 3 16:28:54 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Thu, 03 Jul 2008 16:28:54 +0200 Subject: [coreboot] [PATCH] flashrom: Improve coreboot image detection heuristic Message-ID: <486CE226.1010200@gmx.net> Improve coreboot image detection heuristic in flashrom. It's not absolutely perfect, but the likelihood of this check to fail is 0.000000000000000000000000013 (1.3*10^-26) which is good enough for me. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net> Index: flashrom-tmp1/layout.c =================================================================== --- flashrom-tmp1/layout.c (Revision 3407) +++ flashrom-tmp1/layout.c (Arbeitskopie) @@ -21,6 +21,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <ctype.h> #include <stdint.h> #include "flash.h" @@ -57,7 +58,18 @@ walk--; } - if ((*walk) == 0 || ((*walk) & 0x3ff) != 0) { + /* + * Check if coreboot last image size is 0 or not a multiple of 1k or + * bigger than the chip or if the pointers to vendor ID or mainboard ID + * are outside the image of if the start of ID strings are nonsensical + * (nonprintable and not \0). + */ + if ((*walk) == 0 || ((*walk) & 0x3ff) != 0 || *walk > size || + *(walk - 1) > size || *(walk - 2) > size || + (!isprint((const char *)(bios + size - *(walk - 1))) && + ((const char *)(bios + size - *(walk - 1)))) || + (!isprint((const char *)(bios + size - *(walk - 2))) && + ((const char *)(bios + size - *(walk - 2))))) { printf("Flash image seems to be a legacy BIOS. Disabling checks.\n"); mainboard_vendor = def_name; mainboard_part = def_name; -- http://www.hailfinger.org/ From stepan at coresystems.de Thu Jul 3 16:37:40 2008 From: stepan at coresystems.de (Stefan Reinauer) Date: Thu, 03 Jul 2008 16:37:40 +0200 Subject: [coreboot] [PATCH] flashrom: Improve coreboot image detection heuristic In-Reply-To: <486CE226.1010200@gmx.net> References: <486CE226.1010200@gmx.net> Message-ID: <486CE434.8050706@coresystems.de> Carl-Daniel Hailfinger wrote: > Improve coreboot image detection heuristic in flashrom. It's not > absolutely perfect, but the likelihood of this check to fail is > 0.000000000000000000000000013 (1.3*10^-26) which is good enough for me. > I think at some point we should go to a better concept of doing things, but it seems what you are saying is that your code will probably not fail on any bios that has been developed to date, as I doubt it is more than 10^26 bioses. Acked-by: Stefan Reinauer <stepan at coresystems.de> > Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net> > > Index: flashrom-tmp1/layout.c > =================================================================== > --- flashrom-tmp1/layout.c (Revision 3407) > +++ flashrom-tmp1/layout.c (Arbeitskopie) > @@ -21,6 +21,7 @@ > #include <stdio.h> > #include <stdlib.h> > #include <string.h> > +#include <ctype.h> > #include <stdint.h> > #include "flash.h" > > @@ -57,7 +58,18 @@ > walk--; > } > > - if ((*walk) == 0 || ((*walk) & 0x3ff) != 0) { > + /* > + * Check if coreboot last image size is 0 or not a multiple of 1k or > + * bigger than the chip or if the pointers to vendor ID or mainboard ID > + * are outside the image of if the start of ID strings are nonsensical > + * (nonprintable and not \0). > + */ > + if ((*walk) == 0 || ((*walk) & 0x3ff) != 0 || *walk > size || > + *(walk - 1) > size || *(walk - 2) > size || > + (!isprint((const char *)(bios + size - *(walk - 1))) && > + ((const char *)(bios + size - *(walk - 1)))) || > + (!isprint((const char *)(bios + size - *(walk - 2))) && > + ((const char *)(bios + size - *(walk - 2))))) { > printf("Flash image seems to be a legacy BIOS. Disabling checks.\n"); > mainboard_vendor = def_name; > mainboard_part = def_name; > > > -- coresystems GmbH ? Brahmsstr. 16 ? D-79104 Freiburg i. Br. Tel.: +49 761 7668825 ? Fax: +49 761 7664613 Email: info at coresystems.de ? http://www.coresystems.de/ Registergericht: Amtsgericht Freiburg ? HRB 7656 Gesch?ftsf?hrer: Stefan Reinauer ? Ust-IdNr.: DE245674866 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 249 bytes Desc: OpenPGP digital signature URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20080703/72e01870/attachment.sig> From svn at coreboot.org Thu Jul 3 16:40:07 2008 From: svn at coreboot.org (svn at coreboot.org) Date: Thu, 3 Jul 2008 16:40:07 +0200 Subject: [coreboot] r3408 - trunk/util/flashrom Message-ID: <mailman.1680.1355071340.16123.coreboot@coreboot.org> Author: hailfinger Date: 2008-07-03 16:40:06 +0200 (Thu, 03 Jul 2008) New Revision: 3408 Modified: trunk/util/flashrom/layout.c Log: Improve coreboot image detection heuristic in flashrom. It's not absolutely perfect, but the likelihood of this check to fail is 0.000000000000000000000000013 (1.3*10^-26) which is good enough for me. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net> Acked-by: Stefan Reinauer <stepan at coresystems.de> Modified: trunk/util/flashrom/layout.c =================================================================== --- trunk/util/flashrom/layout.c 2008-07-02 17:15:47 UTC (rev 3407) +++ trunk/util/flashrom/layout.c 2008-07-03 14:40:06 UTC (rev 3408) @@ -21,6 +21,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <ctype.h> #include <stdint.h> #include "flash.h" @@ -57,7 +58,18 @@ walk--; } - if ((*walk) == 0 || ((*walk) & 0x3ff) != 0) { + /* + * Check if coreboot last image size is 0 or not a multiple of 1k or + * bigger than the chip or if the pointers to vendor ID or mainboard ID + * are outside the image of if the start of ID strings are nonsensical + * (nonprintable and not \0). + */ + if ((*walk) == 0 || ((*walk) & 0x3ff) != 0 || *walk > size || + *(walk - 1) > size || *(walk - 2) > size || + (!isprint((const char *)(bios + size - *(walk - 1))) && + ((const char *)(bios + size - *(walk - 1)))) || + (!isprint((const char *)(bios + size - *(walk - 2))) && + ((const char *)(bios + size - *(walk - 2))))) { printf("Flash image seems to be a legacy BIOS. Disabling checks.\n"); mainboard_vendor = def_name; mainboard_part = def_name; From c-d.hailfinger.devel.2006 at gmx.net Thu Jul 3 16:42:39 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Thu, 03 Jul 2008 16:42:39 +0200 Subject: [coreboot] [PATCH] flashrom: Improve coreboot image detection heuristic In-Reply-To: <486CE434.8050706@coresystems.de> References: <486CE226.1010200@gmx.net> <486CE434.8050706@coresystems.de> Message-ID: <486CE55F.3090107@gmx.net> On 03.07.2008 16:37, Stefan Reinauer wrote: > Carl-Daniel Hailfinger wrote: >> Improve coreboot image detection heuristic in flashrom. It's not >> absolutely perfect, but the likelihood of this check to fail is >> 0.000000000000000000000000013 (1.3*10^-26) which is good enough for me. > > I think at some point we should go to a better concept of doing > things, but it seems what you are saying is that your code will > probably not fail on any bios that has been developed to date, as I > doubt it is more than 10^26 bioses. I calculated the likelihood of a false positive detection of coreboot for a random image. All reports we got about segfaults will be fixed as well, so I'm reasonably positive this bandaid will last. > Acked-by: Stefan Reinauer <stepan at coresystems.de> Thanks, r3408. Regards, Carl-Daniel -- http://www.hailfinger.org/ From c-d.hailfinger.devel.2006 at gmx.net Thu Jul 3 16:47:57 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Thu, 03 Jul 2008 16:47:57 +0200 Subject: [coreboot] [PATCH] [RFC] v3: CS5536 cleanup In-Reply-To: <4846C7BD.5050601@gmx.net> References: <48205A47.5060403@gmx.net> <4822458B.4030506@gmx.net> <13426df10805071751p7adb40c8s759875e09ccee15@mail.gmail.com> <48468AB6.5060605@gmx.net> <13426df10806040753y17eeb1f1q73319c0c82e00fc2@mail.gmail.com> <4846C7BD.5050601@gmx.net> Message-ID: <486CE69D.1080708@gmx.net> New iteration. - Clean up Geode companion chip CS5536 code. - Eliminate a few redundant dev_find_pci_device() calls. - Fix a compile warning intruduced in r689. This should be an equivalence transformation. Build tested on norwich, db800, alix.1c, alix.2c3, dbe62, dbe61. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net> Index: LinuxBIOSv3-tmp3/southbridge/amd/cs5536/cs5536.c =================================================================== --- LinuxBIOSv3-tmp3/southbridge/amd/cs5536/cs5536.c (Revision 691) +++ LinuxBIOSv3-tmp3/southbridge/amd/cs5536/cs5536.c (Arbeitskopie) @@ -240,16 +240,13 @@ * * @param sb Southbridge config structure. */ -static void uarts_init(struct southbridge_amd_cs5536_dts_config *sb) +static void uarts_init(struct southbridge_amd_cs5536_dts_config *sb, + struct device *dev) { struct msr msr; u16 addr = 0; u32 gpio_addr; - struct device *dev; - dev = dev_find_pci_device(PCI_VENDOR_ID_AMD, - PCI_DEVICE_ID_AMD_CS5536_ISA, 0); - gpio_addr = pci_read_config32(dev, PCI_BASE_ADDRESS_1); gpio_addr &= ~1; /* Clear I/O bit */ printk(BIOS_DEBUG, "GPIO_ADDR: %08X\n", gpio_addr); @@ -419,11 +416,11 @@ { u32 *bar; struct msr msr; - struct device *dev; + struct device *ehci_dev, *otg_dev, *udc_dev; - dev = dev_find_pci_device(PCI_VENDOR_ID_AMD, + ehci_dev = dev_find_pci_device(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CS5536_EHCI, 0); - if (dev) { + if (ehci_dev) { /* Serial short detect enable */ msr = rdmsr(USB2_SB_GLD_MSR_CONF); msr.hi |= USB2_UPPER_SSDEN_SET; @@ -432,7 +429,7 @@ /* Write to clear diag register. */ wrmsr(USB2_SB_GLD_MSR_DIAG, rdmsr(USB2_SB_GLD_MSR_DIAG)); - bar = (u32 *) pci_read_config32(dev, PCI_BASE_ADDRESS_0); + bar = (u32 *) pci_read_config32(ehci_dev, PCI_BASE_ADDRESS_0); /* Make HCCPARAMS writable. */ *(bar + IPREG04) |= USB_HCCPW_SET; @@ -441,10 +438,10 @@ *(bar + HCCPARAMS) = 0x00005012; } - dev = dev_find_pci_device(PCI_VENDOR_ID_AMD, + otg_dev = dev_find_pci_device(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CS5536_OTG, 0); - if (dev) { - bar = (u32 *) pci_read_config32(dev, PCI_BASE_ADDRESS_0); + if (otg_dev) { + bar = (u32 *) pci_read_config32(otg_dev, PCI_BASE_ADDRESS_0); printk(BIOS_DEBUG, "UOCMUX is %x\n", *(bar + UOCMUX)); @@ -470,6 +467,8 @@ } + udc_dev = dev_find_pci_device(PCI_VENDOR_ID_AMD, + PCI_DEVICE_ID_AMD_CS5536_UDC, 0); /* PBz#6466: If the UOC(OTG) device, port 4, is configured as a * device, then perform the following sequence: * - Set SD bit in DEVCTRL udc register @@ -477,24 +476,19 @@ * - Set APU bit in uoc register */ if (sb->enable_USBP4_device) { - dev = dev_find_pci_device(PCI_VENDOR_ID_AMD, - PCI_DEVICE_ID_AMD_CS5536_UDC, 0); - if (dev) { - bar = (u32 *)pci_read_config32(dev, PCI_BASE_ADDRESS_0); + if (udc_dev) { + bar = (u32 *)pci_read_config32(udc_dev, PCI_BASE_ADDRESS_0); *(bar + UDCDEVCTL) |= UDC_SD_SET; } - dev = dev_find_pci_device(PCI_VENDOR_ID_AMD, - PCI_DEVICE_ID_AMD_CS5536_OTG, 0); - if (dev) { - bar = (u32 *)pci_read_config32(dev, PCI_BASE_ADDRESS_0); + if (otg_dev) { + bar = (u32 *)pci_read_config32(otg_dev, PCI_BASE_ADDRESS_0); *(bar + UOCCTL) |= PADEN_SET; *(bar + UOCCAP) |= APU_SET; + printk(BIOS_DEBUG, "UOCCTL is %x\n", *(bar + UOCCTL)); } } - printk(BIOS_DEBUG, "UOCCTL is %x\n", *(bar + UOCCTL)); - /* Disable virtual PCI UDC and OTG headers. The kernel never * sees a header for this device. It used to provide an OS * visible device, but that was defeatured. There are still @@ -506,15 +500,11 @@ * device ID PCI_DEVICE_ID_AMD_CS5536_OTG, but it is hidden * when 0xDEADBEEF is written to config space register 0x7C. */ - dev = dev_find_pci_device(PCI_VENDOR_ID_AMD, - PCI_DEVICE_ID_AMD_CS5536_UDC, 0); - if (dev) - pci_write_config32(dev, 0x7C, 0xDEADBEEF); + if (udc_dev) + pci_write_config32(udc_dev, 0x7C, 0xDEADBEEF); - dev = dev_find_pci_device(PCI_VENDOR_ID_AMD, - PCI_DEVICE_ID_AMD_CS5536_OTG, 0); - if (dev) - pci_write_config32(dev, 0x7C, 0xDEADBEEF); + if (otg_dev) + pci_write_config32(otg_dev, 0x7C, 0xDEADBEEF); } /** @@ -659,7 +649,7 @@ setup_i8259(); lpc_init(sb); - uarts_init(sb); + uarts_init(sb, dev); if (sb->enable_gpio_int_route) { printk(BIOS_SPEW, "cs5536: call vr_write\n"); Regards, Carl-Daniel -- http://www.hailfinger.org/ From bjoern.gerhart at wincor-nixdorf.com Thu Jul 3 16:49:22 2008 From: bjoern.gerhart at wincor-nixdorf.com (Gerhart, Bjoern) Date: Thu, 3 Jul 2008 16:49:22 +0200 Subject: [coreboot] flashrom with Winbond W25x80 - Testreport In-Reply-To: <486CDD98.5090107@gmx.net> References: <5E5D87015BF8A54A93DAD6F808B1129AAE0954@DEEXVS13.wincor-nixdorf.com> <486CDD98.5090107@gmx.net> Message-ID: <5E5D87015BF8A54A93DAD6F808B1129AAE09C6@DEEXVS13.wincor-nixdorf.com> Hi Carl-Daniel, thanks for posting the patch. With your fix the issue is solved - we can successfully write the image back into the chip :-) Best Regards Bj?rn > -----Original Message----- > From: Carl-Daniel Hailfinger > [mailto:c-d.hailfinger.devel.2006 at gmx.net] > Sent: Thursday, July 03, 2008 4:09 PM > To: Gerhart, Bjoern > Cc: coreboot at coreboot.org; de Vos, Niels > Subject: Re: [coreboot] flashrom with Winbond W25x80 - Testreport > > Hi Bj?rn, > > could you please test the attached patch as well? It's the final fix I > hope to commit. > Thanks! > > Regards, > Carl-Daniel > -- WINCOR NIXDORF International GmbH Sitz der Gesellschaft: Paderborn Registergericht Paderborn HRB 3507 Gesch?ftsf?hrer: Eckard Heidloff (Vorsitzender), Stefan Auerbach, Dr. J?rgen Wunram Vorsitzender des Aufsichtsrats: Karl-Heinz Stiller Steuernummer: 339/5884/0020 - Ust-ID Nr.: DE812927716 - WEEE-Reg.-Nr. DE44477193 Diese E-Mail enth?lt vertrauliche Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrt?mlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser E-Mail ist nicht gestattet. This e-mail may contain confidential information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden. From svn at coreboot.org Thu Jul 3 16:53:12 2008 From: svn at coreboot.org (coreboot) Date: Thu, 03 Jul 2008 14:53:12 -0000 Subject: [coreboot] #102: flashrom: coreboot ROM image file identification heuristic is broken In-Reply-To: <041.d02ed69d3d641142e64c5b79feb8cb4e@coreboot.org> References: <041.d02ed69d3d641142e64c5b79feb8cb4e@coreboot.org> Message-ID: <050.4016167936206c38bdd63ab693eaa87a@coreboot.org> #102: flashrom: coreboot ROM image file identification heuristic is broken -------------------------+-------------------------------------------------- Reporter: stuge | Owner: somebody Type: defect | Status: closed Priority: blocker | Milestone: flashrom v1.0 Component: flashrom | Version: Resolution: fixed | Keywords: rom image heuristic Dependencies: | Patchstatus: patch has been committed -------------------------+-------------------------------------------------- Changes (by hailfinger): * status: new => closed * patchstatus: patch needs review => patch has been committed * resolution: => fixed -- Ticket URL: <http://tracker.coreboot.org/trac/coreboot/ticket/102#comment:3> coreboot <http://www.coreboot.org/> From tsylla at gmail.com Thu Jul 3 16:55:45 2008 From: tsylla at gmail.com (Tom Sylla) Date: Thu, 3 Jul 2008 10:55:45 -0400 Subject: [coreboot] USB debug cables and emulation In-Reply-To: <aa908b5795d8db20e9f32c94700cc949@imap.1and1.com> References: <AA28F077645B324881335614E4F7C4284A4954@win-ex01.bench.com> <aa908b5795d8db20e9f32c94700cc949@imap.1and1.com> Message-ID: <57947bf80807030755o741a9936w6ac854289bb31970@mail.gmail.com> On Thu, Jul 3, 2008 at 8:45 AM, Joseph Smith <joe at settoplinux.org> wrote: > Well it looks like in the pdf presentation above they have a Serial->USB > debugger. It looks like a development board though because there are a > bunch of unnecessary stuff on it. I'm thinking a Serial->USB debugger is > the way to go to keep the costs down, and it gives the terminal PC (serial > end) more flexability. If one wanted to have it USB on both ends they could > always use a USB->Serial adapter for the terminal PC (serial end). Also, > this way there would be no need for any kind of a special driver for > windows/linux, it would just show up as a serial communications device. Any > suggestions, questions, comments? I think I am still a bit confused about your goal. A Net20DC is ~$90 right now. You aren't going to be able to take some off-the-shelf USB-Serial adapter and make it into a debug device. Those adapters use fixed-function USB-Serial ICs that are cheap and small. You can't re-program the firmware to make them into debug devices. If you buy a development kit with an appropriate IC and allows you to develop the firmware, you will easily be at $90 or above. To make a replacement, you need: Net2272 (or equivalent, Cypress, etc) ~$10 "host side" interface chip ~$5 ($5 for serial, USB would be ~10 instead) Connectors, SEEP, passives, etc $10 PCB $20 So, $50 *cost* (and the above numbers are very best-case). Then you need to assemble and test your board, develop the firmware for the USB debug Device, and possibly the firmware for the host-side interface. (Please don't try and argue less than $20 for a PCB, for your quantities, that is what it will be) Even if you consider all of your time "free", you still are comparing $50 to $90. If you could sell a USB debug cable for $20, it would make sense. If the Net20DC was $200, it would make sense. Otherwise, I am not so sure. Am I missing something? From c-d.hailfinger.devel.2006 at gmx.net Thu Jul 3 17:03:11 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Thu, 03 Jul 2008 17:03:11 +0200 Subject: [coreboot] flashrom with Winbond W25x80 - Testreport In-Reply-To: <5E5D87015BF8A54A93DAD6F808B1129AAE09C6@DEEXVS13.wincor-nixdorf.com> References: <5E5D87015BF8A54A93DAD6F808B1129AAE0954@DEEXVS13.wincor-nixdorf.com> <486CDD98.5090107@gmx.net> <5E5D87015BF8A54A93DAD6F808B1129AAE09C6@DEEXVS13.wincor-nixdorf.com> Message-ID: <486CEA2F.5060707@gmx.net> Hi Bj?rn, thanks for testing and confirming this. The patch has been committed to the flashrom tree and everything should work out of the box for you. We are very happy to see vendors use flashrom. If there are any remaining issues, please tell us. Best Regards, Carl-Daniel From bjoern.gerhart at wincor-nixdorf.com Thu Jul 3 17:36:13 2008 From: bjoern.gerhart at wincor-nixdorf.com (Gerhart, Bjoern) Date: Thu, 3 Jul 2008 17:36:13 +0200 Subject: [coreboot] flashrom with Winbond W25x80 - Testreport In-Reply-To: <486CEA2F.5060707@gmx.net> References: <5E5D87015BF8A54A93DAD6F808B1129AAE0954@DEEXVS13.wincor-nixdorf.com> <486CDD98.5090107@gmx.net> <5E5D87015BF8A54A93DAD6F808B1129AAE09C6@DEEXVS13.wincor-nixdorf.com> <486CEA2F.5060707@gmx.net> Message-ID: <5E5D87015BF8A54A93DAD6F808B1129AAE09E8@DEEXVS13.wincor-nixdorf.com> Hi Carl-Daniel, at the moment we are in evaluation phase of flashrom. We test it on our different mainboards and flash chips to check if it meets our needs, before it comes to operation at the customer's side. I'll tell you if we encounter further issues. Best Ragards Bj?rn > -----Original Message----- > From: Carl-Daniel Hailfinger > [mailto:c-d.hailfinger.devel.2006 at gmx.net] > Sent: Thursday, July 03, 2008 5:03 PM > To: Gerhart, Bjoern > Cc: coreboot at coreboot.org; de Vos, Niels > Subject: Re: [coreboot] flashrom with Winbond W25x80 - Testreport > > Hi Bj?rn, > > thanks for testing and confirming this. The patch has been > committed to > the flashrom tree and everything should work out of the box for you. > We are very happy to see vendors use flashrom. If there are any > remaining issues, please tell us. > > Best Regards, > Carl-Daniel > -- WINCOR NIXDORF International GmbH Sitz der Gesellschaft: Paderborn Registergericht Paderborn HRB 3507 Gesch?ftsf?hrer: Eckard Heidloff (Vorsitzender), Stefan Auerbach, Dr. J?rgen Wunram Vorsitzender des Aufsichtsrats: Karl-Heinz Stiller Steuernummer: 339/5884/0020 - Ust-ID Nr.: DE812927716 - WEEE-Reg.-Nr. DE44477193 Diese E-Mail enth?lt vertrauliche Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrt?mlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser E-Mail ist nicht gestattet. This e-mail may contain confidential information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden. From joe at settoplinux.org Thu Jul 3 18:28:47 2008 From: joe at settoplinux.org (Joseph Smith) Date: Thu, 3 Jul 2008 12:28:47 -0400 Subject: [coreboot] USB debug cables and emulation In-Reply-To: <57947bf80807030755o741a9936w6ac854289bb31970@mail.gmail.com> References: <AA28F077645B324881335614E4F7C4284A4954@win-ex01.bench.com><aa908b5795d8db20e9f32c94700cc949@imap.1and1.com> <57947bf80807030755o741a9936w6ac854289bb31970@mail.gmail.com> Message-ID: <2A9397B0A1294D5EB3113DFD65C04686@smitty2m> > -----Original Message----- > From: coreboot-bounces at coreboot.org [mailto:coreboot-bounces at coreboot.org] > On Behalf Of Tom Sylla > Sent: Thursday, July 03, 2008 10:56 AM > To: Joseph Smith > Cc: stepan at coresystems.de; Ken.Fuchs at bench.com; c- > d.hailfinger.devel.2006 at gmx.net; coreboot at coreboot.org > Subject: Re: [coreboot] USB debug cables and emulation > > On Thu, Jul 3, 2008 at 8:45 AM, Joseph Smith <joe at settoplinux.org> wrote: > > Well it looks like in the pdf presentation above they have a Serial->USB > > debugger. It looks like a development board though because there are a > > bunch of unnecessary stuff on it. I'm thinking a Serial->USB debugger is > > the way to go to keep the costs down, and it gives the terminal PC > (serial > > end) more flexability. If one wanted to have it USB on both ends they > could > > always use a USB->Serial adapter for the terminal PC (serial end). Also, > > this way there would be no need for any kind of a special driver for > > windows/linux, it would just show up as a serial communications device. > Any > > suggestions, questions, comments? > > I think I am still a bit confused about your goal. > > A Net20DC is ~$90 right now. > > You aren't going to be able to take some off-the-shelf USB-Serial > adapter and make it into a debug device. Those adapters use > fixed-function USB-Serial ICs that are cheap and small. You can't > re-program the firmware to make them into debug devices. If you buy a > development kit with an appropriate IC and allows you to develop the > firmware, you will easily be at $90 or above. > > To make a replacement, you need: > Net2272 (or equivalent, Cypress, etc) ~$10 > "host side" interface chip ~$5 ($5 for serial, USB would be ~10 instead) > Connectors, SEEP, passives, etc $10 > PCB $20 > > So, $50 *cost* (and the above numbers are very best-case). Then you > need to assemble and test your board, develop the firmware for the USB > debug Device, and possibly the firmware for the host-side interface. > (Please don't try and argue less than $20 for a PCB, for your > quantities, that is what it will be) > > Even if you consider all of your time "free", you still are comparing > $50 to $90. > > If you could sell a USB debug cable for $20, it would make sense. If > the Net20DC was $200, it would make sense. Otherwise, I am not so > sure. Am I missing something? > I guess you don't get it. I am not doing it to mass produce and sell at a lower cost. I don't really care about any kind of profit. I'm simply doing it for a "HOWTO build your own USB 2.0 Debugger For Around 20 Dollars". $20 Dollars for a PCB??? I am going to use a generic PCB you can pick up at radio shack for 2 dollars. If I have to get some of the components at a larger volume to get a cheaper price and re-sell them to interested parties so they get a cheaper price I will. This is more for educational, learning, and teaching purposes. Everything is not about money you know (or not) :-( Thanks, Joseph Smith Set-Top-Linux www.settoplinux.org From mylesgw at gmail.com Thu Jul 3 18:42:38 2008 From: mylesgw at gmail.com (Myles Watson) Date: Thu, 3 Jul 2008 10:42:38 -0600 Subject: [coreboot] help with win-xp and legacybios/coreboot In-Reply-To: <20080703032147.GA31076@morn.localdomain> References: <20080628174539.GB11061@morn.localdomain> <2831fecf0807011536t16304457q9041f0d5b8461d28@mail.gmail.com> <20080703032147.GA31076@morn.localdomain> Message-ID: <001501c8dd2b$ce8bcda0$0023040a@chimp> Kevin, > > I must be missing something, because my boot fails with this message > > on my s2892: > [...] > > move mptable from 0x20 to 0xfffffc00, size 0xdff03e0 > > That message should never occur if one were to apply the patch in the > email from the url above. Basically, the mptabling moving should have > gotten disabled by the '#if 0' change. Yep, I bungled the patch. I'm trying it again. > > BTW: when I was trying to get XP to boot before, I was having timing > > problems. Have you tested the timer tick with factory BIOS and > > coreboot? > > As far as I know it works - SeaBIOS will enable the timer during its > post stage. Great. I'll let you know. Thanks, Myles From peter at stuge.se Thu Jul 3 18:46:15 2008 From: peter at stuge.se (Peter Stuge) Date: Thu, 3 Jul 2008 18:46:15 +0200 Subject: [coreboot] [PATCH] flashrom: Improve coreboot image detection heuristic In-Reply-To: <486CE226.1010200@gmx.net> References: <486CE226.1010200@gmx.net> Message-ID: <20080703164615.32201.qmail@stuge.se> On Thu, Jul 03, 2008 at 04:28:54PM +0200, Carl-Daniel Hailfinger wrote: > + if ((*walk) == 0 || ((*walk) & 0x3ff) != 0 || *walk > size || > + *(walk - 1) > size || *(walk - 2) > size || > + (!isprint((const char *)(bios + size - *(walk - 1))) && > + ((const char *)(bios + size - *(walk - 1)))) || > + (!isprint((const char *)(bios + size - *(walk - 2))) && > + ((const char *)(bios + size - *(walk - 2))))) { I am in total disbelief. I should probably not be wasting any more of my time on cleanups and restructuring. But let's discuss a technical aspect. Hhow does this new heuristic relate to v3 larballs? //Peter From svn at coreboot.org Thu Jul 3 18:54:06 2008 From: svn at coreboot.org (svn at coreboot.org) Date: Thu, 3 Jul 2008 18:54:06 +0200 Subject: [coreboot] r3409 - trunk/util/flashrom Message-ID: <mailman.1681.1355071340.16123.coreboot@coreboot.org> Author: stuge Date: 2008-07-03 18:54:05 +0200 (Thu, 03 Jul 2008) New Revision: 3409 Modified: trunk/util/flashrom/flashchips.c Log: flashrom: Winbond W25x80 TEST_OK PROBE READ ERASE WRITE Per test report from Bj?\195?\182rn Gerhart. Thanks! Signed-off-by: Peter Stuge <peter at stuge.se> Acked-by: Peter Stuge <peter at stuge.se> Modified: trunk/util/flashrom/flashchips.c =================================================================== --- trunk/util/flashrom/flashchips.c 2008-07-03 14:40:06 UTC (rev 3408) +++ trunk/util/flashrom/flashchips.c 2008-07-03 16:54:05 UTC (rev 3409) @@ -123,7 +123,7 @@ {"Winbond", "W25x10", WINBOND_NEX_ID, W_25X10, 128, 256, TEST_UNTESTED, probe_spi_rdid, spi_chip_erase_c7, spi_chip_write, spi_chip_read}, {"Winbond", "W25x20", WINBOND_NEX_ID, W_25X20, 256, 256, TEST_UNTESTED, probe_spi_rdid, spi_chip_erase_c7, spi_chip_write, spi_chip_read}, {"Winbond", "W25x40", WINBOND_NEX_ID, W_25X40, 512, 256, TEST_OK_PREW, probe_spi_rdid, spi_chip_erase_c7, spi_chip_write, spi_chip_read}, - {"Winbond", "W25x80", WINBOND_NEX_ID, W_25X80, 1024, 256, TEST_UNTESTED, probe_spi_rdid, spi_chip_erase_c7, spi_chip_write, spi_chip_read}, + {"Winbond", "W25x80", WINBOND_NEX_ID, W_25X80, 1024, 256, TEST_OK_PREW, probe_spi_rdid, spi_chip_erase_c7, spi_chip_write, spi_chip_read}, {"Winbond", "W29C011", WINBOND_ID, W_29C011, 128, 128, TEST_UNTESTED, probe_jedec, erase_chip_jedec, write_jedec}, {"Winbond", "W29C020C", WINBOND_ID, W_29C020C, 256, 128, TEST_OK_PREW, probe_jedec, erase_chip_jedec, write_jedec}, {"Winbond", "W29C040P", WINBOND_ID, W_29C040P, 512, 256, TEST_UNTESTED, probe_jedec, erase_chip_jedec, write_jedec}, From peter at stuge.se Thu Jul 3 18:55:33 2008 From: peter at stuge.se (Peter Stuge) Date: Thu, 3 Jul 2008 18:55:33 +0200 Subject: [coreboot] flashrom with Winbond W25x80 - Testreport In-Reply-To: <5E5D87015BF8A54A93DAD6F808B1129AAE0954@DEEXVS13.wincor-nixdorf.com> References: <5E5D87015BF8A54A93DAD6F808B1129AAE0954@DEEXVS13.wincor-nixdorf.com> Message-ID: <20080703165533.7040.qmail@stuge.se> Hi Bj?rn, On Thu, Jul 03, 2008 at 01:36:11PM +0200, Gerhart, Bjoern wrote: > > I've attached a kludge fix to disable > > the offending code to the ticket: > > > > http://tracker.coreboot.org/trac/coreboot/ticket/102 > > With this workaround the write attempt works successfully (see > below), so in my opinion the status of the W25x80 can be set to > "tested" :-) .. > Verifying flash... VERIFIED. Thanks for the report. This is updated in r3409. //Peter From uwe at hermann-uwe.de Thu Jul 3 19:15:39 2008 From: uwe at hermann-uwe.de (Uwe Hermann) Date: Thu, 3 Jul 2008 19:15:39 +0200 Subject: [coreboot] flashrom: Remove Makefile pciutils check, and don't rm *~ in clean In-Reply-To: <20080703094110.30495.qmail@stuge.se> References: <20080701221822.18719.qmail@stuge.se> <486AC6F2.8050509@coresystems.de> <20080702012316.1575.qmail@stuge.se> <dd3c80060807022248i496ec1bes2239f9950a44ba39@mail.gmail.com> <20080701221822.18719.qmail@stuge.se> <486AEAA2.6080709@gmx.net> <20080702030500.14860.qmail@stuge.se> <486C2872.8090306@gmx.net> <20080703094110.30495.qmail@stuge.se> Message-ID: <20080703171539.GA24556@greenwood> On Thu, Jul 03, 2008 at 11:41:10AM +0200, Peter Stuge wrote: > Yeah, they're generated by autoconf, from a pretty readable > configure.in file. > > Just to be clear, I am not advocating autoconf+automake. I don't > think we need that. Ack. > On Thu, Jul 03, 2008 at 01:48:33AM -0400, Corey Osgood wrote: > > > At the very least the message is not clear enough. > > > > I've seen this too, where I had a compiler installed but forgot to > > set CC or link it to gcc or some such thing. Wouldn't the more > > correct workaround be to do a compiler check? > > Yes, that's what I'm thinking too. I am pieceing something together > with parts of coresystems' xcompile script. :) Uh, I'd say this is overkill. Personally I prefer keeping the check in the Makefile (if at all). An extra script might make sense if there are _lots_ of _verbose_ and complicated tests, but we're far away from that. Adding yet another file just doesn't make much sense and is not really useful either, IMO. Uwe. -- http://www.hermann-uwe.de | http://www.holsham-traders.de http://www.crazy-hacks.org | http://www.unmaintained-free-software.org From uwe at hermann-uwe.de Thu Jul 3 19:16:34 2008 From: uwe at hermann-uwe.de (Uwe Hermann) Date: Thu, 3 Jul 2008 19:16:34 +0200 Subject: [coreboot] NEOWARE EON 4000S In-Reply-To: <48667836.3010909@arcor.de> References: <48667836.3010909@arcor.de> Message-ID: <20080703171634.GB24556@greenwood> Hi, On Sat, Jun 28, 2008 at 07:43:18PM +0200, Hannes Hegewald wrote: > hey, here's the 'lspci -tvnn', 'superiotool -dV', 'flashrom -V', getpir > and /proc/cpu output for the Neoware EON 4000S board/Thin Client. Thanks a lot! I've almost finished a new target for the Neoware Eon 4000s, but some more information would be useful to make the port more complete: - Is there some kind of mainboard vendor/name printed on the board? The product is called "Neoware Eon 4000s" but the mainboard may have a different name. It seems I cannot find anything on the photo at http://www.coreboot.org/Image:Neoware_eon4000s.jpg, but maybe there's something on the other side (or under the SODIMM)? - Can the board boot from IDE0 _and_ IDE1? I can only spot one IDE connector, so we could disable IDE1 in coreboot? - I assume there's no floppy connector, so we can disable it in coreboot? - I'll create a wiki status/HOWTO page for the board, if you have some time could you test all of the hardware/software features on the board (after the patch has been committed)? - Can you run 'sensors-detect' and 'sensors' on the original BIOS and (if a sensors is found and works) check if it also works with coreboot? Thanks, Uwe. -- http://www.hermann-uwe.de | http://www.holsham-traders.de http://www.crazy-hacks.org | http://www.unmaintained-free-software.org From peter at stuge.se Thu Jul 3 19:18:49 2008 From: peter at stuge.se (Peter Stuge) Date: Thu, 3 Jul 2008 19:18:49 +0200 Subject: [coreboot] USB debug cables and emulation In-Reply-To: <2A9397B0A1294D5EB3113DFD65C04686@smitty2m> <aa908b5795d8db20e9f32c94700cc949@imap.1and1.com> References: <57947bf80807030755o741a9936w6ac854289bb31970@mail.gmail.com> <2A9397B0A1294D5EB3113DFD65C04686@smitty2m> <AA28F077645B324881335614E4F7C4284A4954@win-ex01.bench.com> <aa908b5795d8db20e9f32c94700cc949@imap.1and1.com> Message-ID: <20080703171849.25200.qmail@stuge.se> On Thu, Jul 03, 2008 at 08:45:15AM -0400, Joseph Smith wrote: > I'm thinking a Serial->USB debugger is the way to go Ok. Keep in mind that the serial port will probably not be able to handle full speed data from the debugged target. I'm not sure what the transfer overhead is, but I expect the debug device to be able to shuffle quite a bit of data even though each transfer is only 8 bytes max. > to keep the costs down As Tom pointed out, this is not a good argument. Serial will only be simpler to implement, not lower cost to any degree that matters. > Any suggestions, questions, comments? You might want to look into the speed thing. I believe the best way to do so is to run tests on the NET20DC. On Thu, Jul 03, 2008 at 12:28:47PM -0400, Joseph Smith wrote: > $20 Dollars for a PCB??? I am going to use a generic PCB you can > pick up at radio shack for 2 dollars. That will not work. There are no standalone USB 2 high-speed function controllers that are usable with those PCBs. You will have to design a PCB, or buy a devkit. > This is more for educational, learning, and teaching purposes. > Everything is not about money you know (or not) :-( Manufacturing electronics is VERY expensive, and I think the concern is that you will either be spending ridiculous $$ or be forced to shut down the project before finish, and that either would be a high price for whatever knowledge has been gained. USB Debug Devices aren't the best target for learning USB in general because the devices need to do some tricks here and there, and thus require high end function controllers that can perform. //Peter From svn at coreboot.org Thu Jul 3 19:29:38 2008 From: svn at coreboot.org (coreboot) Date: Thu, 03 Jul 2008 17:29:38 -0000 Subject: [coreboot] #105: flashrom: add documentation files (ChangeLog etc) that need to be in the release In-Reply-To: <041.43c89429f4bc2b157cdb53f0a41b38c3@coreboot.org> References: <041.43c89429f4bc2b157cdb53f0a41b38c3@coreboot.org> Message-ID: <050.3f1d5ddc2b62bd739884b01995468f43@coreboot.org> #105: flashrom: add documentation files (ChangeLog etc) that need to be in the release ----------------------------+----------------------------------------------- Reporter: stuge | Owner: somebody Type: enhancement | Status: new Priority: blocker | Milestone: flashrom v1.0 Component: flashrom | Version: Resolution: | Keywords: documentation Dependencies: | Patchstatus: there is no patch ----------------------------+----------------------------------------------- Comment(by stuge): <uwe_> CareBear\: btw, regarding flashrom 1.0 and changelogs -- I've been including the 'svn log' output as upstream changelog for quite a while now, so this is not a big problem on debian side... note that I'm not opposed to put something into the Makefile to create a Changelog file out of 'svn log', I'm just saying it's not absolutely required for the debian package. -- Ticket URL: <http://tracker.coreboot.org/trac/coreboot/ticket/105#comment:2> coreboot <http://www.coreboot.org/> From c-d.hailfinger.devel.2006 at gmx.net Thu Jul 3 19:30:40 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Thu, 03 Jul 2008 19:30:40 +0200 Subject: [coreboot] [PATCH] flashrom: Improve coreboot image detection heuristic In-Reply-To: <20080703164615.32201.qmail@stuge.se> References: <486CE226.1010200@gmx.net> <20080703164615.32201.qmail@stuge.se> Message-ID: <486D0CC0.6000209@gmx.net> On 03.07.2008 18:46, Peter Stuge wrote: > On Thu, Jul 03, 2008 at 04:28:54PM +0200, Carl-Daniel Hailfinger wrote: > >> + if ((*walk) == 0 || ((*walk) & 0x3ff) != 0 || *walk > size || >> + *(walk - 1) > size || *(walk - 2) > size || >> + (!isprint((const char *)(bios + size - *(walk - 1))) && >> + ((const char *)(bios + size - *(walk - 1)))) || >> + (!isprint((const char *)(bios + size - *(walk - 2))) && >> + ((const char *)(bios + size - *(walk - 2))))) { >> > > I am in total disbelief. I should probably not be wasting any more of > my time on cleanups and restructuring. > Well, this is the only reliable fix until somebody steps forward to implement LAR recognition for flashrom and fake LAR headers for v2 and we agree on a standard for encapsulating vendor/model information in a LAR. I don't see that happening in the next few weeks. > But let's discuss a technical aspect. Hhow does this new heuristic > relate to v3 larballs? > If it worked with v3 before, it will still work. Regards, Carl-Daniel -- http://www.hailfinger.org/ From peter at stuge.se Thu Jul 3 19:38:23 2008 From: peter at stuge.se (Peter Stuge) Date: Thu, 3 Jul 2008 19:38:23 +0200 Subject: [coreboot] [PATCH] flashrom: Improve coreboot image detection heuristic In-Reply-To: <486D0CC0.6000209@gmx.net> References: <486CE226.1010200@gmx.net> <20080703164615.32201.qmail@stuge.se> <486D0CC0.6000209@gmx.net> Message-ID: <20080703173823.8371.qmail@stuge.se> On Thu, Jul 03, 2008 at 07:30:40PM +0200, Carl-Daniel Hailfinger wrote: > Well, this is the only reliable fix until somebody steps forward to > implement LAR recognition for flashrom and fake LAR headers for v2 > and we agree on a standard for encapsulating vendor/model > information in a LAR. I don't see that happening in the next few > weeks. I think that could happen. :) Anyway, I have reopened as major, to track the LAR way. > > But let's discuss a technical aspect. Hhow does this new heuristic > > relate to v3 larballs? > > If it worked with v3 before, it will still work. It did not. Ok, v3 wasn't considered. //Peter From svn at coreboot.org Thu Jul 3 19:38:07 2008 From: svn at coreboot.org (coreboot) Date: Thu, 03 Jul 2008 17:38:07 -0000 Subject: [coreboot] #102: flashrom: coreboot ROM image file identification heuristic is broken In-Reply-To: <041.d02ed69d3d641142e64c5b79feb8cb4e@coreboot.org> References: <041.d02ed69d3d641142e64c5b79feb8cb4e@coreboot.org> Message-ID: <050.d651ac0442d20a10feffb02a0286cee5@coreboot.org> #102: flashrom: coreboot ROM image file identification heuristic is broken -------------------------+-------------------------------------------------- Reporter: stuge | Owner: somebody Type: defect | Status: reopened Priority: major | Milestone: flashrom v1.0 Component: flashrom | Version: Resolution: | Keywords: rom image heuristic Dependencies: | Patchstatus: there is no patch -------------------------+-------------------------------------------------- Changes (by stuge): * priority: blocker => major * status: closed => reopened * patchstatus: patch has been committed => there is no patch * resolution: fixed => Comment: Reopening, because ultimately we want to be using a LAR file or header for this info, both in v2 and especially in v3. -- Ticket URL: <http://tracker.coreboot.org/trac/coreboot/ticket/102#comment:4> coreboot <http://www.coreboot.org/> From peter at stuge.se Thu Jul 3 19:42:48 2008 From: peter at stuge.se (Peter Stuge) Date: Thu, 3 Jul 2008 19:42:48 +0200 Subject: [coreboot] flashrom: Remove Makefile pciutils check, and don't rm *~ in clean In-Reply-To: <20080703171539.GA24556@greenwood> References: <20080701221822.18719.qmail@stuge.se> <486AC6F2.8050509@coresystems.de> <20080702012316.1575.qmail@stuge.se> <dd3c80060807022248i496ec1bes2239f9950a44ba39@mail.gmail.com> <20080701221822.18719.qmail@stuge.se> <486AEAA2.6080709@gmx.net> <20080702030500.14860.qmail@stuge.se> <486C2872.8090306@gmx.net> <20080703094110.30495.qmail@stuge.se> <20080703171539.GA24556@greenwood> Message-ID: <20080703174249.11839.qmail@stuge.se> On Thu, Jul 03, 2008 at 07:15:39PM +0200, Uwe Hermann wrote: > > I am pieceing something together with parts of coresystems' > > xcompile script. :) > > Uh, I'd say this is overkill. Nothing was left of xcompile when I took out the crosscompiling detection, which isn't needed for flashrom. Makes sense. > Personally I prefer keeping the check in the Makefile (if at all). I would love to simply remove the check. Then flashrom will be like every other package I've seen. The error message from compile or link commands (as run by make) is IMHO far better than anything we can pretend to produce on our own. If there is a library missing, the linker will make that clear. Can we convince Stefan? :) //Peter From peter at stuge.se Thu Jul 3 19:53:58 2008 From: peter at stuge.se (Peter Stuge) Date: Thu, 3 Jul 2008 19:53:58 +0200 Subject: [coreboot] [PATCH] [RFC] v3: CS5536 cleanup, and v3 design In-Reply-To: <486CE69D.1080708@gmx.net> References: <48205A47.5060403@gmx.net> <4822458B.4030506@gmx.net> <13426df10805071751p7adb40c8s759875e09ccee15@mail.gmail.com> <48468AB6.5060605@gmx.net> <13426df10806040753y17eeb1f1q73319c0c82e00fc2@mail.gmail.com> <4846C7BD.5050601@gmx.net> <486CE69D.1080708@gmx.net> Message-ID: <20080703175358.21127.qmail@stuge.se> On Thu, Jul 03, 2008 at 04:47:57PM +0200, Carl-Daniel Hailfinger wrote: > New iteration. > > - Clean up Geode companion chip CS5536 code. > - Eliminate a few redundant dev_find_pci_device() calls. > - Fix a compile warning intruduced in r689. > > This should be an equivalence transformation. > > Build tested on norwich, db800, alix.1c, alix.2c3, dbe62, dbe61. > > Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net> Acked-by: Peter Stuge <peter at stuge.se> > @@ -659,7 +649,7 @@ > > setup_i8259(); > lpc_init(sb); > - uarts_init(sb); > + uarts_init(sb, dev); > > if (sb->enable_gpio_int_route) { > printk(BIOS_SPEW, "cs5536: call vr_write\n"); More generally to the v3 design - should we try to create finer granularity hooks? I'm thinking per PCI-device in each component rather than per component? //Peter From rminnich at gmail.com Thu Jul 3 20:00:49 2008 From: rminnich at gmail.com (ron minnich) Date: Thu, 3 Jul 2008 11:00:49 -0700 Subject: [coreboot] [PATCH] [RFC] v3: CS5536 cleanup, and v3 design In-Reply-To: <20080703175358.21127.qmail@stuge.se> References: <48205A47.5060403@gmx.net> <4822458B.4030506@gmx.net> <13426df10805071751p7adb40c8s759875e09ccee15@mail.gmail.com> <48468AB6.5060605@gmx.net> <13426df10806040753y17eeb1f1q73319c0c82e00fc2@mail.gmail.com> <4846C7BD.5050601@gmx.net> <486CE69D.1080708@gmx.net> <20080703175358.21127.qmail@stuge.se> Message-ID: <13426df10807031100m35a64b2djb0cf6a343c868109@mail.gmail.com> On Thu, Jul 3, 2008 at 10:53 AM, Peter Stuge <peter at stuge.se> wrote: > I'm thinking per PCI-device in each component rather than per > component? > We've had this discussion before. It's a tough call: finer granularity vs. having lots of fiddly files. That said, your idea is attractive. I am very concerned that we maintain readability for non-experts and newbies. Would this make it more readable in your opinion? If so, it makes sense. BTW, this is a great patch. And it's tested :-) ron From c-d.hailfinger.devel.2006 at gmx.net Thu Jul 3 20:03:36 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Thu, 03 Jul 2008 20:03:36 +0200 Subject: [coreboot] [PATCH] [RFC] v3: CS5536 cleanup, and v3 design In-Reply-To: <20080703175358.21127.qmail@stuge.se> References: <48205A47.5060403@gmx.net> <4822458B.4030506@gmx.net> <13426df10805071751p7adb40c8s759875e09ccee15@mail.gmail.com> <48468AB6.5060605@gmx.net> <13426df10806040753y17eeb1f1q73319c0c82e00fc2@mail.gmail.com> <4846C7BD.5050601@gmx.net> <486CE69D.1080708@gmx.net> <20080703175358.21127.qmail@stuge.se> Message-ID: <486D1478.1020201@gmx.net> On 03.07.2008 19:53, Peter Stuge wrote: > On Thu, Jul 03, 2008 at 04:47:57PM +0200, Carl-Daniel Hailfinger wrote: > >> New iteration. >> >> - Clean up Geode companion chip CS5536 code. >> - Eliminate a few redundant dev_find_pci_device() calls. >> - Fix a compile warning intruduced in r689. >> >> This should be an equivalence transformation. >> >> Build tested on norwich, db800, alix.1c, alix.2c3, dbe62, dbe61. >> >> Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net> >> > > Acked-by: Peter Stuge <peter at stuge.se> > Thanks! >> @@ -659,7 +649,7 @@ >> >> setup_i8259(); >> lpc_init(sb); >> - uarts_init(sb); >> + uarts_init(sb, dev); >> >> if (sb->enable_gpio_int_route) { >> printk(BIOS_SPEW, "cs5536: call vr_write\n"); >> > > More generally to the v3 design - should we try to create finer > granularity hooks? > > I'm thinking per PCI-device in each component rather than per > component? > Absolutely. The ultimate goal is to kill dev_find_pci_device completely. We have a really nice device model and we should not work around it with v2-style code. The cleanup I did is structured in a way that allows easy migration to per-PCI-device hooks. Regards, Carl-Daniel -- http://www.hailfinger.org/ From peter at stuge.se Thu Jul 3 20:10:06 2008 From: peter at stuge.se (Peter Stuge) Date: Thu, 3 Jul 2008 20:10:06 +0200 Subject: [coreboot] [PATCH] [RFC] v3: CS5536 cleanup, and v3 design In-Reply-To: <13426df10807031100m35a64b2djb0cf6a343c868109@mail.gmail.com> References: <48205A47.5060403@gmx.net> <4822458B.4030506@gmx.net> <13426df10805071751p7adb40c8s759875e09ccee15@mail.gmail.com> <48468AB6.5060605@gmx.net> <13426df10806040753y17eeb1f1q73319c0c82e00fc2@mail.gmail.com> <4846C7BD.5050601@gmx.net> <486CE69D.1080708@gmx.net> <20080703175358.21127.qmail@stuge.se> <13426df10807031100m35a64b2djb0cf6a343c868109@mail.gmail.com> Message-ID: <20080703181006.1827.qmail@stuge.se> On Thu, Jul 03, 2008 at 11:00:49AM -0700, ron minnich wrote: > > I'm thinking per PCI-device in each component rather than per > > component? > > We've had this discussion before. It's a tough call: finer granularity > vs. having lots of fiddly files. Not neccessarily more files though - primarily more functions. > That said, your idea is attractive. I am very concerned that we > maintain readability for non-experts and newbies. Good, I agree. > Would this make it more readable in your opinion? If so, it makes > sense. Actually yes, I think so, if there is correlation between what is in the component dts, and what is in the component source. Maybe some components should be several files, but not neccessarily as a rule. I've compared with Linux kernel drivers before and will again. Drivers can be just one .c, but can also be a bunch of them when that makes sense. This is not top priority of course, right now I would prefer to keep it at one file per component. //Peter From peter at stuge.se Thu Jul 3 20:12:00 2008 From: peter at stuge.se (Peter Stuge) Date: Thu, 3 Jul 2008 20:12:00 +0200 Subject: [coreboot] v3 hooks per-logical-device instead of -component In-Reply-To: <486D1478.1020201@gmx.net> References: <48205A47.5060403@gmx.net> <4822458B.4030506@gmx.net> <13426df10805071751p7adb40c8s759875e09ccee15@mail.gmail.com> <48468AB6.5060605@gmx.net> <13426df10806040753y17eeb1f1q73319c0c82e00fc2@mail.gmail.com> <4846C7BD.5050601@gmx.net> <486CE69D.1080708@gmx.net> <20080703175358.21127.qmail@stuge.se> <486D1478.1020201@gmx.net> Message-ID: <20080703181200.3300.qmail@stuge.se> On Thu, Jul 03, 2008 at 08:03:36PM +0200, Carl-Daniel Hailfinger wrote: > easy migration to per-PCI-device hooks. And s,-PCI,, works too! :) //Peter From c-d.hailfinger.devel.2006 at gmx.net Thu Jul 3 20:17:00 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Thu, 03 Jul 2008 20:17:00 +0200 Subject: [coreboot] [PATCH] [RFC] v3: CS5536 cleanup, and v3 design In-Reply-To: <13426df10807031100m35a64b2djb0cf6a343c868109@mail.gmail.com> References: <48205A47.5060403@gmx.net> <4822458B.4030506@gmx.net> <13426df10805071751p7adb40c8s759875e09ccee15@mail.gmail.com> <48468AB6.5060605@gmx.net> <13426df10806040753y17eeb1f1q73319c0c82e00fc2@mail.gmail.com> <4846C7BD.5050601@gmx.net> <486CE69D.1080708@gmx.net> <20080703175358.21127.qmail@stuge.se> <13426df10807031100m35a64b2djb0cf6a343c868109@mail.gmail.com> Message-ID: <486D179C.7040502@gmx.net> On 03.07.2008 20:00, ron minnich wrote: > On Thu, Jul 3, 2008 at 10:53 AM, Peter Stuge <peter at stuge.se> wrote: > >> I'm thinking per PCI-device in each component rather than per >> component? >> >> > > We've had this discussion before. It's a tough call: finer granularity > vs. having lots of fiddly files. That said, your idea is attractive. I > am very concerned that we maintain readability for non-experts and > newbies. Would this make it more readable in your opinion? If so, it > makes sense. > > BTW, this is a great patch. And it's tested :-) > Thanks! Can I have an Ack from you as well? Regards, Carl-Daniel -- http://www.hailfinger.org/ From svn at coreboot.org Thu Jul 3 20:58:58 2008 From: svn at coreboot.org (svn at coreboot.org) Date: Thu, 3 Jul 2008 20:58:58 +0200 Subject: [coreboot] r3410 - trunk/util/flashrom Message-ID: <mailman.1682.1355071340.16123.coreboot@coreboot.org> Author: uwe Date: 2008-07-03 20:58:58 +0200 (Thu, 03 Jul 2008) New Revision: 3410 Modified: trunk/util/flashrom/flashchips.c Log: Mark the SST SST49LF040 as OK (tested by me), all operations (trivial). Signed-off-by: Uwe Hermann <uwe at hermann-uwe.de> Acked-by: Uwe Hermann <uwe at hermann-uwe.de> Modified: trunk/util/flashrom/flashchips.c =================================================================== --- trunk/util/flashrom/flashchips.c 2008-07-03 16:54:05 UTC (rev 3409) +++ trunk/util/flashrom/flashchips.c 2008-07-03 18:58:58 UTC (rev 3410) @@ -88,7 +88,7 @@ {"SST", "SST49LF008C", SST_ID, SST_49LF008C, 1024, 4 * 1024, TEST_UNTESTED, probe_49lfxxxc, erase_49lfxxxc, write_49lfxxxc}, {"SST", "SST49LF016C", SST_ID, SST_49LF016C, 2048, 4 * 1024, TEST_UNTESTED, probe_49lfxxxc, erase_49lfxxxc, write_49lfxxxc}, {"SST", "SST49LF020A", SST_ID, SST_49LF020A, 256, 16 * 1024, TEST_UNTESTED, probe_jedec, erase_49lf040, write_49lf040}, - {"SST", "SST49LF040", SST_ID, SST_49LF040, 512, 4096, TEST_UNTESTED, probe_jedec, erase_49lf040, write_49lf040}, + {"SST", "SST49LF040", SST_ID, SST_49LF040, 512, 4096, TEST_OK_PREW, probe_jedec, erase_49lf040, write_49lf040}, {"SST", "SST49LF040B", SST_ID, SST_49LF040B, 512, 64 * 1024, TEST_UNTESTED, probe_sst_fwhub, erase_sst_fwhub, write_sst_fwhub}, {"SST", "SST49LF080A", SST_ID, SST_49LF080A, 1024, 4096, TEST_OK_PREW, probe_jedec, erase_49lf040, write_49lf040}, {"SST", "SST49LF160C", SST_ID, SST_49LF160C, 2048, 4 * 1024, TEST_OK_PREW, probe_49lfxxxc, erase_49lfxxxc, write_49lfxxxc}, From svn at coreboot.org Thu Jul 3 21:08:52 2008 From: svn at coreboot.org (svn at coreboot.org) Date: Thu, 3 Jul 2008 21:08:52 +0200 Subject: [coreboot] r3411 - trunk/util/flashrom Message-ID: <mailman.1683.1355071340.16123.coreboot@coreboot.org> Author: hailfinger Date: 2008-07-03 21:08:52 +0200 (Thu, 03 Jul 2008) New Revision: 3411 Modified: trunk/util/flashrom/flashchips.c Log: Mark SST49LF040B as tested. Thanks to Paul Seidler and Ward Vandewege for testing. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net> Modified: trunk/util/flashrom/flashchips.c =================================================================== --- trunk/util/flashrom/flashchips.c 2008-07-03 18:58:58 UTC (rev 3410) +++ trunk/util/flashrom/flashchips.c 2008-07-03 19:08:52 UTC (rev 3411) @@ -89,7 +89,7 @@ {"SST", "SST49LF016C", SST_ID, SST_49LF016C, 2048, 4 * 1024, TEST_UNTESTED, probe_49lfxxxc, erase_49lfxxxc, write_49lfxxxc}, {"SST", "SST49LF020A", SST_ID, SST_49LF020A, 256, 16 * 1024, TEST_UNTESTED, probe_jedec, erase_49lf040, write_49lf040}, {"SST", "SST49LF040", SST_ID, SST_49LF040, 512, 4096, TEST_OK_PREW, probe_jedec, erase_49lf040, write_49lf040}, - {"SST", "SST49LF040B", SST_ID, SST_49LF040B, 512, 64 * 1024, TEST_UNTESTED, probe_sst_fwhub, erase_sst_fwhub, write_sst_fwhub}, + {"SST", "SST49LF040B", SST_ID, SST_49LF040B, 512, 64 * 1024, TEST_OK_PREW, probe_sst_fwhub, erase_sst_fwhub, write_sst_fwhub}, {"SST", "SST49LF080A", SST_ID, SST_49LF080A, 1024, 4096, TEST_OK_PREW, probe_jedec, erase_49lf040, write_49lf040}, {"SST", "SST49LF160C", SST_ID, SST_49LF160C, 2048, 4 * 1024, TEST_OK_PREW, probe_49lfxxxc, erase_49lfxxxc, write_49lfxxxc}, {"ST", "M25P05-A", ST_ID, ST_M25P05A, 64, 256, TEST_UNTESTED, probe_spi_rdid, spi_chip_erase_c7, spi_chip_write, spi_chip_read}, From svn at coreboot.org Thu Jul 3 21:26:44 2008 From: svn at coreboot.org (svn at coreboot.org) Date: Thu, 3 Jul 2008 21:26:44 +0200 Subject: [coreboot] r3412 - trunk/util/flashrom Message-ID: <mailman.1684.1355071340.16123.coreboot@coreboot.org> Author: uwe Date: 2008-07-03 21:26:44 +0200 (Thu, 03 Jul 2008) New Revision: 3412 Modified: trunk/util/flashrom/flashchips.c trunk/util/flashrom/layout.c Log: Minor cosmetics, e.g. make stuff fit in 80 chars/line etc. (trivial). Signed-off-by: Uwe Hermann <uwe at hermann-uwe.de> Acked-by: Uwe Hermann <uwe at hermann-uwe.de> Modified: trunk/util/flashrom/flashchips.c =================================================================== --- trunk/util/flashrom/flashchips.c 2008-07-03 19:08:52 UTC (rev 3411) +++ trunk/util/flashrom/flashchips.c 2008-07-03 19:26:44 UTC (rev 3412) @@ -41,9 +41,9 @@ {"Atmel", "AT49F002(N)", ATMEL_ID, AT_49F002N, 256, 256, TEST_UNTESTED, probe_jedec, erase_chip_jedec, write_jedec}, {"Atmel", "AT49F002(N)T", ATMEL_ID, AT_49F002NT, 256, 256, TEST_UNTESTED, probe_jedec, erase_chip_jedec, write_jedec}, {"Atmel", "AT25DF321", ATMEL_ID, AT_25DF321, 4096, 256, TEST_OK_PREW, probe_spi_rdid, spi_chip_erase_c7, spi_chip_write, spi_chip_read}, - {"AMIC Technology","A25L40P", AMIC_ID, AMIC_A25L40P, 512, 256, TEST_OK_PREW, probe_spi_rdid4, spi_chip_erase_c7, spi_chip_write, spi_chip_read}, - {"AMIC Technology","A49LF040A", AMIC_ID_NOPREFIX, AMIC_A49LF040A, 512, 64 * 1024, TEST_OK_PREW, probe_49fl00x, erase_49fl00x, write_49fl00x}, - {"AMIC Technology","A29040B", AMIC_ID_NOPREFIX, AMIC_A29040B, 512, 64 * 1024, TEST_OK_PR, probe_29f040b, erase_29f040b, write_29f040b}, + {"AMIC", "A25L40P", AMIC_ID, AMIC_A25L40P, 512, 256, TEST_OK_PREW, probe_spi_rdid4, spi_chip_erase_c7, spi_chip_write, spi_chip_read}, + {"AMIC", "A49LF040A", AMIC_ID_NOPREFIX, AMIC_A49LF040A, 512, 64 * 1024, TEST_OK_PREW, probe_49fl00x, erase_49fl00x, write_49fl00x}, + {"AMIC", "A29040B", AMIC_ID_NOPREFIX, AMIC_A29040B, 512, 64 * 1024, TEST_OK_PR, probe_29f040b, erase_29f040b, write_29f040b}, {"EMST", "F49B002UA", EMST_ID, EMST_F49B002UA, 256, 4096, TEST_UNTESTED, probe_jedec, erase_chip_jedec, write_49f002}, {"EON", "EN29F002(A)(N)B", EON_ID, EN_29F002B, 256, 256, TEST_UNTESTED, probe_jedec, erase_chip_jedec, write_jedec}, {"EON", "EN29F002(A)(N)T", EON_ID, EN_29F002T, 256, 256, TEST_UNTESTED, probe_jedec, erase_chip_jedec, write_jedec}, Modified: trunk/util/flashrom/layout.c =================================================================== --- trunk/util/flashrom/layout.c 2008-07-03 19:08:52 UTC (rev 3411) +++ trunk/util/flashrom/layout.c 2008-07-03 19:26:44 UTC (rev 3412) @@ -50,9 +50,8 @@ walk--; if ((*walk) == 0 || ((*walk) & 0x3ff) != 0) { - /* We might have an Nvidia chipset bios - * which stores the id information at a - * different location. + /* We might have an NVIDIA chipset BIOS which stores the ID + * information at a different location. */ walk = (unsigned int *)(bios + size - 0x80); walk--; @@ -88,19 +87,17 @@ /* * If lb_vendor is not set, the coreboot table was - * not found. Nor was -mVENDOR:PART specified + * not found. Nor was -m VENDOR:PART specified. */ - if (!lb_vendor || !lb_part) { printf("Note: If the following flash access fails, " - "you might need to specify -m <vendor>:<mainboard>.\n"); + "try -m <vendor>:<mainboard>.\n"); return 0; } /* These comparisons are case insensitive to make things * a little less user^Werror prone. */ - if (!strcasecmp(mainboard_vendor, lb_vendor) && !strcasecmp(mainboard_part, lb_part)) { printf_debug("This firmware image matches " From rminnich at gmail.com Thu Jul 3 21:34:30 2008 From: rminnich at gmail.com (ron minnich) Date: Thu, 3 Jul 2008 12:34:30 -0700 Subject: [coreboot] [PATCH] [RFC] v3: CS5536 cleanup, and v3 design In-Reply-To: <486D179C.7040502@gmx.net> References: <48205A47.5060403@gmx.net> <4822458B.4030506@gmx.net> <13426df10805071751p7adb40c8s759875e09ccee15@mail.gmail.com> <48468AB6.5060605@gmx.net> <13426df10806040753y17eeb1f1q73319c0c82e00fc2@mail.gmail.com> <4846C7BD.5050601@gmx.net> <486CE69D.1080708@gmx.net> <20080703175358.21127.qmail@stuge.se> <13426df10807031100m35a64b2djb0cf6a343c868109@mail.gmail.com> <486D179C.7040502@gmx.net> Message-ID: <13426df10807031234l21496a20y849b203fe6fd7a00@mail.gmail.com> On Thu, Jul 3, 2008 at 11:17 AM, Carl-Daniel Hailfinger > Thanks! Can I have an Ack from you as well? It just so happens I have a special price on Acks today. Acked-by: Ronald G. Minnich <rminnich at gmail.com> ron From svn at coreboot.org Thu Jul 3 21:35:34 2008 From: svn at coreboot.org (coreboot) Date: Thu, 03 Jul 2008 19:35:34 -0000 Subject: [coreboot] #103: flashrom: Don't exit() after successful erase operation In-Reply-To: <041.d6f003223df3afe9c38d44f78d70243d@coreboot.org> References: <041.d6f003223df3afe9c38d44f78d70243d@coreboot.org> Message-ID: <050.7dfb0c081ede87f0cbac6199e1d2dd1e@coreboot.org> #103: flashrom: Don't exit() after successful erase operation -------------------------+-------------------------------------------------- Reporter: stuge | Owner: stuge Type: defect | Status: new Priority: major | Milestone: flashrom v1.0 Component: flashrom | Version: Resolution: | Keywords: erase exit Dependencies: | Patchstatus: there is no patch -------------------------+-------------------------------------------------- Changes (by stuge): * owner: somebody => stuge -- Ticket URL: <http://tracker.coreboot.org/trac/coreboot/ticket/103#comment:1> coreboot <http://www.coreboot.org/> From svn at coreboot.org Thu Jul 3 21:35:49 2008 From: svn at coreboot.org (coreboot) Date: Thu, 03 Jul 2008 19:35:49 -0000 Subject: [coreboot] #103: flashrom: Don't exit() after successful erase operation In-Reply-To: <041.d6f003223df3afe9c38d44f78d70243d@coreboot.org> References: <041.d6f003223df3afe9c38d44f78d70243d@coreboot.org> Message-ID: <050.24b1ed52df604d0625f8f394e2579842@coreboot.org> #103: flashrom: Don't exit() after successful erase operation -------------------------+-------------------------------------------------- Reporter: stuge | Owner: stuge Type: defect | Status: assigned Priority: major | Milestone: flashrom v1.0 Component: flashrom | Version: Resolution: | Keywords: erase exit Dependencies: | Patchstatus: there is no patch -------------------------+-------------------------------------------------- Changes (by stuge): * status: new => assigned -- Ticket URL: <http://tracker.coreboot.org/trac/coreboot/ticket/103#comment:2> coreboot <http://www.coreboot.org/> From peter at stuge.se Thu Jul 3 21:40:33 2008 From: peter at stuge.se (Peter Stuge) Date: Thu, 3 Jul 2008 21:40:33 +0200 Subject: [coreboot] r3412 - trunk/util/flashrom Message-ID: <20080703194033.18358.qmail@stuge.se> On Thu, Jul 03, 2008 at 09:26:44PM +0200, svn at coreboot.org wrote: > Author: uwe .. > - {"AMIC Technology","A25L40P", AMIC_ID, AMIC_A25L40P, 512, 256, TEST_OK_PREW, probe_spi_rdid4, spi_chip_erase_c7, spi_chip_write, spi_chip_read}, > - {"AMIC Technology","A49LF040A", AMIC_ID_NOPREFIX, AMIC_A49LF040A, 512, 64 * 1024, TEST_OK_PREW, probe_49fl00x, erase_49fl00x, write_49fl00x}, > - {"AMIC Technology","A29040B", AMIC_ID_NOPREFIX, AMIC_A29040B, 512, 64 * 1024, TEST_OK_PR, probe_29f040b, erase_29f040b, write_29f040b}, > + {"AMIC", "A25L40P", AMIC_ID, AMIC_A25L40P, 512, 256, TEST_OK_PREW, probe_spi_rdid4, spi_chip_erase_c7, spi_chip_write, spi_chip_read}, > + {"AMIC", "A49LF040A", AMIC_ID_NOPREFIX, AMIC_A49LF040A, 512, 64 * 1024, TEST_OK_PREW, probe_49fl00x, erase_49fl00x, write_49fl00x}, > + {"AMIC", "A29040B", AMIC_ID_NOPREFIX, AMIC_A29040B, 512, 64 * 1024, TEST_OK_PR, probe_29f040b, erase_29f040b, write_29f040b}, They consistently use AMIC Technology, Corp. in their data sheets. As just mentioned on IRC, -c is not affected, it will only look at the flash model string. //Peter From svn at coreboot.org Thu Jul 3 21:42:06 2008 From: svn at coreboot.org (svn at coreboot.org) Date: Thu, 3 Jul 2008 21:42:06 +0200 Subject: [coreboot] r692 - coreboot-v3/southbridge/amd/cs5536 Message-ID: <mailman.1685.1355071340.16123.coreboot@coreboot.org> Author: hailfinger Date: 2008-07-03 21:42:05 +0200 (Thu, 03 Jul 2008) New Revision: 692 Modified: coreboot-v3/southbridge/amd/cs5536/cs5536.c Log: - Clean up Geode companion chip CS5536 code. - Eliminate a few redundant dev_find_pci_device() calls. - Fix a compile warning intruduced in r689. This should be an equivalence transformation. Build tested on norwich, db800, alix.1c, alix.2c3, dbe62, dbe61. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net> Acked-by: Peter Stuge <peter at stuge.se> Acked-by: Ronald G. Minnich <rminnich at gmail.com> Modified: coreboot-v3/southbridge/amd/cs5536/cs5536.c =================================================================== --- coreboot-v3/southbridge/amd/cs5536/cs5536.c 2008-06-29 06:43:01 UTC (rev 691) +++ coreboot-v3/southbridge/amd/cs5536/cs5536.c 2008-07-03 19:42:05 UTC (rev 692) @@ -240,16 +240,13 @@ * * @param sb Southbridge config structure. */ -static void uarts_init(struct southbridge_amd_cs5536_dts_config *sb) +static void uarts_init(struct southbridge_amd_cs5536_dts_config *sb, + struct device *dev) { struct msr msr; u16 addr = 0; u32 gpio_addr; - struct device *dev; - dev = dev_find_pci_device(PCI_VENDOR_ID_AMD, - PCI_DEVICE_ID_AMD_CS5536_ISA, 0); - gpio_addr = pci_read_config32(dev, PCI_BASE_ADDRESS_1); gpio_addr &= ~1; /* Clear I/O bit */ printk(BIOS_DEBUG, "GPIO_ADDR: %08X\n", gpio_addr); @@ -419,11 +416,11 @@ { u32 *bar; struct msr msr; - struct device *dev; + struct device *ehci_dev, *otg_dev, *udc_dev; - dev = dev_find_pci_device(PCI_VENDOR_ID_AMD, + ehci_dev = dev_find_pci_device(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CS5536_EHCI, 0); - if (dev) { + if (ehci_dev) { /* Serial short detect enable */ msr = rdmsr(USB2_SB_GLD_MSR_CONF); msr.hi |= USB2_UPPER_SSDEN_SET; @@ -432,7 +429,7 @@ /* Write to clear diag register. */ wrmsr(USB2_SB_GLD_MSR_DIAG, rdmsr(USB2_SB_GLD_MSR_DIAG)); - bar = (u32 *) pci_read_config32(dev, PCI_BASE_ADDRESS_0); + bar = (u32 *) pci_read_config32(ehci_dev, PCI_BASE_ADDRESS_0); /* Make HCCPARAMS writable. */ *(bar + IPREG04) |= USB_HCCPW_SET; @@ -441,10 +438,10 @@ *(bar + HCCPARAMS) = 0x00005012; } - dev = dev_find_pci_device(PCI_VENDOR_ID_AMD, + otg_dev = dev_find_pci_device(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CS5536_OTG, 0); - if (dev) { - bar = (u32 *) pci_read_config32(dev, PCI_BASE_ADDRESS_0); + if (otg_dev) { + bar = (u32 *) pci_read_config32(otg_dev, PCI_BASE_ADDRESS_0); printk(BIOS_DEBUG, "UOCMUX is %x\n", *(bar + UOCMUX)); @@ -470,6 +467,8 @@ } + udc_dev = dev_find_pci_device(PCI_VENDOR_ID_AMD, + PCI_DEVICE_ID_AMD_CS5536_UDC, 0); /* PBz#6466: If the UOC(OTG) device, port 4, is configured as a * device, then perform the following sequence: * - Set SD bit in DEVCTRL udc register @@ -477,24 +476,19 @@ * - Set APU bit in uoc register */ if (sb->enable_USBP4_device) { - dev = dev_find_pci_device(PCI_VENDOR_ID_AMD, - PCI_DEVICE_ID_AMD_CS5536_UDC, 0); - if (dev) { - bar = (u32 *)pci_read_config32(dev, PCI_BASE_ADDRESS_0); + if (udc_dev) { + bar = (u32 *)pci_read_config32(udc_dev, PCI_BASE_ADDRESS_0); *(bar + UDCDEVCTL) |= UDC_SD_SET; } - dev = dev_find_pci_device(PCI_VENDOR_ID_AMD, - PCI_DEVICE_ID_AMD_CS5536_OTG, 0); - if (dev) { - bar = (u32 *)pci_read_config32(dev, PCI_BASE_ADDRESS_0); + if (otg_dev) { + bar = (u32 *)pci_read_config32(otg_dev, PCI_BASE_ADDRESS_0); *(bar + UOCCTL) |= PADEN_SET; *(bar + UOCCAP) |= APU_SET; + printk(BIOS_DEBUG, "UOCCTL is %x\n", *(bar + UOCCTL)); } } - printk(BIOS_DEBUG, "UOCCTL is %x\n", *(bar + UOCCTL)); - /* Disable virtual PCI UDC and OTG headers. The kernel never * sees a header for this device. It used to provide an OS * visible device, but that was defeatured. There are still @@ -506,15 +500,11 @@ * device ID PCI_DEVICE_ID_AMD_CS5536_OTG, but it is hidden * when 0xDEADBEEF is written to config space register 0x7C. */ - dev = dev_find_pci_device(PCI_VENDOR_ID_AMD, - PCI_DEVICE_ID_AMD_CS5536_UDC, 0); - if (dev) - pci_write_config32(dev, 0x7C, 0xDEADBEEF); + if (udc_dev) + pci_write_config32(udc_dev, 0x7C, 0xDEADBEEF); - dev = dev_find_pci_device(PCI_VENDOR_ID_AMD, - PCI_DEVICE_ID_AMD_CS5536_OTG, 0); - if (dev) - pci_write_config32(dev, 0x7C, 0xDEADBEEF); + if (otg_dev) + pci_write_config32(otg_dev, 0x7C, 0xDEADBEEF); } /** @@ -659,7 +649,7 @@ setup_i8259(); lpc_init(sb); - uarts_init(sb); + uarts_init(sb, dev); if (sb->enable_gpio_int_route) { printk(BIOS_SPEW, "cs5536: call vr_write\n"); From joe at settoplinux.org Thu Jul 3 21:42:05 2008 From: joe at settoplinux.org (Joseph Smith) Date: Thu, 3 Jul 2008 15:42:05 -0400 Subject: [coreboot] USB debug cables and emulation In-Reply-To: <20080703171849.25200.qmail@stuge.se> References: <57947bf80807030755o741a9936w6ac854289bb31970@mail.gmail.com><2A9397B0A1294D5EB3113DFD65C04686@smitty2m><AA28F077645B324881335614E4F7C4284A4954@win-ex01.bench.com><aa908b5795d8db20e9f32c94700cc949@imap.1and1.com> <20080703171849.25200.qmail@stuge.se> Message-ID: <5316BBB2E44445B99D12D0C00002CCDA@smitty2m> > -----Original Message----- > From: coreboot-bounces at coreboot.org [mailto:coreboot-bounces at coreboot.org] > On Behalf Of Peter Stuge > Sent: Thursday, July 03, 2008 1:19 PM > To: coreboot at coreboot.org > Subject: Re: [coreboot] USB debug cables and emulation > > On Thu, Jul 03, 2008 at 08:45:15AM -0400, Joseph Smith wrote: > > I'm thinking a Serial->USB debugger is the way to go > > Ok. Keep in mind that the serial port will probably not be able to > handle full speed data from the debugged target. I'm not sure what > the transfer overhead is, but I expect the debug device to be able > to shuffle quite a bit of data even though each transfer is only 8 > bytes max. > > > to keep the costs down > > As Tom pointed out, this is not a good argument. Serial will only be > simpler to implement, not lower cost to any degree that matters. > > > > Any suggestions, questions, comments? > > You might want to look into the speed thing. I believe the best way > to do so is to run tests on the NET20DC. > > > On Thu, Jul 03, 2008 at 12:28:47PM -0400, Joseph Smith wrote: > > $20 Dollars for a PCB??? I am going to use a generic PCB you can > > pick up at radio shack for 2 dollars. > > That will not work. There are no standalone USB 2 high-speed > function controllers that are usable with those PCBs. You will > have to design a PCB, or buy a devkit. > > > > This is more for educational, learning, and teaching purposes. > > Everything is not about money you know (or not) :-( > > Manufacturing electronics is VERY expensive, and I think the concern > is that you will either be spending ridiculous $$ or be forced to > shut down the project before finish, and that either would be a high > price for whatever knowledge has been gained. > > USB Debug Devices aren't the best target for learning USB in general > because the devices need to do some tricks here and there, and thus > require high end function controllers that can perform. > So everyone is just telling me I should give up??? I wonder how many times OLPC herd that??? Ok then I will just give up and go buy a Net20DC :-( Thanks, Joseph Smith Set-Top-Linux www.settoplinux.org From c-d.hailfinger.devel.2006 at gmx.net Thu Jul 3 21:42:45 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Thu, 03 Jul 2008 21:42:45 +0200 Subject: [coreboot] [PATCH] [RFC] v3: CS5536 cleanup, and v3 design In-Reply-To: <13426df10807031234l21496a20y849b203fe6fd7a00@mail.gmail.com> References: <48205A47.5060403@gmx.net> <4822458B.4030506@gmx.net> <13426df10805071751p7adb40c8s759875e09ccee15@mail.gmail.com> <48468AB6.5060605@gmx.net> <13426df10806040753y17eeb1f1q73319c0c82e00fc2@mail.gmail.com> <4846C7BD.5050601@gmx.net> <486CE69D.1080708@gmx.net> <20080703175358.21127.qmail@stuge.se> <13426df10807031100m35a64b2djb0cf6a343c868109@mail.gmail.com> <486D179C.7040502@gmx.net> <13426df10807031234l21496a20y849b203fe6fd7a00@mail.gmail.com> Message-ID: <486D2BB5.6050105@gmx.net> On 03.07.2008 21:34, ron minnich wrote: > On Thu, Jul 3, 2008 at 11:17 AM, Carl-Daniel Hailfinger > >> Thanks! Can I have an Ack from you as well? >> > > It just so happens I have a special price on Acks today. > OK, I'll buy you a pizza next time we meet. > Acked-by: Ronald G. Minnich <rminnich at gmail.com> > Thanks, r692. Regards, Carl-Daniel From c-d.hailfinger.devel.2006 at gmx.net Thu Jul 3 21:52:15 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Thu, 03 Jul 2008 21:52:15 +0200 Subject: [coreboot] USB debug cables and emulation In-Reply-To: <5316BBB2E44445B99D12D0C00002CCDA@smitty2m> References: <57947bf80807030755o741a9936w6ac854289bb31970@mail.gmail.com><2A9397B0A1294D5EB3113DFD65C04686@smitty2m><AA28F077645B324881335614E4F7C4284A4954@win-ex01.bench.com><aa908b5795d8db20e9f32c94700cc949@imap.1and1.com> <20080703171849.25200.qmail@stuge.se> <5316BBB2E44445B99D12D0C00002CCDA@smitty2m> Message-ID: <486D2DEF.9090003@gmx.net> On 03.07.2008 21:42, Joseph Smith wrote: >> -----Original Message----- >> From: coreboot-bounces at coreboot.org [mailto:coreboot-bounces at coreboot.org] >> On Behalf Of Peter Stuge >> Sent: Thursday, July 03, 2008 1:19 PM >> To: coreboot at coreboot.org >> Subject: Re: [coreboot] USB debug cables and emulation >> >> On Thu, Jul 03, 2008 at 08:45:15AM -0400, Joseph Smith wrote: >> >>> I'm thinking a Serial->USB debugger is the way to go >>> >> Ok. Keep in mind that the serial port will probably not be able to >> handle full speed data from the debugged target. I'm not sure what >> the transfer overhead is, but I expect the debug device to be able >> to shuffle quite a bit of data even though each transfer is only 8 >> bytes max. >> >> >>> to keep the costs down >>> >> As Tom pointed out, this is not a good argument. Serial will only be >> simpler to implement, not lower cost to any degree that matters. >> >> >> >>> Any suggestions, questions, comments? >>> >> You might want to look into the speed thing. I believe the best way >> to do so is to run tests on the NET20DC. >> >> >> On Thu, Jul 03, 2008 at 12:28:47PM -0400, Joseph Smith wrote: >> >>> $20 Dollars for a PCB??? I am going to use a generic PCB you can >>> pick up at radio shack for 2 dollars. >>> >> That will not work. There are no standalone USB 2 high-speed >> function controllers that are usable with those PCBs. You will >> have to design a PCB, or buy a devkit. >> >> >> >>> This is more for educational, learning, and teaching purposes. >>> Everything is not about money you know (or not) :-( >>> >> Manufacturing electronics is VERY expensive, and I think the concern >> is that you will either be spending ridiculous $$ or be forced to >> shut down the project before finish, and that either would be a high >> price for whatever knowledge has been gained. >> >> USB Debug Devices aren't the best target for learning USB in general >> because the devices need to do some tricks here and there, and thus >> require high end function controllers that can perform. >> As luck has it, the USB chips used in the NET20DC are also present in other devices. > So everyone is just telling me I should give up??? > Well, I think it would be really cool to have an affordable USB debug device. Unfortunately, I am not so skilled when it comes to designing hardware, so I won't be able to help. Together with shipping, the NET20DC is >$140 anywhere in Europe. That's pretty much outside my budget. > I wonder how many times OLPC herd that??? > > Ok then I will just give up and go buy a Net20DC :-( > If you can get schematics and photos and a dump of the ROM of a NET20DC, you should be able to find out rather quickly whether this is doable. In theory, having a Geode/CS5536 board should enable you to abuse one of the USB host ports as device port and create USB debug functionality purely in software. No idea whether the hardware is that flexible, though. Regards, Carl-Daniel -- http://www.hailfinger.org/ From uwe at hermann-uwe.de Thu Jul 3 22:05:20 2008 From: uwe at hermann-uwe.de (Uwe Hermann) Date: Thu, 3 Jul 2008 22:05:20 +0200 Subject: [coreboot] r3412 - trunk/util/flashrom In-Reply-To: <20080703194033.18358.qmail@stuge.se> References: <20080703194033.18358.qmail@stuge.se> Message-ID: <20080703200520.GC24556@greenwood> On Thu, Jul 03, 2008 at 09:40:33PM +0200, Peter Stuge wrote: > On Thu, Jul 03, 2008 at 09:26:44PM +0200, svn at coreboot.org wrote: > > Author: uwe > .. > > - {"AMIC Technology","A25L40P", AMIC_ID, AMIC_A25L40P, 512, 256, TEST_OK_PREW, probe_spi_rdid4, spi_chip_erase_c7, spi_chip_write, spi_chip_read}, > > - {"AMIC Technology","A49LF040A", AMIC_ID_NOPREFIX, AMIC_A49LF040A, 512, 64 * 1024, TEST_OK_PREW, probe_49fl00x, erase_49fl00x, write_49fl00x}, > > - {"AMIC Technology","A29040B", AMIC_ID_NOPREFIX, AMIC_A29040B, 512, 64 * 1024, TEST_OK_PR, probe_29f040b, erase_29f040b, write_29f040b}, > > + {"AMIC", "A25L40P", AMIC_ID, AMIC_A25L40P, 512, 256, TEST_OK_PREW, probe_spi_rdid4, spi_chip_erase_c7, spi_chip_write, spi_chip_read}, > > + {"AMIC", "A49LF040A", AMIC_ID_NOPREFIX, AMIC_A49LF040A, 512, 64 * 1024, TEST_OK_PREW, probe_49fl00x, erase_49fl00x, write_49fl00x}, > > + {"AMIC", "A29040B", AMIC_ID_NOPREFIX, AMIC_A29040B, 512, 64 * 1024, TEST_OK_PR, probe_29f040b, erase_29f040b, write_29f040b}, > > They consistently use AMIC Technology, Corp. in their data sheets. > > As just mentioned on IRC, -c is not affected, it will only look at > the flash model string. The reason I changed it was to make the table width smaller and the indentation better readable. I think using the short name for companies is fine, we also use "AMD" instead of "Advanced Micro Devices" in the table -- it's just too long. Suffixes such as "Tech", "Inc" etc. aren't really useful (in this table) anyway. Uwe. -- http://www.hermann-uwe.de | http://www.holsham-traders.de http://www.crazy-hacks.org | http://www.unmaintained-free-software.org From peter at stuge.se Thu Jul 3 22:21:30 2008 From: peter at stuge.se (Peter Stuge) Date: Thu, 3 Jul 2008 22:21:30 +0200 Subject: [coreboot] USB debug cables and emulation In-Reply-To: <5316BBB2E44445B99D12D0C00002CCDA@smitty2m> References: <20080703171849.25200.qmail@stuge.se> <5316BBB2E44445B99D12D0C00002CCDA@smitty2m> Message-ID: <20080703202130.17415.qmail@stuge.se> On Thu, Jul 03, 2008 at 03:42:05PM -0400, Joseph Smith wrote: > > Manufacturing electronics is VERY expensive, and I think the concern > > is that you will either be spending ridiculous $$ or be forced to > > shut down the project before finish, and that either would be a high > > price for whatever knowledge has been gained. > > > > USB Debug Devices aren't the best target for learning USB in general > > because the devices need to do some tricks here and there, and thus > > require high end function controllers that can perform. > > So everyone is just telling me I should give up??? I'm not. :) If you want to spend a lot of time learning about USB I am all for it! Once you've gotten your first device to work and know all the twisty passages of the device firmware, it will be alot easier to adapt it so that it's a debug device instead. > I wonder how many times OLPC herd that??? Probably many! They persisted, and I bet they did not have the same motivation as you; education of self and hack credits. > Ok then I will just give up and go buy a Net20DC :-( You will not be able to DIY for lower cost, and I say it will take half a year or more to finish because USB is so complex. If the goal is to further use of the Debug Port in any fashion, I do recommend grabbing a NET20DC, getting it to work somehow somewhere maybe write some code for talking to it that is missing or buggy, and documenting the process so others can make use of the device too. If the goal is to educate yourself about USB and make a very narrow hack then I say go for it, just be prepared for the effort. Except time you'll either have to use an existing USB2 device controller devkit, or design your own PCB and purchase lots of chips. Either way, it is not so easy to reproduce your effort for another DIY:er. Finally you could then fall back to the other purpose, to use your DIY:ed device in order to help with debug target software for communicating with a debugger host through the debug device, but by then maybe someone has already used the NET20DC to do that. So - comes down to why you want to do it. :) //Peter From mylesgw at gmail.com Thu Jul 3 23:43:43 2008 From: mylesgw at gmail.com (Myles Watson) Date: Thu, 3 Jul 2008 15:43:43 -0600 Subject: [coreboot] LegacyBIOS -> SeaBIOS in buildrom Message-ID: <2831fecf0807031443w3b46cb9apae3137af0f648dcc@mail.gmail.com> This patch changes the name of LegacyBIOS to SeaBIOS, everywhere but the git URL, which hasn't been updated yet. It also updates the hardcode.diff patch now that the memory value is read from the coreboot tables, and fixes the handling of that patch. Thanks, Myles Signed-off-by: Myles Watson <mylesgw at gmail.com> -------------- next part -------------- A non-text attachment was scrubbed... Name: seabios.diff Type: text/x-patch Size: 11264 bytes Desc: not available URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20080703/407cd22f/attachment.diff> From jordan.crouse at amd.com Thu Jul 3 23:48:16 2008 From: jordan.crouse at amd.com (Jordan Crouse) Date: Thu, 3 Jul 2008 15:48:16 -0600 Subject: [coreboot] LegacyBIOS -> SeaBIOS in buildrom In-Reply-To: <2831fecf0807031443w3b46cb9apae3137af0f648dcc@mail.gmail.com> References: <2831fecf0807031443w3b46cb9apae3137af0f648dcc@mail.gmail.com> Message-ID: <20080703214816.GA9185@cosmic.amd.com> On 03/07/08 15:43 -0600, Myles Watson wrote: > This patch changes the name of LegacyBIOS to SeaBIOS, everywhere but the git > URL, which hasn't been updated yet. It also updates the hardcode.diff patch > now that the memory value is read from the coreboot tables, and fixes the > handling of that patch. > > Thanks, > Myles > > Signed-off-by: Myles Watson <mylesgw at gmail.com> Acked-by: Jordan Crouse <jordan.crouse at amd.com> > Index: packages/seabios/hardcode.diff > =================================================================== > --- packages/seabios/hardcode.diff (revision 210) > +++ packages/seabios/hardcode.diff (working copy) > @@ -1,14 +1,17 @@ > -diff --git a/src/config.h b/src/config.h > -index 4ae23dc..5ed9799 100644 > ---- a/src/config.h > -+++ b/src/config.h > -@@ -14,17 +14,17 @@ > +--- a/src/config.h 2008-07-03 15:12:21.000000000 -0600 > ++++ b/src/config.h 2008-07-03 15:13:23.000000000 -0600 > +@@ -14,31 +14,31 @@ > #endif > > - // Configure as a payload coreboot payload. > + // Configure as a coreboot payload. > -#define CONFIG_COREBOOT 0 > +#define CONFIG_COREBOOT 1 > > + // Control how verbose debug output is. > +-#define CONFIG_DEBUG_LEVEL 1 > ++#define CONFIG_DEBUG_LEVEL 6 > + > + // Send debugging information to serial port > -#define CONFIG_DEBUG_SERIAL 0 > +#define CONFIG_DEBUG_SERIAL 1 > > @@ -19,21 +22,22 @@ > #define CONFIG_KBD_CALL_INT15_4F 1 > #define CONFIG_CDROM_BOOT 1 > #define CONFIG_CDROM_EMU 1 > + // Support generation of a PIR table in 0xf000 segment (for emulators) > +-#define CONFIG_PIRTABLE 1 > ++#define CONFIG_PIRTABLE 1 > + // Support generation of ACPI PIR tables (for emulators) > +-#define CONFIG_ACPI 1 > ++#define CONFIG_ACPI 1 > + // Support int 1a/b1 PCI BIOS calls > -#define CONFIG_PCIBIOS 1 > -+#define CONFIG_PCIBIOS 0 > ++#define CONFIG_PCIBIOS 1 > + // Support int 15/53 APM BIOS calls > +-#define CONFIG_APMBIOS 1 > ++#define CONFIG_APMBIOS 1 > > /* define it if the (emulated) hardware supports SMM mode */ > - #define CONFIG_USE_SMM 1 > -diff --git a/src/post.c b/src/post.c > -index a6f7c3d..7890d65 100644 > ---- a/src/post.c > -+++ b/src/post.c > -@@ -83,7 +83,7 @@ ram_probe(void) > - u32 rs; > - if (CONFIG_COREBOOT) { > - // XXX - just hardcode for now. > -- rs = 128*1024*1024; > -+ rs = 128*1024*1024; > - } else { > - // On emulators, get memory size from nvram. > - rs = (inb_cmos(CMOS_MEM_EXTMEM2_LOW) > +-#define CONFIG_USE_SMM 1 > ++#define CONFIG_USE_SMM 1 > + > + /* if true, put the MP float table and ACPI RSDT in EBDA and the MP > + table in RAM. Unfortunately, Linux has bugs with that, so we prefer > Index: packages/seabios/seabios.mk > =================================================================== > --- packages/seabios/seabios.mk (revision 210) > +++ packages/seabios/seabios.mk (working copy) > @@ -1,59 +1,64 @@ > -LEGACYBIOS_URL=git://git.linuxtogo.org/home/kevin/legacybios/ > -LEGACYBIOS_TAG=master > +SEABIOS_URL=git://git.linuxtogo.org/home/kevin/legacybios/ > +SEABIOS_TAG=master > > -LEGACYBIOS_DIR=$(BUILD_DIR)/legacybios > -LEGACYBIOS_SRC_DIR=$(LEGACYBIOS_DIR)/legacybios-$(LEGACYBIOS_TAG) > -LEGACYBIOS_STAMP_DIR=$(LEGACYBIOS_DIR)/stamps > -LEGACYBIOS_LOG_DIR=$(LEGACYBIOS_DIR)/logs > +SEABIOS_DIR=$(BUILD_DIR)/seabios > +SEABIOS_SRC_DIR=$(SEABIOS_DIR)/seabios-$(SEABIOS_TAG) > +SEABIOS_STAMP_DIR=$(SEABIOS_DIR)/stamps > +SEABIOS_LOG_DIR=$(SEABIOS_DIR)/logs > > -LEGACYBIOS_PATCHES=hardcode.diff > +SEABIOS_PATCHES=$(PACKAGE_DIR)/seabios/hardcode.diff > > ifeq ($(CONFIG_VERBOSE),y) > -LEGACYBIOS_FETCH_LOG=/dev/stdout > -LEGACYBIOS_BUILD_LOG=/dev/stdout > +SEABIOS_FETCH_LOG=/dev/stdout > +SEABIOS_BUILD_LOG=/dev/stdout > else > -LEGACYBIOS_BUILD_LOG=$(LEGACYBIOS_LOG_DIR)/build.log > -LEGACYBIOS_FETCH_LOG=$(LEGACYBIOS_LOG_DIR)/fetch.log > +SEABIOS_BUILD_LOG=$(SEABIOS_LOG_DIR)/build.log > +SEABIOS_FETCH_LOG=$(SEABIOS_LOG_DIR)/fetch.log > endif > > -LEGACYBIOS_TARBALL=legacybios.tar > +SEABIOS_TARBALL=seabios.tar > > -ifeq ($(shell if [ -f $(PACKAGE_DIR)/legacybios/conf/customconfig--$(PAYLOAD)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD) ]; then echo 1; fi),1) > - LEGACYBIOS_CONFIG = customconfig--$(PAYLOAD)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD) > +ifeq ($(shell if [ -f $(PACKAGE_DIR)/seabios/conf/customconfig--$(PAYLOAD)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD) ]; then echo 1; fi),1) > + SEABIOS_CONFIG = customconfig--$(PAYLOAD)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD) > endif > > -$(SOURCE_DIR)/$(LEGACYBIOS_TARBALL): | $(LEGACYBIOS_STAMP_DIR) $(LEGACYBIOS_LOG_DIR) > - @ echo "Fetching LegacyBIOS..." > +$(SOURCE_DIR)/$(SEABIOS_TARBALL): | $(SEABIOS_STAMP_DIR) $(SEABIOS_LOG_DIR) > + @ echo "Fetching SeaBIOS..." > @ mkdir -p $(SOURCE_DIR) > - @ $(BIN_DIR)/fetchgit.sh $(LEGACYBIOS_URL) $(SOURCE_DIR)/legacybios $(LEGACYBIOS_TAG) $(SOURCE_DIR)/$(LEGACYBIOS_TARBALL) legacybios > $(LEGACYBIOS_FETCH_LOG) 2>&1 > + @ $(BIN_DIR)/fetchgit.sh $(SEABIOS_URL) $(SOURCE_DIR)/seabios $(SEABIOS_TAG) $(SOURCE_DIR)/$(SEABIOS_TARBALL) seabios > $(SEABIOS_FETCH_LOG) 2>&1 > > -$(LEGACYBIOS_STAMP_DIR)/.unpacked: $(SOURCE_DIR)/$(LEGACYBIOS_TARBALL) | $(LEGACYBIOS_STAMP_DIR) $(LEGACYBIOS_DIR) $(LEGACYBIOS_LOG_DIR) > - @ echo "Unpacking LegacyBIOS..." > - @ tar -C $(LEGACYBIOS_DIR) -xf $(SOURCE_DIR)/$(LEGACYBIOS_TARBALL) > +$(SEABIOS_STAMP_DIR)/.unpacked: $(SOURCE_DIR)/$(SEABIOS_TARBALL) | $(SEABIOS_STAMP_DIR) $(SEABIOS_DIR) $(SEABIOS_LOG_DIR) > + @ echo "Unpacking SeaBIOS..." > + @ tar -C $(SEABIOS_DIR) -xf $(SOURCE_DIR)/$(SEABIOS_TARBALL) > @ touch $@ > > -$(LEGACYBIOS_SRC_DIR)/out/bios.bin: $(LEGACYBIOS_STAMP_DIR)/.unpacked > - @ echo "Building LegacyBIOS..." > - @ make -C $(LEGACYBIOS_SRC_DIR) > $(LEGACYBIOS_BUILD_LOG) 2>&1 > +$(SEABIOS_STAMP_DIR)/.patched: $(SEABIOS_STAMP_DIR)/.unpacked > + @ echo "Patching mkelfimage..." > + @ $(BIN_DIR)/doquilt.sh $(SEABIOS_SRC_DIR) $(SEABIOS_PATCHES) > + @ touch $@ > > -$(LEGACYBIOS_STAMP_DIR) $(LEGACYBIOS_LOG_DIR): > +$(SEABIOS_SRC_DIR)/out/bios.bin: $(SEABIOS_STAMP_DIR)/.patched > + @ echo "Building SeaBIOS..." > + @ make -C $(SEABIOS_SRC_DIR) > $(SEABIOS_BUILD_LOG) 2>&1 > + > +$(SEABIOS_STAMP_DIR) $(SEABIOS_LOG_DIR): > @ mkdir -p $@ > > -$(LEGACYBIOS_STAMP_DIR)/.copied: $(LEGACYBIOS_SRC_DIR)/out/bios.bin > +$(SEABIOS_STAMP_DIR)/.copied: $(SEABIOS_SRC_DIR)/out/bios.bin > @ mkdir -p $(shell dirname $(PAYLOAD_ELF)) > - @ cp $(LEGACYBIOS_SRC_DIR)/out/bios.bin.elf $(PAYLOAD_ELF) > + @ cp $(SEABIOS_SRC_DIR)/out/bios.bin.elf $(PAYLOAD_ELF) > @ touch $@ > > -legacybios: $(LEGACYBIOS_STAMP_DIR)/.copied > - @ cp $(LEGACYBIOS_SRC_DIR)/out/bios.bin.elf $(LEGACYBIOS_SRC_DIR)/legacybios.elf > +seabios: $(SEABIOS_STAMP_DIR)/.copied > + @ cp $(SEABIOS_SRC_DIR)/out/bios.bin.elf $(SEABIOS_SRC_DIR)/seabios.elf > > -legacybios-clean: > - @ echo "Cleaning LegacyBIOS..." > - @ rm -f $(LEGACYBIOS_STAMP_DIR)/.copied > -ifneq ($(wildcard $(LEGACYBIOS_SRC_DIR)/Makefile),) > - @ $(MAKE) -C $(LEGACYBIOS_SRC_DIR) clean > /dev/null 2>&1 > +seabios-clean: > + @ echo "Cleaning SeaBIOS..." > + @ rm -f $(SEABIOS_STAMP_DIR)/.copied > +ifneq ($(wildcard $(SEABIOS_SRC_DIR)/Makefile),) > + @ $(MAKE) -C $(SEABIOS_SRC_DIR) clean > /dev/null 2>&1 > endif > > -legacybios-distclean: > - @ rm -rf $(LEGACYBIOS_DIR)/* > +seabios-distclean: > + @ rm -rf $(SEABIOS_DIR)/* > > Index: packages/legacybios/hardcode.diff > =================================================================== > --- packages/legacybios/hardcode.diff (revision 210) > +++ packages/legacybios/hardcode.diff (working copy) > @@ -1,39 +0,0 @@ > -diff --git a/src/config.h b/src/config.h > -index 4ae23dc..5ed9799 100644 > ---- a/src/config.h > -+++ b/src/config.h > -@@ -14,17 +14,17 @@ > - #endif > - > - // Configure as a payload coreboot payload. > --#define CONFIG_COREBOOT 0 > -+#define CONFIG_COREBOOT 1 > - > --#define CONFIG_DEBUG_SERIAL 0 > -+#define CONFIG_DEBUG_SERIAL 1 > - > --#define CONFIG_FLOPPY_SUPPORT 1 > -+#define CONFIG_FLOPPY_SUPPORT 1 > - #define CONFIG_PS2_MOUSE 1 > - #define CONFIG_ATA 1 > - #define CONFIG_KBD_CALL_INT15_4F 1 > - #define CONFIG_CDROM_BOOT 1 > - #define CONFIG_CDROM_EMU 1 > --#define CONFIG_PCIBIOS 1 > -+#define CONFIG_PCIBIOS 0 > - > - /* define it if the (emulated) hardware supports SMM mode */ > - #define CONFIG_USE_SMM 1 > -diff --git a/src/post.c b/src/post.c > -index a6f7c3d..7890d65 100644 > ---- a/src/post.c > -+++ b/src/post.c > -@@ -83,7 +83,7 @@ ram_probe(void) > - u32 rs; > - if (CONFIG_COREBOOT) { > - // XXX - just hardcode for now. > -- rs = 128*1024*1024; > -+ rs = 128*1024*1024; > - } else { > - // On emulators, get memory size from nvram. > - rs = (inb_cmos(CMOS_MEM_EXTMEM2_LOW) > Index: packages/legacybios/legacybios.mk > =================================================================== > --- packages/legacybios/legacybios.mk (revision 210) > +++ packages/legacybios/legacybios.mk (working copy) > @@ -1,59 +0,0 @@ > -LEGACYBIOS_URL=git://git.linuxtogo.org/home/kevin/legacybios/ > -LEGACYBIOS_TAG=master > - > -LEGACYBIOS_DIR=$(BUILD_DIR)/legacybios > -LEGACYBIOS_SRC_DIR=$(LEGACYBIOS_DIR)/legacybios-$(LEGACYBIOS_TAG) > -LEGACYBIOS_STAMP_DIR=$(LEGACYBIOS_DIR)/stamps > -LEGACYBIOS_LOG_DIR=$(LEGACYBIOS_DIR)/logs > - > -LEGACYBIOS_PATCHES=hardcode.diff > - > -ifeq ($(CONFIG_VERBOSE),y) > -LEGACYBIOS_FETCH_LOG=/dev/stdout > -LEGACYBIOS_BUILD_LOG=/dev/stdout > -else > -LEGACYBIOS_BUILD_LOG=$(LEGACYBIOS_LOG_DIR)/build.log > -LEGACYBIOS_FETCH_LOG=$(LEGACYBIOS_LOG_DIR)/fetch.log > -endif > - > -LEGACYBIOS_TARBALL=legacybios.tar > - > -ifeq ($(shell if [ -f $(PACKAGE_DIR)/legacybios/conf/customconfig--$(PAYLOAD)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD) ]; then echo 1; fi),1) > - LEGACYBIOS_CONFIG = customconfig--$(PAYLOAD)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD) > -endif > - > -$(SOURCE_DIR)/$(LEGACYBIOS_TARBALL): | $(LEGACYBIOS_STAMP_DIR) $(LEGACYBIOS_LOG_DIR) > - @ echo "Fetching LegacyBIOS..." > - @ mkdir -p $(SOURCE_DIR) > - @ $(BIN_DIR)/fetchgit.sh $(LEGACYBIOS_URL) $(SOURCE_DIR)/legacybios $(LEGACYBIOS_TAG) $(SOURCE_DIR)/$(LEGACYBIOS_TARBALL) legacybios > $(LEGACYBIOS_FETCH_LOG) 2>&1 > - > -$(LEGACYBIOS_STAMP_DIR)/.unpacked: $(SOURCE_DIR)/$(LEGACYBIOS_TARBALL) | $(LEGACYBIOS_STAMP_DIR) $(LEGACYBIOS_DIR) $(LEGACYBIOS_LOG_DIR) > - @ echo "Unpacking LegacyBIOS..." > - @ tar -C $(LEGACYBIOS_DIR) -xf $(SOURCE_DIR)/$(LEGACYBIOS_TARBALL) > - @ touch $@ > - > -$(LEGACYBIOS_SRC_DIR)/out/bios.bin: $(LEGACYBIOS_STAMP_DIR)/.unpacked > - @ echo "Building LegacyBIOS..." > - @ make -C $(LEGACYBIOS_SRC_DIR) > $(LEGACYBIOS_BUILD_LOG) 2>&1 > - > -$(LEGACYBIOS_STAMP_DIR) $(LEGACYBIOS_LOG_DIR): > - @ mkdir -p $@ > - > -$(LEGACYBIOS_STAMP_DIR)/.copied: $(LEGACYBIOS_SRC_DIR)/out/bios.bin > - @ mkdir -p $(shell dirname $(PAYLOAD_ELF)) > - @ cp $(LEGACYBIOS_SRC_DIR)/out/bios.bin.elf $(PAYLOAD_ELF) > - @ touch $@ > - > -legacybios: $(LEGACYBIOS_STAMP_DIR)/.copied > - @ cp $(LEGACYBIOS_SRC_DIR)/out/bios.bin.elf $(LEGACYBIOS_SRC_DIR)/legacybios.elf > - > -legacybios-clean: > - @ echo "Cleaning LegacyBIOS..." > - @ rm -f $(LEGACYBIOS_STAMP_DIR)/.copied > -ifneq ($(wildcard $(LEGACYBIOS_SRC_DIR)/Makefile),) > - @ $(MAKE) -C $(LEGACYBIOS_SRC_DIR) clean > /dev/null 2>&1 > -endif > - > -legacybios-distclean: > - @ rm -rf $(LEGACYBIOS_DIR)/* > - > Index: config/payloads/Config.in > =================================================================== > --- config/payloads/Config.in (revision 210) > +++ config/payloads/Config.in (working copy) > @@ -52,8 +52,8 @@ > bool "Linux As Bootloader" > select PAYLOAD_64BIT > > -config PAYLOAD_LEGACYBIOS > - bool "LegacyBIOS" > +config PAYLOAD_SEABIOS > + bool "SeaBIOS" > > config PAYLOAD_OFW > depends on EXPERIMENTAL > Index: config/payloads/payloads.conf > =================================================================== > --- config/payloads/payloads.conf (revision 210) > +++ config/payloads/payloads.conf (working copy) > @@ -16,7 +16,7 @@ > ### Include the correct payload configuration > > PAYLOAD-y= > -PAYLOAD-$(CONFIG_PAYLOAD_LEGACYBIOS) = legacybios > +PAYLOAD-$(CONFIG_PAYLOAD_SEABIOS) = seabios > PAYLOAD-$(CONFIG_PAYLOAD_LAB) = lab > PAYLOAD-$(CONFIG_PAYLOAD_ETHERBOOT) = etherboot > PAYLOAD-$(CONFIG_PAYLOAD_GPXE) = gpxe > -- > coreboot mailing list > coreboot at coreboot.org > http://www.coreboot.org/mailman/listinfo/coreboot -- Jordan Crouse Systems Software Development Engineer Advanced Micro Devices, Inc. From mylesgw at gmail.com Thu Jul 3 23:47:38 2008 From: mylesgw at gmail.com (Myles Watson) Date: Thu, 3 Jul 2008 15:47:38 -0600 Subject: [coreboot] LegacyBIOS -> SeaBIOS in buildrom In-Reply-To: <2831fecf0807031443w3b46cb9apae3137af0f648dcc@mail.gmail.com> References: <2831fecf0807031443w3b46cb9apae3137af0f648dcc@mail.gmail.com> Message-ID: <002801c8dd56$69e04310$0023040a@chimp> > This patch changes the name of LegacyBIOS to SeaBIOS, everywhere but the > git > URL, which hasn't been updated yet. It also updates the hardcode.diff > patch > now that the memory value is read from the coreboot tables, and fixes the > handling of that patch. > > Thanks, > Myles > > Signed-off-by: Myles Watson <mylesgw at gmail.com> I forgot to say that I used svn mv for the name changes, so it looks bigger than it was. Thanks, Myles From svn at coreboot.org Thu Jul 3 23:48:27 2008 From: svn at coreboot.org (svn at coreboot.org) Date: Thu, 3 Jul 2008 23:48:27 +0200 Subject: [coreboot] r211 - in buildrom-devel: config/payloads packages packages/seabios Message-ID: <mailman.1686.1355071340.16123.coreboot@coreboot.org> Author: myles Date: 2008-07-03 23:48:26 +0200 (Thu, 03 Jul 2008) New Revision: 211 Added: buildrom-devel/packages/seabios/ buildrom-devel/packages/seabios/seabios.mk Removed: buildrom-devel/packages/legacybios/ buildrom-devel/packages/seabios/legacybios.mk Modified: buildrom-devel/config/payloads/Config.in buildrom-devel/config/payloads/payloads.conf buildrom-devel/packages/seabios/hardcode.diff Log: This patch changes the name of LegacyBIOS to SeaBIOS, everywhere but the git URL, which hasn't been updated yet. It also updates the hardcode.diff patch now that the memory value is read from the coreboot tables, and fixes the handling of that patch. Thanks, Myles Signed-off-by: Myles Watson <mylesgw at gmail.com> Acked-by: Jordan Crouse <jordan.crouse at amd.com> Modified: buildrom-devel/config/payloads/Config.in =================================================================== --- buildrom-devel/config/payloads/Config.in 2008-07-02 19:45:34 UTC (rev 210) +++ buildrom-devel/config/payloads/Config.in 2008-07-03 21:48:26 UTC (rev 211) @@ -52,8 +52,8 @@ bool "Linux As Bootloader" select PAYLOAD_64BIT -config PAYLOAD_LEGACYBIOS - bool "LegacyBIOS" +config PAYLOAD_SEABIOS + bool "SeaBIOS" config PAYLOAD_OFW depends on EXPERIMENTAL Modified: buildrom-devel/config/payloads/payloads.conf =================================================================== --- buildrom-devel/config/payloads/payloads.conf 2008-07-02 19:45:34 UTC (rev 210) +++ buildrom-devel/config/payloads/payloads.conf 2008-07-03 21:48:26 UTC (rev 211) @@ -16,7 +16,7 @@ ### Include the correct payload configuration PAYLOAD-y= -PAYLOAD-$(CONFIG_PAYLOAD_LEGACYBIOS) = legacybios +PAYLOAD-$(CONFIG_PAYLOAD_SEABIOS) = seabios PAYLOAD-$(CONFIG_PAYLOAD_LAB) = lab PAYLOAD-$(CONFIG_PAYLOAD_ETHERBOOT) = etherboot PAYLOAD-$(CONFIG_PAYLOAD_GPXE) = gpxe Modified: buildrom-devel/packages/seabios/hardcode.diff =================================================================== --- buildrom-devel/packages/legacybios/hardcode.diff 2008-07-02 19:45:34 UTC (rev 210) +++ buildrom-devel/packages/seabios/hardcode.diff 2008-07-03 21:48:26 UTC (rev 211) @@ -1,14 +1,17 @@ -diff --git a/src/config.h b/src/config.h -index 4ae23dc..5ed9799 100644 ---- a/src/config.h -+++ b/src/config.h -@@ -14,17 +14,17 @@ +--- a/src/config.h 2008-07-03 15:12:21.000000000 -0600 ++++ b/src/config.h 2008-07-03 15:13:23.000000000 -0600 +@@ -14,31 +14,31 @@ #endif - // Configure as a payload coreboot payload. + // Configure as a coreboot payload. -#define CONFIG_COREBOOT 0 +#define CONFIG_COREBOOT 1 + // Control how verbose debug output is. +-#define CONFIG_DEBUG_LEVEL 1 ++#define CONFIG_DEBUG_LEVEL 6 + + // Send debugging information to serial port -#define CONFIG_DEBUG_SERIAL 0 +#define CONFIG_DEBUG_SERIAL 1 @@ -19,21 +22,22 @@ #define CONFIG_KBD_CALL_INT15_4F 1 #define CONFIG_CDROM_BOOT 1 #define CONFIG_CDROM_EMU 1 + // Support generation of a PIR table in 0xf000 segment (for emulators) +-#define CONFIG_PIRTABLE 1 ++#define CONFIG_PIRTABLE 1 + // Support generation of ACPI PIR tables (for emulators) +-#define CONFIG_ACPI 1 ++#define CONFIG_ACPI 1 + // Support int 1a/b1 PCI BIOS calls -#define CONFIG_PCIBIOS 1 -+#define CONFIG_PCIBIOS 0 ++#define CONFIG_PCIBIOS 1 + // Support int 15/53 APM BIOS calls +-#define CONFIG_APMBIOS 1 ++#define CONFIG_APMBIOS 1 /* define it if the (emulated) hardware supports SMM mode */ - #define CONFIG_USE_SMM 1 -diff --git a/src/post.c b/src/post.c -index a6f7c3d..7890d65 100644 ---- a/src/post.c -+++ b/src/post.c -@@ -83,7 +83,7 @@ ram_probe(void) - u32 rs; - if (CONFIG_COREBOOT) { - // XXX - just hardcode for now. -- rs = 128*1024*1024; -+ rs = 128*1024*1024; - } else { - // On emulators, get memory size from nvram. - rs = (inb_cmos(CMOS_MEM_EXTMEM2_LOW) +-#define CONFIG_USE_SMM 1 ++#define CONFIG_USE_SMM 1 + + /* if true, put the MP float table and ACPI RSDT in EBDA and the MP + table in RAM. Unfortunately, Linux has bugs with that, so we prefer Deleted: buildrom-devel/packages/seabios/legacybios.mk =================================================================== --- buildrom-devel/packages/legacybios/legacybios.mk 2008-07-02 19:45:34 UTC (rev 210) +++ buildrom-devel/packages/seabios/legacybios.mk 2008-07-03 21:48:26 UTC (rev 211) @@ -1,59 +0,0 @@ -LEGACYBIOS_URL=git://git.linuxtogo.org/home/kevin/legacybios/ -LEGACYBIOS_TAG=master - -LEGACYBIOS_DIR=$(BUILD_DIR)/legacybios -LEGACYBIOS_SRC_DIR=$(LEGACYBIOS_DIR)/legacybios-$(LEGACYBIOS_TAG) -LEGACYBIOS_STAMP_DIR=$(LEGACYBIOS_DIR)/stamps -LEGACYBIOS_LOG_DIR=$(LEGACYBIOS_DIR)/logs - -LEGACYBIOS_PATCHES=hardcode.diff - -ifeq ($(CONFIG_VERBOSE),y) -LEGACYBIOS_FETCH_LOG=/dev/stdout -LEGACYBIOS_BUILD_LOG=/dev/stdout -else -LEGACYBIOS_BUILD_LOG=$(LEGACYBIOS_LOG_DIR)/build.log -LEGACYBIOS_FETCH_LOG=$(LEGACYBIOS_LOG_DIR)/fetch.log -endif - -LEGACYBIOS_TARBALL=legacybios.tar - -ifeq ($(shell if [ -f $(PACKAGE_DIR)/legacybios/conf/customconfig--$(PAYLOAD)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD) ]; then echo 1; fi),1) - LEGACYBIOS_CONFIG = customconfig--$(PAYLOAD)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD) -endif - -$(SOURCE_DIR)/$(LEGACYBIOS_TARBALL): | $(LEGACYBIOS_STAMP_DIR) $(LEGACYBIOS_LOG_DIR) - @ echo "Fetching LegacyBIOS..." - @ mkdir -p $(SOURCE_DIR) - @ $(BIN_DIR)/fetchgit.sh $(LEGACYBIOS_URL) $(SOURCE_DIR)/legacybios $(LEGACYBIOS_TAG) $(SOURCE_DIR)/$(LEGACYBIOS_TARBALL) legacybios > $(LEGACYBIOS_FETCH_LOG) 2>&1 - -$(LEGACYBIOS_STAMP_DIR)/.unpacked: $(SOURCE_DIR)/$(LEGACYBIOS_TARBALL) | $(LEGACYBIOS_STAMP_DIR) $(LEGACYBIOS_DIR) $(LEGACYBIOS_LOG_DIR) - @ echo "Unpacking LegacyBIOS..." - @ tar -C $(LEGACYBIOS_DIR) -xf $(SOURCE_DIR)/$(LEGACYBIOS_TARBALL) - @ touch $@ - -$(LEGACYBIOS_SRC_DIR)/out/bios.bin: $(LEGACYBIOS_STAMP_DIR)/.unpacked - @ echo "Building LegacyBIOS..." - @ make -C $(LEGACYBIOS_SRC_DIR) > $(LEGACYBIOS_BUILD_LOG) 2>&1 - -$(LEGACYBIOS_STAMP_DIR) $(LEGACYBIOS_LOG_DIR): - @ mkdir -p $@ - -$(LEGACYBIOS_STAMP_DIR)/.copied: $(LEGACYBIOS_SRC_DIR)/out/bios.bin - @ mkdir -p $(shell dirname $(PAYLOAD_ELF)) - @ cp $(LEGACYBIOS_SRC_DIR)/out/bios.bin.elf $(PAYLOAD_ELF) - @ touch $@ - -legacybios: $(LEGACYBIOS_STAMP_DIR)/.copied - @ cp $(LEGACYBIOS_SRC_DIR)/out/bios.bin.elf $(LEGACYBIOS_SRC_DIR)/legacybios.elf - -legacybios-clean: - @ echo "Cleaning LegacyBIOS..." - @ rm -f $(LEGACYBIOS_STAMP_DIR)/.copied -ifneq ($(wildcard $(LEGACYBIOS_SRC_DIR)/Makefile),) - @ $(MAKE) -C $(LEGACYBIOS_SRC_DIR) clean > /dev/null 2>&1 -endif - -legacybios-distclean: - @ rm -rf $(LEGACYBIOS_DIR)/* - Copied: buildrom-devel/packages/seabios/seabios.mk (from rev 210, buildrom-devel/packages/legacybios/legacybios.mk) =================================================================== --- buildrom-devel/packages/seabios/seabios.mk (rev 0) +++ buildrom-devel/packages/seabios/seabios.mk 2008-07-03 21:48:26 UTC (rev 211) @@ -0,0 +1,64 @@ +SEABIOS_URL=git://git.linuxtogo.org/home/kevin/legacybios/ +SEABIOS_TAG=master + +SEABIOS_DIR=$(BUILD_DIR)/seabios +SEABIOS_SRC_DIR=$(SEABIOS_DIR)/seabios-$(SEABIOS_TAG) +SEABIOS_STAMP_DIR=$(SEABIOS_DIR)/stamps +SEABIOS_LOG_DIR=$(SEABIOS_DIR)/logs + +SEABIOS_PATCHES=$(PACKAGE_DIR)/seabios/hardcode.diff + +ifeq ($(CONFIG_VERBOSE),y) +SEABIOS_FETCH_LOG=/dev/stdout +SEABIOS_BUILD_LOG=/dev/stdout +else +SEABIOS_BUILD_LOG=$(SEABIOS_LOG_DIR)/build.log +SEABIOS_FETCH_LOG=$(SEABIOS_LOG_DIR)/fetch.log +endif + +SEABIOS_TARBALL=seabios.tar + +ifeq ($(shell if [ -f $(PACKAGE_DIR)/seabios/conf/customconfig--$(PAYLOAD)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD) ]; then echo 1; fi),1) + SEABIOS_CONFIG = customconfig--$(PAYLOAD)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD) +endif + +$(SOURCE_DIR)/$(SEABIOS_TARBALL): | $(SEABIOS_STAMP_DIR) $(SEABIOS_LOG_DIR) + @ echo "Fetching SeaBIOS..." + @ mkdir -p $(SOURCE_DIR) + @ $(BIN_DIR)/fetchgit.sh $(SEABIOS_URL) $(SOURCE_DIR)/seabios $(SEABIOS_TAG) $(SOURCE_DIR)/$(SEABIOS_TARBALL) seabios > $(SEABIOS_FETCH_LOG) 2>&1 + +$(SEABIOS_STAMP_DIR)/.unpacked: $(SOURCE_DIR)/$(SEABIOS_TARBALL) | $(SEABIOS_STAMP_DIR) $(SEABIOS_DIR) $(SEABIOS_LOG_DIR) + @ echo "Unpacking SeaBIOS..." + @ tar -C $(SEABIOS_DIR) -xf $(SOURCE_DIR)/$(SEABIOS_TARBALL) + @ touch $@ + +$(SEABIOS_STAMP_DIR)/.patched: $(SEABIOS_STAMP_DIR)/.unpacked + @ echo "Patching mkelfimage..." + @ $(BIN_DIR)/doquilt.sh $(SEABIOS_SRC_DIR) $(SEABIOS_PATCHES) + @ touch $@ + +$(SEABIOS_SRC_DIR)/out/bios.bin: $(SEABIOS_STAMP_DIR)/.patched + @ echo "Building SeaBIOS..." + @ make -C $(SEABIOS_SRC_DIR) > $(SEABIOS_BUILD_LOG) 2>&1 + +$(SEABIOS_STAMP_DIR) $(SEABIOS_LOG_DIR): + @ mkdir -p $@ + +$(SEABIOS_STAMP_DIR)/.copied: $(SEABIOS_SRC_DIR)/out/bios.bin + @ mkdir -p $(shell dirname $(PAYLOAD_ELF)) + @ cp $(SEABIOS_SRC_DIR)/out/bios.bin.elf $(PAYLOAD_ELF) + @ touch $@ + +seabios: $(SEABIOS_STAMP_DIR)/.copied + @ cp $(SEABIOS_SRC_DIR)/out/bios.bin.elf $(SEABIOS_SRC_DIR)/seabios.elf + +seabios-clean: + @ echo "Cleaning SeaBIOS..." + @ rm -f $(SEABIOS_STAMP_DIR)/.copied +ifneq ($(wildcard $(SEABIOS_SRC_DIR)/Makefile),) + @ $(MAKE) -C $(SEABIOS_SRC_DIR) clean > /dev/null 2>&1 +endif + +seabios-distclean: + @ rm -rf $(SEABIOS_DIR)/* + From mylesgw at gmail.com Thu Jul 3 23:49:24 2008 From: mylesgw at gmail.com (Myles Watson) Date: Thu, 3 Jul 2008 15:49:24 -0600 Subject: [coreboot] LegacyBIOS -> SeaBIOS in buildrom In-Reply-To: <20080703214816.GA9185@cosmic.amd.com> References: <2831fecf0807031443w3b46cb9apae3137af0f648dcc@mail.gmail.com> <20080703214816.GA9185@cosmic.amd.com> Message-ID: <2831fecf0807031449t3b9c4b21m18d69212c7687e83@mail.gmail.com> On Thu, Jul 3, 2008 at 3:48 PM, Jordan Crouse <jordan.crouse at amd.com> wrote: > On 03/07/08 15:43 -0600, Myles Watson wrote: >> This patch changes the name of LegacyBIOS to SeaBIOS, everywhere but the git >> URL, which hasn't been updated yet. It also updates the hardcode.diff patch >> now that the memory value is read from the coreboot tables, and fixes the >> handling of that patch. >> >> Thanks, >> Myles >> >> Signed-off-by: Myles Watson <mylesgw at gmail.com> > Acked-by: Jordan Crouse <jordan.crouse at amd.com> > Rev 211. Thanks, Myles From svn at coreboot.org Thu Jul 3 23:53:03 2008 From: svn at coreboot.org (coreboot) Date: Thu, 03 Jul 2008 21:53:03 -0000 Subject: [coreboot] #99: Clean up it87xx_probe_spi_flash() for better readability In-Reply-To: <041.847e6dc5be1bb0643933288f325a20d8@coreboot.org> References: <041.847e6dc5be1bb0643933288f325a20d8@coreboot.org> Message-ID: <050.7f54f6a0522443f5348148aa50e944ca@coreboot.org> #99: Clean up it87xx_probe_spi_flash() for better readability --------------------------------------+------------------------------------- Reporter: stuge | Owner: somebody Type: enhancement | Status: new Priority: minor | Milestone: flashrom v1.0 Component: flashrom | Version: Resolution: | Keywords: Dependencies: spi probe readability | Patchstatus: patch needs work --------------------------------------+------------------------------------- Changes (by hailfinger): * patchstatus: patch needs review => patch needs work Comment: The patch is not really a readability improvement. Sorry. -- Ticket URL: <http://tracker.coreboot.org/trac/coreboot/ticket/99#comment:1> coreboot <http://www.coreboot.org/> From mylesgw at gmail.com Thu Jul 3 23:54:11 2008 From: mylesgw at gmail.com (Myles Watson) Date: Thu, 3 Jul 2008 15:54:11 -0600 Subject: [coreboot] SeaBIOS CPP definition Message-ID: <2831fecf0807031454x747121a5hadbe5eaf12cc404c@mail.gmail.com> I'm not sure if it's buildrom's fault or SeaBIOS's, but the build fails for me with this error: make[1]: P: Command not found It's actually a symptom that $(CPP) isn't being set. When I add these lines in SeaBIOS's Makefile, it goes away. ifeq ($(CPP),) CPP=$(CC) -E endif Where should it get fixed? Thanks, Myles From stepan at coresystems.de Thu Jul 3 23:58:59 2008 From: stepan at coresystems.de (Stefan Reinauer) Date: Thu, 03 Jul 2008 23:58:59 +0200 Subject: [coreboot] [PATCH] [RFC] v3: CS5536 cleanup, and v3 design In-Reply-To: <486D1478.1020201@gmx.net> References: <48205A47.5060403@gmx.net> <4822458B.4030506@gmx.net> <13426df10805071751p7adb40c8s759875e09ccee15@mail.gmail.com> <48468AB6.5060605@gmx.net> <13426df10806040753y17eeb1f1q73319c0c82e00fc2@mail.gmail.com> <4846C7BD.5050601@gmx.net> <486CE69D.1080708@gmx.net> <20080703175358.21127.qmail@stuge.se> <486D1478.1020201@gmx.net> Message-ID: <486D4BA3.4020102@coresystems.de> Carl-Daniel Hailfinger wrote: > Absolutely. The ultimate goal is to kill dev_find_pci_device completely. > We have a really nice device model and we should not work around it with > v2-style code. This will not always be possible, because devices have interactions. Example: function setup_link_between_a_and_b: - Set bit X in device A - Set bit Y in device B - Poll bit Z in device A until a link between A and B is valid Now, you have to put that function either in device A or device B. Stefan -- coresystems GmbH ? Brahmsstr. 16 ? D-79104 Freiburg i. Br. Tel.: +49 761 7668825 ? Fax: +49 761 7664613 Email: info at coresystems.de ? http://www.coresystems.de/ Registergericht: Amtsgericht Freiburg ? HRB 7656 Gesch?ftsf?hrer: Stefan Reinauer ? Ust-IdNr.: DE245674866 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 249 bytes Desc: OpenPGP digital signature URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20080703/012876c0/attachment.sig> From svn at coreboot.org Fri Jul 4 00:01:44 2008 From: svn at coreboot.org (coreboot) Date: Thu, 03 Jul 2008 22:01:44 -0000 Subject: [coreboot] #98: Eliminate false positive "unknown .. SPI chip" matches In-Reply-To: <041.f5e0f851af475dd9ed354e9f68f1a10a@coreboot.org> References: <041.f5e0f851af475dd9ed354e9f68f1a10a@coreboot.org> Message-ID: <050.c3a081cdc314a4ceb5d7f4214a4a5346@coreboot.org> #98: Eliminate false positive "unknown .. SPI chip" matches -------------------------+-------------------------------------------------- Reporter: stuge | Owner: somebody Type: defect | Status: new Priority: major | Milestone: flashrom v1.0 Component: flashrom | Version: Resolution: | Keywords: spi probe Dependencies: #97 | Patchstatus: patch needs review -------------------------+-------------------------------------------------- Comment(by hailfinger): Can you match on the probing function instead? That would introduce less regressions. -- Ticket URL: <http://tracker.coreboot.org/trac/coreboot/ticket/98#comment:1> coreboot <http://www.coreboot.org/> From svn at coreboot.org Fri Jul 4 00:03:11 2008 From: svn at coreboot.org (coreboot) Date: Thu, 03 Jul 2008 22:03:11 -0000 Subject: [coreboot] #100: flashrom: Change start/end -s and -e to -S and -E, and change erase -E to -e. In-Reply-To: <041.8aa562bc051ad7561e8886785fe385eb@coreboot.org> References: <041.8aa562bc051ad7561e8886785fe385eb@coreboot.org> Message-ID: <050.f8bdaf7602e5a5029eebae1e4059b322@coreboot.org> #100: flashrom: Change start/end -s and -e to -S and -E, and change erase -E to -e. ----------------------------+----------------------------------------------- Reporter: stuge | Owner: somebody Type: enhancement | Status: new Priority: major | Milestone: flashrom v1.0 Component: flashrom | Version: Resolution: | Keywords: usability cli options Dependencies: | Patchstatus: patch needs review ----------------------------+----------------------------------------------- Comment(by hailfinger): If you can make sure nobody erases his chip by accident with this patch, why not? That would reauire additional command line argument verification, though. -- Ticket URL: <http://tracker.coreboot.org/trac/coreboot/ticket/100#comment:1> coreboot <http://www.coreboot.org/> From svn at coreboot.org Fri Jul 4 00:04:11 2008 From: svn at coreboot.org (coreboot) Date: Thu, 03 Jul 2008 22:04:11 -0000 Subject: [coreboot] #104: flashrom: Change flash drivers to never erase data before writing In-Reply-To: <041.613243c7ca7145feb67f1cb5420bf35c@coreboot.org> References: <041.613243c7ca7145feb67f1cb5420bf35c@coreboot.org> Message-ID: <050.72ae9320e32e86ead37c65a9d300e364@coreboot.org> #104: flashrom: Change flash drivers to never erase data before writing -------------------------+-------------------------------------------------- Reporter: stuge | Owner: somebody Type: defect | Status: new Priority: major | Milestone: flashrom v1.0 Component: flashrom | Version: Resolution: | Keywords: erase write Dependencies: #103 | Patchstatus: there is no patch -------------------------+-------------------------------------------------- Comment(by hailfinger): This needs a big fat warning issued to the user if he attempts to write to a non-erased area. Maybe even an abort. -- Ticket URL: <http://tracker.coreboot.org/trac/coreboot/ticket/104#comment:1> coreboot <http://www.coreboot.org/> From svn at coreboot.org Fri Jul 4 00:04:37 2008 From: svn at coreboot.org (coreboot) Date: Thu, 03 Jul 2008 22:04:37 -0000 Subject: [coreboot] #106: flashrom: Add -T to automatically test all flash chip operations In-Reply-To: <041.16204f2bdbfde4e3eac5ffa09962d8e9@coreboot.org> References: <041.16204f2bdbfde4e3eac5ffa09962d8e9@coreboot.org> Message-ID: <050.5a6dfd3464ecbf82494ef86b03a129dc@coreboot.org> #106: flashrom: Add -T to automatically test all flash chip operations ----------------------------+----------------------------------------------- Reporter: stuge | Owner: somebody Type: enhancement | Status: new Priority: major | Milestone: flashrom v1.0 Component: flashrom | Version: Resolution: | Keywords: testing Dependencies: | Patchstatus: there is no patch ----------------------------+----------------------------------------------- Comment(by hailfinger): Good idea. -- Ticket URL: <http://tracker.coreboot.org/trac/coreboot/ticket/106#comment:1> coreboot <http://www.coreboot.org/> From svn at coreboot.org Fri Jul 4 00:05:16 2008 From: svn at coreboot.org (coreboot) Date: Thu, 03 Jul 2008 22:05:16 -0000 Subject: [coreboot] #107: flashrom: Display test status in -L chip listing In-Reply-To: <041.eea91e31685039e0026d8afdaa925b4c@coreboot.org> References: <041.eea91e31685039e0026d8afdaa925b4c@coreboot.org> Message-ID: <050.a8bfa48ade42ffcc8f90ecd2a48be51e@coreboot.org> #107: flashrom: Display test status in -L chip listing ----------------------------+----------------------------------------------- Reporter: stuge | Owner: somebody Type: enhancement | Status: new Priority: minor | Milestone: flashrom v1.0 Component: flashrom | Version: Resolution: | Keywords: testing Dependencies: | Patchstatus: there is no patch ----------------------------+----------------------------------------------- Comment(by hailfinger): Good idea. I'd consider this to be optional, though. -- Ticket URL: <http://tracker.coreboot.org/trac/coreboot/ticket/107#comment:2> coreboot <http://www.coreboot.org/> From c-d.hailfinger.devel.2006 at gmx.net Fri Jul 4 00:08:36 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Fri, 04 Jul 2008 00:08:36 +0200 Subject: [coreboot] [PATCH] [RFC] v3: CS5536 cleanup, and v3 design In-Reply-To: <486D4BA3.4020102@coresystems.de> References: <48205A47.5060403@gmx.net> <4822458B.4030506@gmx.net> <13426df10805071751p7adb40c8s759875e09ccee15@mail.gmail.com> <48468AB6.5060605@gmx.net> <13426df10806040753y17eeb1f1q73319c0c82e00fc2@mail.gmail.com> <4846C7BD.5050601@gmx.net> <486CE69D.1080708@gmx.net> <20080703175358.21127.qmail@stuge.se> <486D1478.1020201@gmx.net> <486D4BA3.4020102@coresystems.de> Message-ID: <486D4DE4.7040908@gmx.net> On 03.07.2008 23:58, Stefan Reinauer wrote: > Carl-Daniel Hailfinger wrote: >> Absolutely. The ultimate goal is to kill dev_find_pci_device completely. >> We have a really nice device model and we should not work around it with >> v2-style code. > > This will not always be possible, because devices have interactions. > > Example: > > function setup_link_between_a_and_b: > - Set bit X in device A > - Set bit Y in device B > - Poll bit Z in device A until a link between A and B is valid > > Now, you have to put that function either in device A or device B. OK, that one is indeed valid. However, I'd like to keep the number of dev_find_*_device calls as low as possible without compromising code readability. For example, if you want to establish a link between two devices, calling the function with device pointers for both devices would make the code readable and stuff would still work. Regards, Carl-Daniel -- http://www.hailfinger.org/ From tsylla at gmail.com Fri Jul 4 00:13:42 2008 From: tsylla at gmail.com (Tom Sylla) Date: Thu, 3 Jul 2008 18:13:42 -0400 Subject: [coreboot] USB debug cables and emulation In-Reply-To: <2A9397B0A1294D5EB3113DFD65C04686@smitty2m> References: <AA28F077645B324881335614E4F7C4284A4954@win-ex01.bench.com> <aa908b5795d8db20e9f32c94700cc949@imap.1and1.com> <57947bf80807030755o741a9936w6ac854289bb31970@mail.gmail.com> <2A9397B0A1294D5EB3113DFD65C04686@smitty2m> Message-ID: <57947bf80807031513k42924db0md6ef32c450e6363b@mail.gmail.com> Others have pretty much replied with what I was trying to point out, but here are a couple more comments: On Thu, Jul 3, 2008 at 12:28 PM, Joseph Smith <joe at settoplinux.org> wrote: > I guess you don't get it. I am not doing it to mass produce and sell at a > lower cost. I don't really care about any kind of profit. I'm simply doing > it for a "HOWTO build your own USB 2.0 Debugger For Around 20 Dollars". $20 > Dollars for a PCB??? I am going to use a generic PCB you can pick up at > radio shack for 2 dollars. If I have to get some of the components at a > larger volume to get a cheaper price and re-sell them to interested parties > so they get a cheaper price I will. This is more for educational, learning, > and teaching purposes. Everything is not about money you know (or not) :-( I am not at all talking about greed, I am talking about practicality. You said you want to create instructions to build a $20 USB debug cable. I am saying that I don't think that is possible, and at *best*, you will be closer to the $50 number in the end. I am just hoping you realize that before you spend a lot of time and effort on it. What sort of volume discounts are you expecting? The number I said for the 2272 *was* for high quantity. I see 1 for $11, 100 for $9.73, and 500 for $9.45. Still pretty high. If there are other USB device ICs of the *same caliber* that are much cheaper, I would be very interested to know about them. If your goal is to learn USB, great, you'll learn a lot from doing something like that. Just expect that the kits or instructions you may offer in the end will get pretty close to the price of the Net20DC (at least in the US). Maybe you could create a cheaper solution for people outside the US, but expect that you will need to spin a PCB, and supply them to whoever might want to do it. From stepan at coresystems.de Fri Jul 4 00:21:29 2008 From: stepan at coresystems.de (Stefan Reinauer) Date: Fri, 04 Jul 2008 00:21:29 +0200 Subject: [coreboot] [PATCH] [RFC] v3: CS5536 cleanup, and v3 design In-Reply-To: <486D4DE4.7040908@gmx.net> References: <48205A47.5060403@gmx.net> <4822458B.4030506@gmx.net> <13426df10805071751p7adb40c8s759875e09ccee15@mail.gmail.com> <48468AB6.5060605@gmx.net> <13426df10806040753y17eeb1f1q73319c0c82e00fc2@mail.gmail.com> <4846C7BD.5050601@gmx.net> <486CE69D.1080708@gmx.net> <20080703175358.21127.qmail@stuge.se> <486D1478.1020201@gmx.net> <486D4BA3.4020102@coresystems.de> <486D4DE4.7040908@gmx.net> Message-ID: <486D50E9.3070507@coresystems.de> Carl-Daniel Hailfinger wrote: > OK, that one is indeed valid. However, I'd like to keep the number of > dev_find_*_device calls as low as possible without compromising code > readability. > For example, if you want to establish a link between two devices, > calling the function with device pointers for both devices would make > the code readable and stuff would still work. > Hmm... and we can describe those links between devices in the dts.. I think we tried that for HT once. So we'd have a construct of "devices" and a construct of "links" which are connections between devices. links would have enable, disable, reset(, probe?) as methods? -- coresystems GmbH ? Brahmsstr. 16 ? D-79104 Freiburg i. Br. Tel.: +49 761 7668825 ? Fax: +49 761 7664613 Email: info at coresystems.de ? http://www.coresystems.de/ Registergericht: Amtsgericht Freiburg ? HRB 7656 Gesch?ftsf?hrer: Stefan Reinauer ? Ust-IdNr.: DE245674866 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 249 bytes Desc: OpenPGP digital signature URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20080704/4ab34a85/attachment.sig> From svn at coreboot.org Fri Jul 4 00:22:54 2008 From: svn at coreboot.org (coreboot) Date: Thu, 03 Jul 2008 22:22:54 -0000 Subject: [coreboot] #99: Clean up it87xx_probe_spi_flash() for better readability In-Reply-To: <041.847e6dc5be1bb0643933288f325a20d8@coreboot.org> References: <041.847e6dc5be1bb0643933288f325a20d8@coreboot.org> Message-ID: <050.b8c1d8eac1ee28da6df370a88d84d4dd@coreboot.org> #99: Clean up it87xx_probe_spi_flash() for better readability --------------------------------------+------------------------------------- Reporter: stuge | Owner: somebody Type: enhancement | Status: closed Priority: trivial | Milestone: Component: flashrom | Version: Resolution: wontfix | Keywords: Dependencies: spi probe readability | Patchstatus: patch needs work --------------------------------------+------------------------------------- Changes (by stuge): * priority: minor => trivial * status: new => closed * resolution: => wontfix * milestone: flashrom v1.0 => Comment: Forget this. The code will likely be revised in coming redesign anyway. -- Ticket URL: <http://tracker.coreboot.org/trac/coreboot/ticket/99#comment:2> coreboot <http://www.coreboot.org/> From c-d.hailfinger.devel.2006 at gmx.net Fri Jul 4 00:25:22 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Fri, 04 Jul 2008 00:25:22 +0200 Subject: [coreboot] [PATCH] [RFC] v3: CS5536 cleanup, and v3 design In-Reply-To: <486D50E9.3070507@coresystems.de> References: <48205A47.5060403@gmx.net> <4822458B.4030506@gmx.net> <13426df10805071751p7adb40c8s759875e09ccee15@mail.gmail.com> <48468AB6.5060605@gmx.net> <13426df10806040753y17eeb1f1q73319c0c82e00fc2@mail.gmail.com> <4846C7BD.5050601@gmx.net> <486CE69D.1080708@gmx.net> <20080703175358.21127.qmail@stuge.se> <486D1478.1020201@gmx.net> <486D4BA3.4020102@coresystems.de> <486D4DE4.7040908@gmx.net> <486D50E9.3070507@coresystems.de> Message-ID: <486D51D2.8020904@gmx.net> On 04.07.2008 00:21, Stefan Reinauer wrote: > Carl-Daniel Hailfinger wrote: >> OK, that one is indeed valid. However, I'd like to keep the number of >> dev_find_*_device calls as low as possible without compromising code >> readability. >> For example, if you want to establish a link between two devices, >> calling the function with device pointers for both devices would make >> the code readable and stuff would still work. >> > Hmm... and we can describe those links between devices in the dts.. I > think we tried that for HT once. > > So we'd have a construct of "devices" and a construct of "links" which > are connections between devices. > > links would have enable, disable, reset(, probe?) as methods? Great idea! Funny side note: I spent the last 9 months working on link/device model representation with dependencies for my diploma thesis. This will be an exciting way to cross-check the stuff I developed in a totally different field. Regards, Carl-Daniel -- http://www.hailfinger.org/ From svn at coreboot.org Fri Jul 4 00:25:09 2008 From: svn at coreboot.org (coreboot) Date: Thu, 03 Jul 2008 22:25:09 -0000 Subject: [coreboot] #104: flashrom: Change flash drivers to never erase data before writing In-Reply-To: <041.613243c7ca7145feb67f1cb5420bf35c@coreboot.org> References: <041.613243c7ca7145feb67f1cb5420bf35c@coreboot.org> Message-ID: <050.9479b4aeb3d8961e6a4ae0bea6bca60a@coreboot.org> #104: flashrom: Change flash drivers to never erase data before writing -------------------------+-------------------------------------------------- Reporter: stuge | Owner: somebody Type: defect | Status: new Priority: major | Milestone: flashrom v1.0 Component: flashrom | Version: Resolution: | Keywords: erase write Dependencies: #103 | Patchstatus: there is no patch -------------------------+-------------------------------------------------- Comment(by anonymous): If at all, NOT erasing should be an option. Not the other way round. a) this would break all scripts out there b) it's just bad design from a user perspective. c) it's technical infatuation rather than looking at the big picture. I veto any patch that changes the "automatic" behavior per default in advance. -- Ticket URL: <http://tracker.coreboot.org/trac/coreboot/ticket/104#comment:2> coreboot <http://www.coreboot.org/> From mylesgw at gmail.com Fri Jul 4 00:27:51 2008 From: mylesgw at gmail.com (Myles Watson) Date: Thu, 3 Jul 2008 16:27:51 -0600 Subject: [coreboot] SeaBIOS booting Message-ID: <2831fecf0807031527m16c7a9f5wcac5386b1af398d6@mail.gmail.com> Kevin, I didn't have my windows CD handy, so I tried several Linux install CDs, but I can't get them to boot on my s2892. They boot fine in qemu with SeaBIOS. As far as I can tell I configured it like you did. CONFIG_COREBOOT 1 CONFIG_DEBUG_LEVEL 6 CONFIG_DEBUG_SERIAL 1 CONFIG_FLOPPY_SUPPORT 0 Here's the log: Thanks, Myles Welcome to elfboot, the open sourced starter. January 2002, Eric Biederman. Version 1.3 rom_stream: 0xfff09000 - 0xfffe7fff Found ELF candidate at offset 0 header_offset is 0 Try to load at offset 0x0 New segment addr 0xf0000 size 0x10000 offset 0x1000 filesize 0x10000 (cleaned up) New segment addr 0xf0000 size 0x10000 offset 0x1000 filesize 0x10000 Loading Segment: addr: 0x00000000000f0000 memsz: 0x0000000000010000 filesz: 0x0000000000010000 Jumping to boot code at 0xf6720 Start bios clearing .bss section init bda init pic init timer init keyboard init lpt init serial init mouse math cp init bios_table_addr: 0x000ff0a5 end=0x000ff841 Find memory size Attempting to find coreboot table Copying PIR from 0dff0000 to 000ff0b0 Copying MPTABLE from 0dff0400 to 000ff0f0 ram_size=0xf8000000 Scan for VGA option rom Running option rom at 000c0003 Changing serial settings was 00000003/00000002 now 00000003/00000000 BIOS - begin e820 map has 6 items: 0: 0000000000000000 - 000000000009fc00 = 1 1: 000000000009fc00 - 00000000000a0000 = 2 2: 00000000000f0000 - 0000000000100000 = 2 3: 0000000000100000 - 000000000dff0000 = 1 4: 000000000dff0000 - 000000000e000000 = 2 5: 000000000e000000 - 00000000f8000000 = 1 init hard drives ata_detect(1) drive=0 sc=00000055 sn=000000aa ata_reset(1) status=000000d0 ata_reset(2) status=00000050 ata_detect(2) drive=0 sc=00000001 sn=00000001 ata_detect(3) drive=0 sc=00000001 sn=00000001 cl=00000000 ch=00000000 st=00000050 ata0-0: PCHS=16383/16/63 translation=lba LCHS=1024/255/63 ata0 master: WDC WD1200BB-00CAA0 ATA-5 Hard-Disk (111 GiBytes) ata_detect(1) drive=1 sc=00000055 sn=000000aa ata_reset(1) status=000000d0 ata_reset(2) status=00000050 ata_detect(2) drive=1 sc=00000001 sn=00000001 ata_detect(3) drive=1 sc=00000001 sn=00000001 cl=00000000 ch=00000000 st=00000050 ata0-1: PCHS=16383/16/63 translation=lba LCHS=1024/255/63 ata0 slave: WDC WD800JB-00JJC0 ATA-6 Hard-Disk (74 GiBytes) ata_detect(1) drive=2 sc=00000055 sn=000000aa ata_reset(1) status=00000080 ata_reset(2) status=00000000 ata_detect(2) drive=2 sc=00000001 sn=00000001 ata_detect(3) drive=2 sc=00000001 sn=00000001 cl=00000014 ch=000000eb st=00000000 ata1 master: SONY DVD-ROM DDU1615 ATAPI-7 CD-Rom/DVD-Rom ata_detect(1) drive=3 sc=0000007f sn=0000007f ata_detect(1) drive=4 sc=000000ff sn=000000ff ata_detect(1) drive=5 sc=000000ff sn=000000ff ata_detect(1) drive=6 sc=000000ff sn=000000ff ata_detect(1) drive=7 sc=000000ff sn=000000ff init boot device ordering Scan for option roms Found option rom with bad checksum: loc=000d0000 len=21504 sum=00000038 Press F12 for boot menu. Select boot device: 1. Floppy 2. Hard Disk 3. CD-Rom clearing .bss section Jump to int19 enter handle_19: NULL Booting from CD-Rom... ata_detect_medium: begin await_ide: (TIMEOUT,BSY,!BSY,!BSY_DRQ,!BSY_!DRQ,!BSY_RDY) 3 time= 32 timeout= 32000 await_ide: ERROR (TIMEOUT,BSY,!BSY,!BSY_DRQ,!BSY_!DRQ,!BSY_RDY) 3 status=00000051 time= 62 timeout= 32000 await_ide: (TIMEOUT,BSY,!BSY,!BSY_DRQ,!BSY_!DRQ,!BSY_RDY) 3 time= 32 timeout= 32000 await_ide: (TIMEOUT,BSY,!BSY,!BSY_DRQ,!BSY_!DRQ,!BSY_RDY) 3 time= 32 timeout= 32000 await_ide: (TIMEOUT,BSY,!BSY,!BSY_DRQ,!BSY_!DRQ,!BSY_RDY) 3 time= 64 timeout= 32000 await_ide: ERROR (TIMEOUT,BSY,!BSY,!BSY_DRQ,!BSY_!DRQ,!BSY_RDY) 3 status=00000051 time= 64 timeout= 32000 await_ide: (TIMEOUT,BSY,!BSY,!BSY_DRQ,!BSY_!DRQ,!BSY_RDY) 3 time= 32 timeout= 32000 await_ide: (TIMEOUT,BSY,!BSY,!BSY_DRQ,!BSY_!DRQ,!BSY_RDY) 3 time= 32 timeout= 32000 await_ide: (TIMEOUT,BSY,!BSY,!BSY_DRQ,!BSY_!DRQ,!BSY_RDY) 3 time= 64 timeout= 32000 await_ide: ERROR (TIMEOUT,BSY,!BSY,!BSY_DRQ,!BSY_!DRQ,!BSY_RDY) 3 status=00000051 time= 64 timeout= 32000 await_ide: (TIMEOUT,BSY,!BSY,!BSY_DRQ,!BSY_!DRQ,!BSY_RDY) 3 time= 32 timeout= 32000 await_ide: ERROR (TIMEOUT,BSY,!BSY,!BSY_DRQ,!BSY_!DRQ,!BSY_RDY) 3 status=00000051 time= 1 timeout= 32000 sectors=58921 115MB medium detected await_ide: (TIMEOUT,BSY,!BSY,!BSY_DRQ,!BSY_!DRQ,!BSY_RDY) 3 time= 32 timeout= 32000 Booting from 00000000:00007c00 enter handle_12: a=00000200 b=00000000 c=00000000 d=000000e0 si=00009f5b di=b3f14df8 ds=00000000 es=00000000 ip=00008224 cs=00000000 f=00000246 r=00007bb2 await_ide: (TIMEOUT,BSY,!BSY,!BSY_DRQ,!BSY_!DRQ,!BSY_RDY) 3 time= 32 timeout= 32000 await_ide: (TIMEOUT,BSY,!BSY,!BSY_DRQ,!BSY_!DRQ,!BSY_RDY) 3 time= 64 timeout= 32000 await_ide: (TIMEOUT,BSY,!BSY,!BSY_DRQ,!BSY_!DRQ,!BSY_RDY) 3 time= 32 timeout= 32000 await_ide: (TIMEOUT,BSY,!BSY,!BSY_DRQ,!BSY_!DRQ,!BSY_RDY) 3 time= 32 timeout= 32000 await_ide: (TIMEOUT,BSY,!BSY,!BSY_DRQ,!BSY_!DRQ,!BSY_RDY) 3 time= 32 timeout= 32000 await_ide: (TIMEOUT,BSY,!BSY,!BSY_DRQ,!BSY_!DRQ,!BSY_RDY) 3 time= 32 timeout= 32000 fail floppy_13XX: a=00000000 b=0000001a c=00000200 d=00000000 si=00000000 di=00030200 ds=00000000 es=00000000 ip=00008c3a cs=00000000 f=00000046 r=00007b80 From svn at coreboot.org Fri Jul 4 00:28:58 2008 From: svn at coreboot.org (coreboot) Date: Thu, 03 Jul 2008 22:28:58 -0000 Subject: [coreboot] #104: flashrom: Change flash drivers to never erase data before writing In-Reply-To: <041.613243c7ca7145feb67f1cb5420bf35c@coreboot.org> References: <041.613243c7ca7145feb67f1cb5420bf35c@coreboot.org> Message-ID: <050.daa23370c472d7d81bffa078a9b4e729@coreboot.org> #104: flashrom: Change flash drivers to never erase data before writing -------------------------+-------------------------------------------------- Reporter: stuge | Owner: somebody Type: defect | Status: new Priority: major | Milestone: flashrom v1.0 Component: flashrom | Version: Resolution: | Keywords: erase write Dependencies: #103 | Patchstatus: there is no patch -------------------------+-------------------------------------------------- Comment(by hailfinger): The problem is that SPI chips do not erase by default, so we have inconsistent behaviour. We need to agree on one behaviour and "fix" the non-conforming drivers. -- Ticket URL: <http://tracker.coreboot.org/trac/coreboot/ticket/104#comment:3> coreboot <http://www.coreboot.org/> From peter at stuge.se Fri Jul 4 00:36:40 2008 From: peter at stuge.se (Peter Stuge) Date: Fri, 4 Jul 2008 00:36:40 +0200 Subject: [coreboot] [PATCH] [RFC] v3: CS5536 cleanup, and v3 design In-Reply-To: <486D4BA3.4020102@coresystems.de> References: <48205A47.5060403@gmx.net> <4822458B.4030506@gmx.net> <13426df10805071751p7adb40c8s759875e09ccee15@mail.gmail.com> <48468AB6.5060605@gmx.net> <13426df10806040753y17eeb1f1q73319c0c82e00fc2@mail.gmail.com> <4846C7BD.5050601@gmx.net> <486CE69D.1080708@gmx.net> <20080703175358.21127.qmail@stuge.se> <486D1478.1020201@gmx.net> <486D4BA3.4020102@coresystems.de> Message-ID: <20080703223640.25737.qmail@stuge.se> On Thu, Jul 03, 2008 at 11:58:59PM +0200, Stefan Reinauer wrote: > >Absolutely. The ultimate goal is to kill dev_find_pci_device > >completely. > > This will not always be possible, because devices have interactions. > > Example: > > function setup_link_between_a_and_b: > - Set bit X in device A > - Set bit Y in device B > - Poll bit Z in device A until a link between A and B is valid > > Now, you have to put that function either in device A or device B. It probably goes outside both A and B. I think that's what you intend with the links. //Peter -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20080704/67141b17/attachment.sig> From joe at settoplinux.org Fri Jul 4 01:10:17 2008 From: joe at settoplinux.org (Joseph Smith) Date: Thu, 3 Jul 2008 19:10:17 -0400 Subject: [coreboot] USB debug cables and emulation In-Reply-To: <20080703202130.17415.qmail@stuge.se> References: <20080703171849.25200.qmail@stuge.se><5316BBB2E44445B99D12D0C00002CCDA@smitty2m> <20080703202130.17415.qmail@stuge.se> Message-ID: <3F563A4B2204444FB6FFDED53F383D1B@smitty2m> > So - comes down to why you want to do it. :) Well, I wanted to take this as a opportunity to learn the in's and out's of USB especially USB 2.0 (EHCI). If I make a cool debugging device along the way, then great :-) But I get the point, It will probably end up costing me an arm and a leg to do it. The NET 2270 USB2.0 Development Kit is $995.00..... :-( Also I really want to learn USB for coreboot payload purposes. Did anyone realize with all these different payloads we have none of them support USB completely?? Filo is the only one that supports OHCI but that is it. I want to learn about USB so I can get some USB support for legacy USB devices (keyboards/mouse) as well as support for booting USB drives. This non-USB situation is and always has been disturbing to me :-0 In a certain way it puts coreboot behind the times... Thanks, Joseph Smith Set-Top-Linux www.settoplinux.org From stepan at coresystems.de Fri Jul 4 01:21:19 2008 From: stepan at coresystems.de (Stefan Reinauer) Date: Fri, 04 Jul 2008 01:21:19 +0200 Subject: [coreboot] USB debug cables and emulation In-Reply-To: <3F563A4B2204444FB6FFDED53F383D1B@smitty2m> References: <20080703171849.25200.qmail@stuge.se><5316BBB2E44445B99D12D0C00002CCDA@smitty2m> <20080703202130.17415.qmail@stuge.se> <3F563A4B2204444FB6FFDED53F383D1B@smitty2m> Message-ID: <486D5EEF.7000201@coresystems.de> Joseph Smith wrote: > Also I really want to learn USB for coreboot payload purposes. Did anyone > realize with all these different payloads we have none of them support USB > completely?? Filo is the only one that supports OHCI but that is it. I want > to learn about USB so I can get some USB support for legacy USB devices > (keyboards/mouse) as well as support for booting USB drives. This non-USB > situation is and always has been disturbing to me :-0 > In a certain way it puts coreboot behind the times... > We're pretty far with the UHCI stack in GRUB2. If you are looking for a USB project to jump on, we can certainly use help ;-) Initial keyboard support is there. MSC support is there, UHCI is there. Missing: Fixes, Testing, OHCI, EHCI, Fixes, Fixes, Testing... Maybe we can pack it into libpayload instead of GRUB2 too, so we can make it available to more payloads? -- coresystems GmbH ? Brahmsstr. 16 ? D-79104 Freiburg i. Br. Tel.: +49 761 7668825 ? Fax: +49 761 7664613 Email: info at coresystems.de ? http://www.coresystems.de/ Registergericht: Amtsgericht Freiburg ? HRB 7656 Gesch?ftsf?hrer: Stefan Reinauer ? Ust-IdNr.: DE245674866 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 249 bytes Desc: OpenPGP digital signature URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20080704/5e41dfbd/attachment.sig> From joe at settoplinux.org Fri Jul 4 01:30:38 2008 From: joe at settoplinux.org (Joseph Smith) Date: Thu, 03 Jul 2008 19:30:38 -0400 Subject: [coreboot] USB debug cables and emulation In-Reply-To: <486D5EEF.7000201@coresystems.de> References: <20080703171849.25200.qmail@stuge.se><5316BBB2E44445B99D12D0C00002CCDA@smitty2m> <20080703202130.17415.qmail@stuge.se> <3F563A4B2204444FB6FFDED53F383D1B@smitty2m> <486D5EEF.7000201@coresystems.de> Message-ID: <91eeb3f61af892c64e4a0a24a83fd74d@imap.1and1.com> On Fri, 04 Jul 2008 01:21:19 +0200, Stefan Reinauer <stepan at coresystems.de> wrote: > Joseph Smith wrote: >> Also I really want to learn USB for coreboot payload purposes. Did > anyone >> realize with all these different payloads we have none of them support > USB >> completely?? Filo is the only one that supports OHCI but that is it. I > want >> to learn about USB so I can get some USB support for legacy USB devices >> (keyboards/mouse) as well as support for booting USB drives. This > non-USB >> situation is and always has been disturbing to me :-0 >> In a certain way it puts coreboot behind the times... >> > > We're pretty far with the UHCI stack in GRUB2. If you are looking for a > USB project to jump on, we can certainly use help ;-) > > Initial keyboard support is there. MSC support is there, UHCI is there. > > Missing: Fixes, Testing, OHCI, EHCI, Fixes, Fixes, Testing... > > Maybe we can pack it into libpayload instead of GRUB2 too, so we can > make it available to more payloads? > Stefan, I would love to help out. I offered my services to Patrick a while ago, with no response. What can I do? -- Thanks, Joseph Smith Set-Top-Linux www.settoplinux.org From c-d.hailfinger.devel.2006 at gmx.net Fri Jul 4 01:32:17 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Fri, 04 Jul 2008 01:32:17 +0200 Subject: [coreboot] [PATCH] [RFC] v3: CS5536 cleanup In-Reply-To: <4822458B.4030506@gmx.net> References: <48205A47.5060403@gmx.net> <4822458B.4030506@gmx.net> Message-ID: <486D6181.8070502@gmx.net> - Improve VPCI hiding debug message and add doxygen comments. - Replace a hand-crafted open-coded VPCI hiding sequence. Build tested on all relevant targets. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net> Index: LinuxBIOSv3-cs5536cleanup/southbridge/amd/cs5536/cs5536.c =================================================================== --- LinuxBIOSv3-cs5536cleanup/southbridge/amd/cs5536/cs5536.c (Revision 692) +++ LinuxBIOSv3-cs5536cleanup/southbridge/amd/cs5536/cs5536.c (Arbeitskopie) @@ -89,6 +89,28 @@ }; /** + * Hide unwanted virtual PCI device. + * + * @param vpci_devid The bus location of the device to be hidden. + * bits 0 -> 1 zero + * bits 2 -> 7 target dword within the target function + * (zero if we're disabling entire pci devices) + * bits 8 -> 10 target function of the device + * bits 11 -> 15 target pci device + * bits 16 -> 23 pci bus + * bits 24 -> 30 reserved and set to zero + * bit 31 triggers the config cycle + */ +static void hide_vpci(u32 vpci_devid) +{ + printk(BIOS_DEBUG, "Hiding VPCI device: 0x%08X (%02x:%02x.%01x)\n", + vpci_devid, (vpci_devid >> 16) & 0xff, + (vpci_devid >> 11) & 0x1f, (vpci_devid >> 8) & 0x7); + outl(vpci_devid + 0x7C, 0xCF8); + outl(0xDEADBEEF, 0xCFC); +} + +/** * Power button setup. * * Setup GPIO24, it is the external signal for CS5536 vsb_work_aux which @@ -175,8 +197,7 @@ static void enable_ide_nand_flash_header(void) { /* Tell VSA to use FLASH PCI header. Not IDE header. */ - outl(0x80007A40, 0xCF8); - outl(0xDEADBEEF, 0xCFC); + hide_vpci(0x800079C4); } #define RTC_CENTURY 0x32 @@ -619,16 +640,6 @@ pci_write_config32(dev, IDE_CFG, ide_cfg); } - -static void hide_vpci(u32 vpci_devid) -{ - /* Hide unwanted virtual PCI device. */ - printk(BIOS_DEBUG, "Hiding VPCI device: 0x%08X\n", - vpci_devid); - outl(vpci_devid + 0x7C, 0xCF8); - outl(0xDEADBEEF, 0xCFC); -} - /** * TODO. * -- http://www.hailfinger.org/ From joe at settoplinux.org Fri Jul 4 01:47:13 2008 From: joe at settoplinux.org (Joseph Smith) Date: Thu, 03 Jul 2008 19:47:13 -0400 Subject: [coreboot] Getting Paid to Develop Message-ID: <d8f26080ce4b8db1a3a047621d5b5312@imap.1and1.com> Good News! I just had my first donation to the Set-Top-Linux/Thomson IP1000/coreboot cause:-) This guy really really wants me to get the TV-Out going on the Thomson IP1000, so he donated some $$ to the cause. Kinda cool I thought. Well I'm going on vacation next week, but when I come back I will be in full force on the Intel Northbridge i2c/tv-out and USB for GRUB2 :-) -- Thanks, Joseph Smith Set-Top-Linux www.settoplinux.org From rminnich at gmail.com Fri Jul 4 01:56:16 2008 From: rminnich at gmail.com (ron minnich) Date: Thu, 3 Jul 2008 16:56:16 -0700 Subject: [coreboot] [PATCH] [RFC] v3: CS5536 cleanup In-Reply-To: <486D6181.8070502@gmx.net> References: <48205A47.5060403@gmx.net> <4822458B.4030506@gmx.net> <486D6181.8070502@gmx.net> Message-ID: <13426df10807031656l78487141oe374d0d5b41f04fb@mail.gmail.com> build tested. Let's get some run tests back before we commit. ron From patrick at georgi-clan.de Fri Jul 4 03:44:18 2008 From: patrick at georgi-clan.de (Patrick Georgi) Date: Fri, 04 Jul 2008 03:44:18 +0200 Subject: [coreboot] USB debug cables and emulation In-Reply-To: <91eeb3f61af892c64e4a0a24a83fd74d@imap.1and1.com> References: <20080703171849.25200.qmail@stuge.se><5316BBB2E44445B99D12D0C00002CCDA@smitty2m> <20080703202130.17415.qmail@stuge.se> <3F563A4B2204444FB6FFDED53F383D1B@smitty2m> <486D5EEF.7000201@coresystems.de> <91eeb3f61af892c64e4a0a24a83fd74d@imap.1and1.com> Message-ID: <486D8072.5080408@georgi-clan.de> Joseph Smith schrieb: >> We're pretty far with the UHCI stack in GRUB2. If you are looking for a >> USB project to jump on, we can certainly use help ;-) >> >> Initial keyboard support is there. MSC support is there, UHCI is there. >> >> Missing: Fixes, Testing, OHCI, EHCI, Fixes, Fixes, Testing... >> >> Maybe we can pack it into libpayload instead of GRUB2 too, so we can >> make it available to more payloads? >> It's clean code with no imports (though I got some clues from other sources, esp. as far as workarounds for chipset bugs are concerned, but it should be safe), so it's not bound to a license, and apart from grub_strcpy here and grub_uint32_t there, which can be sanitized easily, and some trivial pci controller detection logic, it's not very grub2 specific either. I merely develop it inside the grub2 tree because that's the most convenient for now. > Stefan, I would love to help out. I offered my services to Patrick a while > ago, with no response. > What can I do? > Oops, sorry! You seem to be only starting into USB now, but so did I when I started writing this code (which probably shows at places). I quickly collected a TODO: For UHCI: - testing and fixes, lots of it - make more clever (eg. bulk transfer with >1 packet/ms, which might be done next week already) - fix some abstractions (eg. bulk transfer is at the wrong place currently) - improve interrupt transfer handling For OHCI: - create driver (most of UHCI doesn't apply here, because the chip is more clever. "fix some abstractions" definitely helps, though) For EHCI: - figure out how to gain control over a device from the USB1 controller (that will somehow interact with the USB1 driver) - PING/DATA2 protocol, microframes support - extend HUB driver, so it handles USB1 devices on a USB2 hub USB devices: - the keyboard driver is rather rudimentary - mouse doesn't exist - mass storage only likes few devices (high priority for me) - hub driver doesn't have proper device power management yet Get the code to run, figure out the design (sorry, no documentation yet - but ask me. The code can only become better that way), play with it, fix it for your hardware, ask questions, send/commit patches, ... On my personal TODO (after this %!$# northbridge works for me) is most of the UHCI stuff, and mass storage. Everything else is pretty much free for grabs (but it might be good to tell me so I don't step on your toes). OHCI and mouse are definitely not on my list for the short term, other usb device drivers also aren't. I also don't mind patches to any part of the code :-) Regards, Patrick Georgi From joe at settoplinux.org Fri Jul 4 05:12:52 2008 From: joe at settoplinux.org (Joseph Smith) Date: Thu, 3 Jul 2008 23:12:52 -0400 Subject: [coreboot] USB debug cables and emulation In-Reply-To: <486D8072.5080408@georgi-clan.de> References: <20080703171849.25200.qmail@stuge.se><5316BBB2E44445B99D12D0C00002CCDA@smitty2m> <20080703202130.17415.qmail@stuge.se> <3F563A4B2204444FB6FFDED53F383D1B@smitty2m> <486D5EEF.7000201@coresystems.de><91eeb3f61af892c64e4a0a24a83fd74d@imap.1and1.com> <486D8072.5080408@georgi-clan.de> Message-ID: <D29B6F0B906948AC993891E92C489098@smitty2m> > -----Original Message----- > From: coreboot-bounces+joe=settoplinux.org at coreboot.org [mailto:coreboot- > bounces+joe=settoplinux.org at coreboot.org] On Behalf Of Patrick Georgi > Sent: Thursday, July 03, 2008 9:44 PM > To: Joseph Smith > Cc: Stefan Reinauer; coreboot at coreboot.org > Subject: Re: [coreboot] USB debug cables and emulation > > Joseph Smith schrieb: > >> We're pretty far with the UHCI stack in GRUB2. If you are looking for a > >> USB project to jump on, we can certainly use help ;-) > >> > >> Initial keyboard support is there. MSC support is there, UHCI is there. > >> > >> Missing: Fixes, Testing, OHCI, EHCI, Fixes, Fixes, Testing... > >> > >> Maybe we can pack it into libpayload instead of GRUB2 too, so we can > >> make it available to more payloads? > >> > It's clean code with no imports (though I got some clues from other > sources, esp. as far as workarounds for chipset bugs are concerned, but > it should be safe), so it's not bound to a license, and apart from > grub_strcpy here and grub_uint32_t there, which can be sanitized easily, > and some trivial pci controller detection logic, it's not very grub2 > specific either. I merely develop it inside the grub2 tree because > that's the most convenient for now. > > Stefan, I would love to help out. I offered my services to Patrick a > while > > ago, with no response. > > What can I do? > > > Oops, sorry! > You seem to be only starting into USB now, but so did I when I started > writing this code (which probably shows at places). I quickly collected > a TODO: > > For UHCI: > - testing and fixes, lots of it > - make more clever (eg. bulk transfer with >1 packet/ms, which might be > done next week already) > - fix some abstractions (eg. bulk transfer is at the wrong place > currently) > - improve interrupt transfer handling > > For OHCI: > - create driver (most of UHCI doesn't apply here, because the chip is > more clever. "fix some abstractions" definitely helps, though) > > For EHCI: > - figure out how to gain control over a device from the USB1 controller > (that will somehow interact with the USB1 driver) > - PING/DATA2 protocol, microframes support > - extend HUB driver, so it handles USB1 devices on a USB2 hub > > USB devices: > - the keyboard driver is rather rudimentary > - mouse doesn't exist > - mass storage only likes few devices (high priority for me) > - hub driver doesn't have proper device power management yet > > Get the code to run, figure out the design (sorry, no documentation yet > - but ask me. The code can only become better that way), play with it, > fix it for your hardware, ask questions, send/commit patches, ... > > On my personal TODO (after this %!$# northbridge works for me) is most > of the UHCI stuff, and mass storage. Everything else is pretty much free > for grabs (but it might be good to tell me so I don't step on your > toes). OHCI and mouse are definitely not on my list for the short term, > other usb device drivers also aren't. I also don't mind patches to any > part of the code :-) > > Great. I am going to be on vacation next week. I am about half way through reading the USB 2.0 specification (http://www.usb.org/developers/docs/), and I will try to finish by next week and dive right in when I get back :-) Thanks, Joseph Smith Set-Top-Linux www.settoplinux.org From peter at stuge.se Fri Jul 4 05:50:35 2008 From: peter at stuge.se (Peter Stuge) Date: Fri, 4 Jul 2008 05:50:35 +0200 Subject: [coreboot] USB debug cables and emulation In-Reply-To: <486D8072.5080408@georgi-clan.de> References: <20080703202130.17415.qmail@stuge.se> <3F563A4B2204444FB6FFDED53F383D1B@smitty2m> <486D5EEF.7000201@coresystems.de> <91eeb3f61af892c64e4a0a24a83fd74d@imap.1and1.com> <486D8072.5080408@georgi-clan.de> Message-ID: <20080704035035.2732.qmail@stuge.se> On Fri, Jul 04, 2008 at 03:44:18AM +0200, Patrick Georgi wrote: > For UHCI: .. > For OHCI: .. > For EHCI: > - figure out how to gain control over a device from the USB1 > controller (that will somehow interact with the USB1 driver) Some comments, hopefully helpful: USB1 devices on the EHCI root hub do not appear on the EHCI controller. All EHCI controllers must also have one "companion" USB1 host controller per physical USB 2.0 port if they want to be backwards comatible so that USB1 devices can be connected to the root hub. When a USB1 device is connected to a root hub port, the device appears on that port's companion HC PCI device instead of on the EHCI PCI device. > - PING/DATA2 protocol, microframes support > - extend HUB driver, so it handles USB1 devices on a USB2 hub Look into USB 2.0 spec chapter 11.14 re Transaction Translators. USB2 hubs that support USB1 downstream devices have this split mode where a USB 2 transfer is used to start the USB1 transfer, and at a later time, another USB 2 transfer is used to complete the USB1 transfer. > USB devices: > - the keyboard driver is rather rudimentary > - mouse doesn't exist I would recommend starting with the keyboard or mouse device drivers. The only issue is that the HID Class can be a bit difficult to understand. //Peter From kevin at koconnor.net Fri Jul 4 08:33:12 2008 From: kevin at koconnor.net (Kevin O'Connor) Date: Fri, 4 Jul 2008 02:33:12 -0400 Subject: [coreboot] LegacyBIOS -> SeaBIOS in buildrom In-Reply-To: <2831fecf0807031443w3b46cb9apae3137af0f648dcc@mail.gmail.com> References: <2831fecf0807031443w3b46cb9apae3137af0f648dcc@mail.gmail.com> Message-ID: <20080704063312.GA7073@morn.localdomain> Hi Myles, On Thu, Jul 03, 2008 at 03:43:43PM -0600, Myles Watson wrote: > This patch changes the name of LegacyBIOS to SeaBIOS, everywhere but the git > URL, which hasn't been updated yet. It also updates the hardcode.diff patch > now that the memory value is read from the coreboot tables, and fixes the > handling of that patch. Thanks for doing this. The new git url is at git://git.linuxtogo.org/home/kevin/seabios/ The old url will still work, but it would be better to use the new one. > +--- a/src/config.h 2008-07-03 15:12:21.000000000 -0600 > ++++ b/src/config.h 2008-07-03 15:13:23.000000000 -0600 [...] > + // Support generation of a PIR table in 0xf000 segment (for emulators) > +-#define CONFIG_PIRTABLE 1 > ++#define CONFIG_PIRTABLE 1 > + // Support generation of ACPI PIR tables (for emulators) > +-#define CONFIG_ACPI 1 > ++#define CONFIG_ACPI 1 > + // Support int 1a/b1 PCI BIOS calls > ++#define CONFIG_PCIBIOS 1 > + // Support int 15/53 APM BIOS calls > +-#define CONFIG_APMBIOS 1 > ++#define CONFIG_APMBIOS 1 > +-#define CONFIG_USE_SMM 1 > ++#define CONFIG_USE_SMM 1 CONFIG_ACPI, CONFIG_PIRTABLE, and CONFIG_USE_SMM don't actually do anything when CONFIG_COREBOOT is on. You probably do want to disables CONFIG_FLOPPY_SUPPORT - I'm not convinced that the floppy code will work on real hardware. Thanks again, -Kevin From kevin at koconnor.net Fri Jul 4 08:40:47 2008 From: kevin at koconnor.net (Kevin O'Connor) Date: Fri, 4 Jul 2008 02:40:47 -0400 Subject: [coreboot] SeaBIOS booting In-Reply-To: <2831fecf0807031454x747121a5hadbe5eaf12cc404c@mail.gmail.com> <2831fecf0807031527m16c7a9f5wcac5386b1af398d6@mail.gmail.com> References: <2831fecf0807031454x747121a5hadbe5eaf12cc404c@mail.gmail.com> <2831fecf0807031527m16c7a9f5wcac5386b1af398d6@mail.gmail.com> Message-ID: <20080704064047.GB7073@morn.localdomain> On Thu, Jul 03, 2008 at 04:27:51PM -0600, Myles Watson wrote: > Kevin, > > I didn't have my windows CD handy, so I tried several Linux install > CDs, but I can't get them to boot on my s2892. They boot fine in qemu > with SeaBIOS. Okay - thanks for trying. > Here's the log: I don't see anything unusual in the log. Did all the OSes die in the same way? Did anything come up on the vga screen? What OSes did you try? On Thu, Jul 03, 2008 at 03:54:11PM -0600, Myles Watson wrote: > I'm not sure if it's buildrom's fault or SeaBIOS's, but the build > fails for me with this error: > > make[1]: P: Command not found > > It's actually a symptom that $(CPP) isn't being set. When I add these > lines in SeaBIOS's Makefile, it goes away. > > ifeq ($(CPP),) > CPP=$(CC) -E > endif That's very odd. What distro did you try to build on? -Kevin From c-d.hailfinger.devel.2006 at gmx.net Fri Jul 4 14:27:08 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Fri, 04 Jul 2008 14:27:08 +0200 Subject: [coreboot] SeaBIOS booting In-Reply-To: <20080704064047.GB7073@morn.localdomain> References: <2831fecf0807031454x747121a5hadbe5eaf12cc404c@mail.gmail.com> <2831fecf0807031527m16c7a9f5wcac5386b1af398d6@mail.gmail.com> <20080704064047.GB7073@morn.localdomain> Message-ID: <486E171C.5070007@gmx.net> On 04.07.2008 08:40, Kevin O'Connor wrote: > On Thu, Jul 03, 2008 at 04:27:51PM -0600, Myles Watson wrote: > >> Kevin, >> >> I didn't have my windows CD handy, so I tried several Linux install >> CDs, but I can't get them to boot on my s2892. They boot fine in qemu >> with SeaBIOS. >> > > Okay - thanks for trying. > > >> Here's the log: >> > > I don't see anything unusual in the log. Did all the OSes die in the > same way? Did anything come up on the vga screen? What OSes did you > try? > I found the various "await_ide: ERROR" and "fail floppy_13XX" messages interesting. In another mail you said you're not sure the floppy support works with real hardware. Could that be one of the reasons for the problems Myles is seeing? Regards, Carl-Daniel -- http://www.hailfinger.org/ From svn at coreboot.org Fri Jul 4 14:40:16 2008 From: svn at coreboot.org (coreboot) Date: Fri, 04 Jul 2008 12:40:16 -0000 Subject: [coreboot] #102: flashrom: coreboot ROM image file identification heuristic is broken In-Reply-To: <041.d02ed69d3d641142e64c5b79feb8cb4e@coreboot.org> References: <041.d02ed69d3d641142e64c5b79feb8cb4e@coreboot.org> Message-ID: <050.e4f2e1025fce1ad028ae0f30f2fd3c1c@coreboot.org> #102: flashrom: coreboot ROM image file identification heuristic is broken -------------------------+-------------------------------------------------- Reporter: stuge | Owner: somebody Type: defect | Status: reopened Priority: major | Milestone: flashrom v1.0 Component: flashrom | Version: Resolution: | Keywords: rom image heuristic Dependencies: | Patchstatus: there is no patch -------------------------+-------------------------------------------------- Comment(by anonymous): The current version does not work on my system {{{ gcc -Os -Wall -Werror -c -o layout.o layout.c cc1: warnings being treated as errors layout.c: In function ?show_id?: layout.c:68: error: cast from pointer to integer of different size layout.c:70: error: cast from pointer to integer of different size make: *** [layout.o] Error 1 }}} -- Ticket URL: <http://tracker.coreboot.org/trac/coreboot/ticket/102#comment:5> coreboot <http://www.coreboot.org/> From svn at coreboot.org Fri Jul 4 15:05:23 2008 From: svn at coreboot.org (coreboot) Date: Fri, 04 Jul 2008 13:05:23 -0000 Subject: [coreboot] #102: flashrom: coreboot ROM image file identification heuristic is broken In-Reply-To: <041.d02ed69d3d641142e64c5b79feb8cb4e@coreboot.org> References: <041.d02ed69d3d641142e64c5b79feb8cb4e@coreboot.org> Message-ID: <050.f3e1c574ab4f8b8284d595954a9d1d52@coreboot.org> #102: flashrom: coreboot ROM image file identification heuristic is broken -------------------------+-------------------------------------------------- Reporter: stuge | Owner: somebody Type: defect | Status: reopened Priority: major | Milestone: flashrom v1.0 Component: flashrom | Version: Resolution: | Keywords: rom image heuristic Dependencies: | Patchstatus: there is no patch -------------------------+-------------------------------------------------- Comment(by anonymous): Is this what the author possibly meant? {{{ Index: layout.c =================================================================== --- layout.c (revision 3412) +++ layout.c (working copy) @@ -65,9 +65,9 @@ */ if ((*walk) == 0 || ((*walk) & 0x3ff) != 0 || *walk > size || *(walk - 1) > size || *(walk - 2) > size || - (!isprint((const char *)(bios + size - *(walk - 1))) && + (!isprint(*(const char *)(bios + size - *(walk - 1))) && ((const char *)(bios + size - *(walk - 1)))) || - (!isprint((const char *)(bios + size - *(walk - 2))) && + (!isprint(*(const char *)(bios + size - *(walk - 2))) && ((const char *)(bios + size - *(walk - 2))))) { printf("Flash image seems to be a legacy BIOS. Disabling checks.\n"); mainboard_vendor = def_name; }}} Was this code ever tested or reviewed? It obviously never worked like that. -- Ticket URL: <http://tracker.coreboot.org/trac/coreboot/ticket/102#comment:6> coreboot <http://www.coreboot.org/> From stepan at coresystems.de Fri Jul 4 15:28:54 2008 From: stepan at coresystems.de (Stefan Reinauer) Date: Fri, 04 Jul 2008 15:28:54 +0200 Subject: [coreboot] [PATCH] flashrom: Improve coreboot image detection heuristic In-Reply-To: <486D0CC0.6000209@gmx.net> References: <486CE226.1010200@gmx.net> <20080703164615.32201.qmail@stuge.se> <486D0CC0.6000209@gmx.net> Message-ID: <486E2596.8090805@coresystems.de> Carl-Daniel Hailfinger wrote: > On 03.07.2008 18:46, Peter Stuge wrote: > >> On Thu, Jul 03, 2008 at 04:28:54PM +0200, Carl-Daniel Hailfinger wrote: >> >> >>> + if ((*walk) == 0 || ((*walk) & 0x3ff) != 0 || *walk > size || >>> + *(walk - 1) > size || *(walk - 2) > size || >>> + (!isprint((const char *)(bios + size - *(walk - 1))) && >>> + ((const char *)(bios + size - *(walk - 1)))) || >>> + (!isprint((const char *)(bios + size - *(walk - 2))) && >>> + ((const char *)(bios + size - *(walk - 2))))) { >>> >>> >> I am in total disbelief. I should probably not be wasting any more of >> my time on cleanups and restructuring. >> >> > > Well, this is the only reliable fix until somebody steps forward to > implement LAR recognition for flashrom and fake LAR headers for v2 and > we agree on a standard for encapsulating vendor/model information in a > LAR. I don't see that happening in the next few weeks. > Reliable yes, but reliably wrong, unfortunately. It checks whether a pointer is printable, which makes absolutely no sense. Shame on me I acked this. -- coresystems GmbH ? Brahmsstr. 16 ? D-79104 Freiburg i. Br. Tel.: +49 761 7668825 ? Fax: +49 761 7664613 Email: info at coresystems.de ? http://www.coresystems.de/ Registergericht: Amtsgericht Freiburg ? HRB 7656 Gesch?ftsf?hrer: Stefan Reinauer ? Ust-IdNr.: DE245674866 From stepan at coresystems.de Fri Jul 4 15:29:39 2008 From: stepan at coresystems.de (Stefan Reinauer) Date: Fri, 04 Jul 2008 15:29:39 +0200 Subject: [coreboot] [PATCH] flashrom: Improve coreboot image detection heuristic In-Reply-To: <486D0CC0.6000209@gmx.net> References: <486CE226.1010200@gmx.net> <20080703164615.32201.qmail@stuge.se> <486D0CC0.6000209@gmx.net> Message-ID: <486E25C3.6040101@coresystems.de> Carl-Daniel Hailfinger wrote: >> But let's discuss a technical aspect. Hhow does this new heuristic >> relate to v3 larballs? >> >> > > If it worked with v3 before, it will still work. > The mechanism does not work for v3 at all. It never did. -- coresystems GmbH ? Brahmsstr. 16 ? D-79104 Freiburg i. Br. Tel.: +49 761 7668825 ? Fax: +49 761 7664613 Email: info at coresystems.de ? http://www.coresystems.de/ Registergericht: Amtsgericht Freiburg ? HRB 7656 Gesch?ftsf?hrer: Stefan Reinauer ? Ust-IdNr.: DE245674866 From stepan at coresystems.de Fri Jul 4 15:34:56 2008 From: stepan at coresystems.de (Stefan Reinauer) Date: Fri, 04 Jul 2008 15:34:56 +0200 Subject: [coreboot] flashrom: Remove Makefile pciutils check, and don't rm *~ in clean In-Reply-To: <20080703174249.11839.qmail@stuge.se> References: <20080701221822.18719.qmail@stuge.se> <486AC6F2.8050509@coresystems.de> <20080702012316.1575.qmail@stuge.se> <dd3c80060807022248i496ec1bes2239f9950a44ba39@mail.gmail.com> <20080701221822.18719.qmail@stuge.se> <486AEAA2.6080709@gmx.net> <20080702030500.14860.qmail@stuge.se> <486C2872.8090306@gmx.net> <20080703094110.30495.qmail@stuge.se> <20080703171539.GA24556@greenwood> <20080703174249.11839.qmail@stuge.se> Message-ID: <486E2700.3070207@coresystems.de> Peter Stuge wrote: >> Personally I prefer keeping the check in the Makefile (if at all). >> > > I would love to simply remove the check. Then flashrom will be like > every other package I've seen. > > The error message from compile or link commands (as run by make) is > IMHO far better than anything we can pretend to produce on our own. > > If there is a library missing, the linker will make that clear. > > Can we convince Stefan? :) > No, I disagree. Go check the mailing list archive for error reports that lead to that message. People started complaining because /usr/include/linux/pci.h was there and it still would not work. I don't see what's wrong with the check. Stefan -- coresystems GmbH ? Brahmsstr. 16 ? D-79104 Freiburg i. Br. Tel.: +49 761 7668825 ? Fax: +49 761 7664613 Email: info at coresystems.de ? http://www.coresystems.de/ Registergericht: Amtsgericht Freiburg ? HRB 7656 Gesch?ftsf?hrer: Stefan Reinauer ? Ust-IdNr.: DE245674866 From c-d.hailfinger.devel.2006 at gmx.net Fri Jul 4 18:11:54 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Fri, 04 Jul 2008 18:11:54 +0200 Subject: [coreboot] [PATCH] flashrom: Improve coreboot image detection heuristic In-Reply-To: <486E2596.8090805@coresystems.de> References: <486CE226.1010200@gmx.net> <20080703164615.32201.qmail@stuge.se> <486D0CC0.6000209@gmx.net> <486E2596.8090805@coresystems.de> Message-ID: <486E4BCA.5060408@gmx.net> On 04.07.2008 15:28, Stefan Reinauer wrote: > Carl-Daniel Hailfinger wrote: > >> On 03.07.2008 18:46, Peter Stuge wrote: >> >> >>> On Thu, Jul 03, 2008 at 04:28:54PM +0200, Carl-Daniel Hailfinger wrote: >>> >>> >>> >>>> + if ((*walk) == 0 || ((*walk) & 0x3ff) != 0 || *walk > size || >>>> + *(walk - 1) > size || *(walk - 2) > size || >>>> + (!isprint((const char *)(bios + size - *(walk - 1))) && >>>> + ((const char *)(bios + size - *(walk - 1)))) || >>>> + (!isprint((const char *)(bios + size - *(walk - 2))) && >>>> + ((const char *)(bios + size - *(walk - 2))))) { >>>> >>>> >>>> >>> I am in total disbelief. I should probably not be wasting any more of >>> my time on cleanups and restructuring. >>> >>> >>> >> Well, this is the only reliable fix until somebody steps forward to >> implement LAR recognition for flashrom and fake LAR headers for v2 and >> we agree on a standard for encapsulating vendor/model information in a >> LAR. I don't see that happening in the next few weeks. >> >> > Reliable yes, but reliably wrong, unfortunately. It checks whether a > pointer is printable, which makes absolutely no sense. > Shame on me I acked this. > Sorry. I had a correct version, but it seems I pressed undo before saving. Fix coreboot image detection heuristic. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net> Index: flashrom-tmp1/layout.c =================================================================== --- flashrom-tmp1/layout.c (Revision 3412) +++ flashrom-tmp1/layout.c (Arbeitskopie) @@ -65,10 +65,10 @@ */ if ((*walk) == 0 || ((*walk) & 0x3ff) != 0 || *walk > size || *(walk - 1) > size || *(walk - 2) > size || - (!isprint((const char *)(bios + size - *(walk - 1))) && - ((const char *)(bios + size - *(walk - 1)))) || - (!isprint((const char *)(bios + size - *(walk - 2))) && - ((const char *)(bios + size - *(walk - 2))))) { + (!isprint(*(const char *)(bios + size - *(walk - 1))) && + (*(const char *)(bios + size - *(walk - 1)))) || + (!isprint(*(const char *)(bios + size - *(walk - 2))) && + (*(const char *)(bios + size - *(walk - 2))))) { printf("Flash image seems to be a legacy BIOS. Disabling checks.\n"); mainboard_vendor = def_name; mainboard_part = def_name; -- http://www.hailfinger.org/ From peter at stuge.se Fri Jul 4 18:25:53 2008 From: peter at stuge.se (Peter Stuge) Date: Fri, 4 Jul 2008 18:25:53 +0200 Subject: [coreboot] [PATCH] flashrom: Improve coreboot image detection heuristic In-Reply-To: <486E4BCA.5060408@gmx.net> References: <486CE226.1010200@gmx.net> <20080703164615.32201.qmail@stuge.se> <486D0CC0.6000209@gmx.net> <486E2596.8090805@coresystems.de> <486E4BCA.5060408@gmx.net> Message-ID: <20080704162553.10372.qmail@stuge.se> On Fri, Jul 04, 2008 at 06:11:54PM +0200, Carl-Daniel Hailfinger wrote: > + (!isprint(*(const char *)(bios + size - *(walk - 1))) && > + (*(const char *)(bios + size - *(walk - 1)))) || > + (!isprint(*(const char *)(bios + size - *(walk - 2))) && > + (*(const char *)(bios + size - *(walk - 2))))) { NAK. I would like to fix this in a better way, or not at all. A four line long condition can simply not be the best way, even in the short term. //Peter From svn at coreboot.org Fri Jul 4 18:32:03 2008 From: svn at coreboot.org (coreboot) Date: Fri, 04 Jul 2008 16:32:03 -0000 Subject: [coreboot] #102: flashrom: coreboot ROM image file identification heuristic is broken In-Reply-To: <041.d02ed69d3d641142e64c5b79feb8cb4e@coreboot.org> References: <041.d02ed69d3d641142e64c5b79feb8cb4e@coreboot.org> Message-ID: <050.004eea617ab0baed70e1d77ba7a7fc76@coreboot.org> #102: flashrom: coreboot ROM image file identification heuristic is broken -------------------------+-------------------------------------------------- Reporter: stuge | Owner: somebody Type: defect | Status: reopened Priority: major | Milestone: flashrom v1.0 Component: flashrom | Version: Resolution: | Keywords: rom image heuristic Dependencies: | Patchstatus: there is no patch -------------------------+-------------------------------------------------- Comment(by hailfinger): Replying to [comment:6 anonymous]: > Is this what the author possibly meant? Not completely. The patch below is a pure warning fix, but it doesn't fix the implementation of the mechanism completely. > > {{{ > Index: layout.c > =================================================================== > --- layout.c (revision 3412) > +++ layout.c (working copy) > @@ -65,9 +65,9 @@ > */ > if ((*walk) == 0 || ((*walk) & 0x3ff) != 0 || *walk > size || > *(walk - 1) > size || *(walk - 2) > size || > - (!isprint((const char *)(bios + size - *(walk - 1))) && > + (!isprint(*(const char *)(bios + size - *(walk - 1))) && > ((const char *)(bios + size - *(walk - 1)))) || > - (!isprint((const char *)(bios + size - *(walk - 2))) && > + (!isprint(*(const char *)(bios + size - *(walk - 2))) && > ((const char *)(bios + size - *(walk - 2))))) { > printf("Flash image seems to be a legacy BIOS. Disabling checks.\n"); > mainboard_vendor = def_name; > }}} > > Was this code ever tested or reviewed? It obviously never worked like that. It compiled cleanly without warnings on my machine (gcc 4.2.1), otherwise I wouldn't have committed it. And I would be very careful with claiming "it obviously never worked". If it was so obvious, why did you miss 50% of the pointer dereference bugs? Probably because you didn't read the code and only looked at compiler warnings. -- Ticket URL: <http://tracker.coreboot.org/trac/coreboot/ticket/102#comment:7> coreboot <http://www.coreboot.org/> From svn at coreboot.org Fri Jul 4 18:33:07 2008 From: svn at coreboot.org (coreboot) Date: Fri, 04 Jul 2008 16:33:07 -0000 Subject: [coreboot] #102: flashrom: coreboot ROM image file identification heuristic is broken In-Reply-To: <041.d02ed69d3d641142e64c5b79feb8cb4e@coreboot.org> References: <041.d02ed69d3d641142e64c5b79feb8cb4e@coreboot.org> Message-ID: <050.f84ac4ee8bc83abd15eebc1d140456f8@coreboot.org> #102: flashrom: coreboot ROM image file identification heuristic is broken -------------------------+-------------------------------------------------- Reporter: stuge | Owner: somebody Type: defect | Status: reopened Priority: major | Milestone: flashrom v1.0 Component: flashrom | Version: Resolution: | Keywords: rom image heuristic Dependencies: | Patchstatus: there is no patch -------------------------+-------------------------------------------------- Comment(by hailfinger): Updated patch posted to the mailing list. -- Ticket URL: <http://tracker.coreboot.org/trac/coreboot/ticket/102#comment:8> coreboot <http://www.coreboot.org/> From c-d.hailfinger.devel.2006 at gmx.net Fri Jul 4 18:51:00 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Fri, 04 Jul 2008 18:51:00 +0200 Subject: [coreboot] [PATCH] flashrom: Improve coreboot image detection heuristic In-Reply-To: <20080704162553.10372.qmail@stuge.se> References: <486CE226.1010200@gmx.net> <20080703164615.32201.qmail@stuge.se> <486D0CC0.6000209@gmx.net> <486E2596.8090805@coresystems.de> <486E4BCA.5060408@gmx.net> <20080704162553.10372.qmail@stuge.se> Message-ID: <486E54F4.9070901@gmx.net> On 04.07.2008 18:25, Peter Stuge wrote: > On Fri, Jul 04, 2008 at 06:11:54PM +0200, Carl-Daniel Hailfinger wrote: > >> + (!isprint(*(const char *)(bios + size - *(walk - 1))) && >> + (*(const char *)(bios + size - *(walk - 1)))) || >> + (!isprint(*(const char *)(bios + size - *(walk - 2))) && >> + (*(const char *)(bios + size - *(walk - 2))))) { >> > > NAK. I would like to fix this in a better way, or not at all. A four > line long condition can simply not be the best way, even in the short > term. > Hm. I could make that a lot more readable. How about this? By the way, the whole show_id function is and was completely broken when compiled for 64bit. Index: flashrom-tmp1/layout.c =================================================================== --- flashrom-tmp1/layout.c (Revision 3412) +++ flashrom-tmp1/layout.c (Arbeitskopie) @@ -44,7 +44,9 @@ int show_id(uint8_t *bios, int size, int force) { +#warning This code is completely broken on 64bit unsigned int *walk; + unsigned int mb_part_offset, mb_vendor_offset; walk = (unsigned int *)(bios + size - 0x10); walk--; @@ -63,12 +65,14 @@ * are outside the image of if the start of ID strings are nonsensical * (nonprintable and not \0). */ + mb_part_offset = *(walk - 1); + mb_vendor_offset = *(walk - 2); if ((*walk) == 0 || ((*walk) & 0x3ff) != 0 || *walk > size || - *(walk - 1) > size || *(walk - 2) > size || - (!isprint((const char *)(bios + size - *(walk - 1))) && - ((const char *)(bios + size - *(walk - 1)))) || - (!isprint((const char *)(bios + size - *(walk - 2))) && - ((const char *)(bios + size - *(walk - 2))))) { + mb_part_offset > size || mb_vendor_offset > size || + (!isprint(*(const char *)(bios + size - mb_part_offset)) && + (*(const char *)(bios + size - mb_part_offset))) || + (!isprint(*(const char *)(bios + size - mb_vendor_offset)) && + (*(const char *)(bios + size - mb_vendor_offset)))) { printf("Flash image seems to be a legacy BIOS. Disabling checks.\n"); mainboard_vendor = def_name; mainboard_part = def_name; -- http://www.hailfinger.org/ From stepan at coresystems.de Fri Jul 4 19:17:59 2008 From: stepan at coresystems.de (Stefan Reinauer) Date: Fri, 04 Jul 2008 19:17:59 +0200 Subject: [coreboot] [PATCH] flashrom: Improve coreboot image detection heuristic In-Reply-To: <486E4BCA.5060408@gmx.net> References: <486CE226.1010200@gmx.net> <20080703164615.32201.qmail@stuge.se> <486D0CC0.6000209@gmx.net> <486E2596.8090805@coresystems.de> <486E4BCA.5060408@gmx.net> Message-ID: <486E5B47.70209@coresystems.de> Carl-Daniel Hailfinger wrote: > Sorry. I had a correct version, but it seems I pressed undo before saving. > > Fix coreboot image detection heuristic. > > Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net> > I wonder whether it makes sense to explicitly say !=0 for the non-isprint parts to express that those are not booleans but checks whether a char is 0 I'm still not sure this really shows the correct behavior, but I guess it will compile on 64bit systems like this. Acked-by: Stefan Reinauer <stepan at coresystems.de> > Index: flashrom-tmp1/layout.c > =================================================================== > --- flashrom-tmp1/layout.c (Revision 3412) > +++ flashrom-tmp1/layout.c (Arbeitskopie) > @@ -65,10 +65,10 @@ > */ > if ((*walk) == 0 || ((*walk) & 0x3ff) != 0 || *walk > size || > *(walk - 1) > size || *(walk - 2) > size || > - (!isprint((const char *)(bios + size - *(walk - 1))) && > - ((const char *)(bios + size - *(walk - 1)))) || > - (!isprint((const char *)(bios + size - *(walk - 2))) && > - ((const char *)(bios + size - *(walk - 2))))) { > + (!isprint(*(const char *)(bios + size - *(walk - 1))) && > + (*(const char *)(bios + size - *(walk - 1)))) || > + (!isprint(*(const char *)(bios + size - *(walk - 2))) && > + (*(const char *)(bios + size - *(walk - 2))))) { > printf("Flash image seems to be a legacy BIOS. Disabling checks.\n"); > mainboard_vendor = def_name; > mainboard_part = def_name; > > > -- coresystems GmbH ? Brahmsstr. 16 ? D-79104 Freiburg i. Br. Tel.: +49 761 7668825 ? Fax: +49 761 7664613 Email: info at coresystems.de ? http://www.coresystems.de/ Registergericht: Amtsgericht Freiburg ? HRB 7656 Gesch?ftsf?hrer: Stefan Reinauer ? Ust-IdNr.: DE245674866 From stepan at coresystems.de Fri Jul 4 19:37:07 2008 From: stepan at coresystems.de (Stefan Reinauer) Date: Fri, 04 Jul 2008 19:37:07 +0200 Subject: [coreboot] [PATCH] flashrom: Improve coreboot image detection heuristic In-Reply-To: <486E54F4.9070901@gmx.net> References: <486CE226.1010200@gmx.net> <20080703164615.32201.qmail@stuge.se> <486D0CC0.6000209@gmx.net> <486E2596.8090805@coresystems.de> <486E4BCA.5060408@gmx.net> <20080704162553.10372.qmail@stuge.se> <486E54F4.9070901@gmx.net> Message-ID: <486E5FC3.3050308@coresystems.de> Carl-Daniel Hailfinger wrote: > Index: flashrom-tmp1/layout.c > =================================================================== > --- flashrom-tmp1/layout.c (Revision 3412) > +++ flashrom-tmp1/layout.c (Arbeitskopie) > @@ -44,7 +44,9 @@ > > int show_id(uint8_t *bios, int size, int force) > { > +#warning This code is completely broken on 64bit > Makes sense due to -Werror ;-) -- coresystems GmbH ? Brahmsstr. 16 ? D-79104 Freiburg i. Br. Tel.: +49 761 7668825 ? Fax: +49 761 7664613 Email: info at coresystems.de ? http://www.coresystems.de/ Registergericht: Amtsgericht Freiburg ? HRB 7656 Gesch?ftsf?hrer: Stefan Reinauer ? Ust-IdNr.: DE245674866 From svn at coreboot.org Fri Jul 4 19:39:09 2008 From: svn at coreboot.org (coreboot) Date: Fri, 04 Jul 2008 17:39:09 -0000 Subject: [coreboot] #102: flashrom: coreboot ROM image file identification heuristic is broken In-Reply-To: <041.d02ed69d3d641142e64c5b79feb8cb4e@coreboot.org> References: <041.d02ed69d3d641142e64c5b79feb8cb4e@coreboot.org> Message-ID: <050.9d8963b315f148d14ace209558784e52@coreboot.org> #102: flashrom: coreboot ROM image file identification heuristic is broken -------------------------+-------------------------------------------------- Reporter: stuge | Owner: somebody Type: defect | Status: reopened Priority: major | Milestone: flashrom v1.0 Component: flashrom | Version: Resolution: | Keywords: rom image heuristic Dependencies: | Patchstatus: there is no patch -------------------------+-------------------------------------------------- Comment(by anonymous): Oh, it's absolutely not obvious _how_ the code works. All I said is it is obvious that that very code never _worked_ in the side cases it was supposed to handle. -- Ticket URL: <http://tracker.coreboot.org/trac/coreboot/ticket/102#comment:9> coreboot <http://www.coreboot.org/> From svn at coreboot.org Fri Jul 4 19:50:44 2008 From: svn at coreboot.org (coreboot) Date: Fri, 04 Jul 2008 17:50:44 -0000 Subject: [coreboot] #102: flashrom: coreboot ROM image file identification heuristic is broken In-Reply-To: <041.d02ed69d3d641142e64c5b79feb8cb4e@coreboot.org> References: <041.d02ed69d3d641142e64c5b79feb8cb4e@coreboot.org> Message-ID: <050.651947e2531e14e033aeb4f3dd0b44bd@coreboot.org> #102: flashrom: coreboot ROM image file identification heuristic is broken -------------------------+-------------------------------------------------- Reporter: stuge | Owner: stuge Type: defect | Status: new Priority: major | Milestone: flashrom v1.0 Component: flashrom | Version: Resolution: | Keywords: rom image heuristic Dependencies: | Patchstatus: there is no patch -------------------------+-------------------------------------------------- Changes (by stuge): * owner: somebody => stuge * status: reopened => new Comment: Please don't spend more time on the current code. If it works for you, great, if it does not work for you, please apply fr.idheur.kludge.patch attached to this ticket. I've started work on the LAR patch. Let's try that out when it's done. -- Ticket URL: <http://tracker.coreboot.org/trac/coreboot/ticket/102#comment:10> coreboot <http://www.coreboot.org/> From kevin at koconnor.net Fri Jul 4 20:59:48 2008 From: kevin at koconnor.net (Kevin O'Connor) Date: Fri, 4 Jul 2008 14:59:48 -0400 Subject: [coreboot] SeaBIOS booting In-Reply-To: <486E171C.5070007@gmx.net> References: <2831fecf0807031454x747121a5hadbe5eaf12cc404c@mail.gmail.com> <2831fecf0807031527m16c7a9f5wcac5386b1af398d6@mail.gmail.com> <20080704064047.GB7073@morn.localdomain> <486E171C.5070007@gmx.net> Message-ID: <20080704185948.GA23925@morn.localdomain> Hi Carl-Daniel, On Fri, Jul 04, 2008 at 02:27:08PM +0200, Carl-Daniel Hailfinger wrote: > On 04.07.2008 08:40, Kevin O'Connor wrote: > > I don't see anything unusual in the log. Did all the OSes die in the > > same way? Did anything come up on the vga screen? What OSes did you > > try? > > I found the various "await_ide: ERROR" and "fail floppy_13XX" messages > interesting. In another mail you said you're not sure the floppy support > works with real hardware. Could that be one of the reasons for the > problems Myles is seeing? I did notice the "await_ide: ERROR", but the cdrom code was written to handle errors during ata_detect_medium (I guess real drives do that?). The cdrom did eventually return a valid looking sector count and size, so it doesn't look wrong to me. Myles stated that he had CONFIG_FLOPPY_SUPPORT disabled. If so, I don't see it causing a problem as the code wouldn't even be included. The "fail floppy_13XX" messages would be normal if the code isn't compiled in - every floppy bios call would return a failure status. -Kevin From c-d.hailfinger.devel.2006 at gmx.net Fri Jul 4 21:00:06 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Fri, 04 Jul 2008 21:00:06 +0200 Subject: [coreboot] [PATCH] flashrom: Improve coreboot image detection heuristic In-Reply-To: <486E5B47.70209@coresystems.de> References: <486CE226.1010200@gmx.net> <20080703164615.32201.qmail@stuge.se> <486D0CC0.6000209@gmx.net> <486E2596.8090805@coresystems.de> <486E4BCA.5060408@gmx.net> <486E5B47.70209@coresystems.de> Message-ID: <486E7336.8050806@gmx.net> On 04.07.2008 19:17, Stefan Reinauer wrote: > Carl-Daniel Hailfinger wrote: > > >> Sorry. I had a correct version, but it seems I pressed undo before saving. >> >> Fix coreboot image detection heuristic. >> >> Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net> >> >> > > I wonder whether it makes sense to explicitly say !=0 for the > non-isprint parts to express that those are not booleans but checks > whether a char is 0 > I came to the conclusion that matching a possibly empty string in the ROM does not make sense. Cleaned up patch follows. It compiles for me, is a LOT more readable and even removes hard-to-follow code from layout.c. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net> Index: layout.c =================================================================== --- layout.c (Revision 3412) +++ layout.c (Arbeitskopie) @@ -45,7 +45,12 @@ int show_id(uint8_t *bios, int size, int force) { unsigned int *walk; + unsigned int mb_part_offset, mb_vendor_offset; + char *mb_part, *mb_vendor; + mainboard_vendor = def_name; + mainboard_part = def_name; + walk = (unsigned int *)(bios + size - 0x10); walk--; @@ -63,25 +68,27 @@ * are outside the image of if the start of ID strings are nonsensical * (nonprintable and not \0). */ - if ((*walk) == 0 || ((*walk) & 0x3ff) != 0 || *walk > size || - *(walk - 1) > size || *(walk - 2) > size || - (!isprint((const char *)(bios + size - *(walk - 1))) && - ((const char *)(bios + size - *(walk - 1)))) || - (!isprint((const char *)(bios + size - *(walk - 2))) && - ((const char *)(bios + size - *(walk - 2))))) { + mb_part_offset = *(walk - 1); + mb_vendor_offset = *(walk - 2); + if ((*walk) == 0 || ((*walk) & 0x3ff) != 0 || (*walk) > size || + mb_part_offset > size || mb_vendor_offset > size) { printf("Flash image seems to be a legacy BIOS. Disabling checks.\n"); - mainboard_vendor = def_name; - mainboard_part = def_name; return 0; } + + mb_part = (char *)(bios + size - mb_part_offset); + mb_vendor = (char *)(bios + size - mb_vendor_offset); + if (!isprint(*mb_part) || !isprint(*mb_vendor)) { + printf("Flash image seems to have garbage in the ID location." + " Disabling checks.\n"); + return 0; + } printf_debug("coreboot last image size " "(not ROM size) is %d bytes.\n", *walk); - walk--; - mainboard_part = strdup((const char *)(bios + size - *walk)); - walk--; - mainboard_vendor = strdup((const char *)(bios + size - *walk)); + mainboard_part = strdup(mb_part); + mainboard_vendor = strdup(mb_vendor); printf_debug("Manufacturer: %s\n", mainboard_vendor); printf_debug("Mainboard ID: %s\n", mainboard_part); -- http://www.hailfinger.org/ From c-d.hailfinger.devel.2006 at gmx.net Fri Jul 4 21:09:37 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Fri, 04 Jul 2008 21:09:37 +0200 Subject: [coreboot] SeaBIOS booting In-Reply-To: <20080704185948.GA23925@morn.localdomain> References: <2831fecf0807031454x747121a5hadbe5eaf12cc404c@mail.gmail.com> <2831fecf0807031527m16c7a9f5wcac5386b1af398d6@mail.gmail.com> <20080704064047.GB7073@morn.localdomain> <486E171C.5070007@gmx.net> <20080704185948.GA23925@morn.localdomain> Message-ID: <486E7571.5000904@gmx.net> Hi Kevin, On 04.07.2008 20:59, Kevin O'Connor wrote: > Hi Carl-Daniel, > > On Fri, Jul 04, 2008 at 02:27:08PM +0200, Carl-Daniel Hailfinger wrote: > >> On 04.07.2008 08:40, Kevin O'Connor wrote: >> >>> I don't see anything unusual in the log. Did all the OSes die in the >>> same way? Did anything come up on the vga screen? What OSes did you >>> try? >>> >> I found the various "await_ide: ERROR" and "fail floppy_13XX" messages >> interesting. In another mail you said you're not sure the floppy support >> works with real hardware. Could that be one of the reasons for the >> problems Myles is seeing? >> > > I did notice the "await_ide: ERROR", but the cdrom code was written to > handle errors during ata_detect_medium (I guess real drives do that?). > The cdrom did eventually return a valid looking sector count and size, > so it doesn't look wrong to me. > > Myles stated that he had CONFIG_FLOPPY_SUPPORT disabled. If so, I > don't see it causing a problem as the code wouldn't even be included. > The "fail floppy_13XX" messages would be normal if the code isn't > compiled in - every floppy bios call would return a failure status. > Hmmm. I do believe you. I'd be interested in what a proprietary BIOS does when no floppy is present and when floppy support is disabled. IIRC there is a BIOS call listing the number of floppies which never fails. Regards, Carl-Daniel From svn at coreboot.org Fri Jul 4 21:19:10 2008 From: svn at coreboot.org (coreboot) Date: Fri, 04 Jul 2008 19:19:10 -0000 Subject: [coreboot] #102: flashrom: coreboot ROM image file identification heuristic is broken In-Reply-To: <041.d02ed69d3d641142e64c5b79feb8cb4e@coreboot.org> References: <041.d02ed69d3d641142e64c5b79feb8cb4e@coreboot.org> Message-ID: <050.91d3324fd09bec9613cf8af90eee3078@coreboot.org> #102: flashrom: coreboot ROM image file identification heuristic is broken -------------------------+-------------------------------------------------- Reporter: stuge | Owner: stuge Type: defect | Status: new Priority: major | Milestone: flashrom v1.0 Component: flashrom | Version: Resolution: | Keywords: rom image heuristic Dependencies: | Patchstatus: there is no patch -------------------------+-------------------------------------------------- Comment(by hailfinger): Peter, the LAR patch will be difficult unless you're willing to put the ID in the top boot block. The trick is to have both a generic coreboot marker and the ID strings in a place that's always mapped. That way, we can apply board-specific ROM enable or readout functions automatically. Other ways lead to disaster and madness. -- Ticket URL: <http://tracker.coreboot.org/trac/coreboot/ticket/102#comment:11> coreboot <http://www.coreboot.org/> From mylesgw at gmail.com Fri Jul 4 21:43:26 2008 From: mylesgw at gmail.com (Myles Watson) Date: Fri, 4 Jul 2008 13:43:26 -0600 Subject: [coreboot] LegacyBIOS -> SeaBIOS in buildrom In-Reply-To: <20080704063312.GA7073@morn.localdomain> References: <2831fecf0807031443w3b46cb9apae3137af0f648dcc@mail.gmail.com> <20080704063312.GA7073@morn.localdomain> Message-ID: <005601c8de0e$3ba7f2f0$0023040a@chimp> > -----Original Message----- > From: Kevin O'Connor [mailto:kevin at koconnor.net] > Sent: Friday, July 04, 2008 12:33 AM > To: Myles Watson > Cc: Coreboot > Subject: Re: [coreboot] LegacyBIOS -> SeaBIOS in buildrom > > Hi Myles, > > On Thu, Jul 03, 2008 at 03:43:43PM -0600, Myles Watson wrote: > > This patch changes the name of LegacyBIOS to SeaBIOS, everywhere but the > git > > URL, which hasn't been updated yet. It also updates the hardcode.diff > patch > > now that the memory value is read from the coreboot tables, and fixes > the > > handling of that patch. > > Thanks for doing this. No problem. > The new git url is at git://git.linuxtogo.org/home/kevin/seabios/ > > The old url will still work, but it would be better to use the new > one. I'll switch it on Monday. > > +--- a/src/config.h 2008-07-03 15:12:21.000000000 -0600 > > ++++ b/src/config.h 2008-07-03 15:13:23.000000000 -0600 > [...] > > + // Support generation of a PIR table in 0xf000 segment (for emulators) > > +-#define CONFIG_PIRTABLE 1 > > ++#define CONFIG_PIRTABLE 1 > > + // Support generation of ACPI PIR tables (for emulators) > > +-#define CONFIG_ACPI 1 > > ++#define CONFIG_ACPI 1 > > + // Support int 1a/b1 PCI BIOS calls > > ++#define CONFIG_PCIBIOS 1 > > + // Support int 15/53 APM BIOS calls > > +-#define CONFIG_APMBIOS 1 > > ++#define CONFIG_APMBIOS 1 > > +-#define CONFIG_USE_SMM 1 > > ++#define CONFIG_USE_SMM 1 > > CONFIG_ACPI, CONFIG_PIRTABLE, and CONFIG_USE_SMM don't actually do > anything when CONFIG_COREBOOT is on. > > You probably do want to disables CONFIG_FLOPPY_SUPPORT - I'm not > convinced that the floppy code will work on real hardware. All right. Thanks, Myles From mylesgw at gmail.com Fri Jul 4 21:46:33 2008 From: mylesgw at gmail.com (Myles Watson) Date: Fri, 4 Jul 2008 13:46:33 -0600 Subject: [coreboot] SeaBIOS booting In-Reply-To: <20080704064047.GB7073@morn.localdomain> References: <2831fecf0807031454x747121a5hadbe5eaf12cc404c@mail.gmail.com> <2831fecf0807031527m16c7a9f5wcac5386b1af398d6@mail.gmail.com> <20080704064047.GB7073@morn.localdomain> Message-ID: <005701c8de0e$aa495460$0023040a@chimp> > -----Original Message----- > From: Kevin O'Connor [mailto:kevin at koconnor.net] > Sent: Friday, July 04, 2008 12:41 AM > To: Myles Watson > Cc: Coreboot > Subject: Re: [coreboot] SeaBIOS booting > > On Thu, Jul 03, 2008 at 04:27:51PM -0600, Myles Watson wrote: > > Kevin, > > > > I didn't have my windows CD handy, so I tried several Linux install > > CDs, but I can't get them to boot on my s2892. They boot fine in qemu > > with SeaBIOS. > > Okay - thanks for trying. > > > Here's the log: > > I don't see anything unusual in the log. Did all the OSes die in the > same way? Did anything come up on the vga screen? What OSes did you > try? I tried the Ultimate Boot CD, a Fedora CD, and a CD I'd made that just runs grub. > > On Thu, Jul 03, 2008 at 03:54:11PM -0600, Myles Watson wrote: > > I'm not sure if it's buildrom's fault or SeaBIOS's, but the build > > fails for me with this error: > > > > make[1]: P: Command not found > > > > It's actually a symptom that $(CPP) isn't being set. When I add these > > lines in SeaBIOS's Makefile, it goes away. > > > > ifeq ($(CPP),) > > CPP=$(CC) -E > > endif > > That's very odd. What distro did you try to build on? Fedora 7. It might be buildrom's problem, since CPP is defined when I checked in the main Makefile. I'll have to look around for why it's getting undefined. Thanks, Myles > -Kevin From c-d.hailfinger.devel.2006 at gmx.net Sat Jul 5 02:59:00 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Sat, 05 Jul 2008 02:59:00 +0200 Subject: [coreboot] Remaining LNXI stuff Message-ID: <486EC754.3000608@gmx.net> Hi, I found a pointer to this site, possibly related to flashrom http://support.lnxi.com/~syssoftware/dell/bios/ Regards, Carl-Daniel From c-d.hailfinger.devel.2006 at gmx.net Sat Jul 5 03:17:22 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Sat, 05 Jul 2008 03:17:22 +0200 Subject: [coreboot] Top 256 bytes in ROM for Nvidia Message-ID: <486ECBA2.3090107@gmx.net> Hi Yinghai, is there any public information about the usage of the top 256 bytes in ROM for Nvidia chipsets? The only information I found was http://coreboot.org/pipermail/coreboot/2005-November/012918.html but that does not explain the reasons or give me a memory map. I'm looking at this diff and wonder if 0x80 is the only possible location for ID information in the ROM. --- ./src/arch/i386/lib/id.lds 2007-12-30 01:04:02.000000000 +0100 +++ ./src/southbridge/nvidia/ck804/id.lds 2007-12-30 01:04:06.000000000 +0100 @@ -1,5 +1,5 @@ SECTIONS { - . = (_ROMBASE + ROM_IMAGE_SIZE - 0x10) - (__id_end - __id_start); + . = (_ROMBASE + ROM_IMAGE_SIZE - 0x80) - (__id_end - __id_start); .id (.): { *(.id) } Regards, Carl-Daniel From svn at coreboot.org Sat Jul 5 06:12:37 2008 From: svn at coreboot.org (svn at coreboot.org) Date: Sat, 5 Jul 2008 06:12:37 +0200 Subject: [coreboot] r3413 - trunk/util/flashrom Message-ID: <mailman.1687.1355071340.16123.coreboot@coreboot.org> Author: stuge Date: 2008-07-05 06:12:37 +0200 (Sat, 05 Jul 2008) New Revision: 3413 Modified: trunk/util/flashrom/board_enable.c Log: flashrom: Add PCI IDs for EPIA-CN Uses the 0.0 Host bridge CN700/VN800/P4M800CE/Pro and 11.0 ISA bridge devices with their 1106:aa08 subsystem id:s for autodetection. Signed-off-by: Peter Stuge <peter at stuge.se> Acked-by: Peter Stuge <peter at stuge.se> Modified: trunk/util/flashrom/board_enable.c =================================================================== --- trunk/util/flashrom/board_enable.c 2008-07-03 19:26:44 UTC (rev 3412) +++ trunk/util/flashrom/board_enable.c 2008-07-05 04:12:37 UTC (rev 3413) @@ -595,6 +595,8 @@ NULL, NULL, "ASUS A7V8-MX SE", board_asus_a7v8x_mx}, {0x1106, 0x3227, 0x1106, 0xAA01, 0x1106, 0x0259, 0x1106, 0xAA01, NULL, NULL, "VIA EPIA SP", board_via_epia_sp}, + {0x1106, 0x0314, 0x1106, 0xaa08, 0x1106, 0x3227, 0x1106, 0xAA08, + NULL, NULL, "VIA EPIA-CN", board_via_epia_sp}, {0x8086, 0x1076, 0x8086, 0x1176, 0x1106, 0x3059, 0x10f1, 0x2498, NULL, NULL, "Tyan Tomcat K7M", board_asus_a7v8x_mx}, {0x10B9, 0x1541, 0x0000, 0x0000, 0x10B9, 0x1533, 0x0000, 0x0000, From svn at coreboot.org Sat Jul 5 09:42:47 2008 From: svn at coreboot.org (coreboot) Date: Sat, 05 Jul 2008 07:42:47 -0000 Subject: [coreboot] #103: flashrom: Don't exit() after successful erase (was: flashrom: Don't exit() after successful erase operation) In-Reply-To: <041.d6f003223df3afe9c38d44f78d70243d@coreboot.org> References: <041.d6f003223df3afe9c38d44f78d70243d@coreboot.org> Message-ID: <050.d1aa8df3f101bcdf0b545d253c3b9964@coreboot.org> #103: flashrom: Don't exit() after successful erase -------------------------+-------------------------------------------------- Reporter: stuge | Owner: stuge Type: defect | Status: assigned Priority: major | Milestone: flashrom v1.0 Component: flashrom | Version: Resolution: | Keywords: erase exit Dependencies: | Patchstatus: patch needs review -------------------------+-------------------------------------------------- Changes (by stuge): * patchstatus: there is no patch => patch needs review -- Ticket URL: <http://tracker.linuxbios.org/trac/coreboot/ticket/103#comment:3> coreboot <http://www.coreboot.org/> From TigerLiu at viatech.com.cn Sat Jul 5 10:51:32 2008 From: TigerLiu at viatech.com.cn (TigerLiu at viatech.com.cn) Date: Sat, 5 Jul 2008 16:51:32 +0800 Subject: [coreboot] which spi chip support interrupt transfer? Message-ID: <BBAB206624C8D24E900C73AFAFC031AF03DAFEE5@exchbj03.viatech.com.bj> Hello: Which type of spi chip support interrupt transfer? I have a SST25VF080B, but it does not support interrupt transfter. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20080705/ae39b095/attachment.html> From svn at coreboot.org Sat Jul 5 11:48:30 2008 From: svn at coreboot.org (svn at coreboot.org) Date: Sat, 5 Jul 2008 11:48:30 +0200 Subject: [coreboot] r3414 - trunk/util/flashrom Message-ID: <mailman.1688.1355071341.16123.coreboot@coreboot.org> Author: stepan Date: 2008-07-05 11:48:30 +0200 (Sat, 05 Jul 2008) New Revision: 3414 Modified: trunk/util/flashrom/chipset_enable.c Log: Adding support for flashing system with Nvidia MCP67 Signed-off-by: Stefan Reinauer <stepan at coresystems.de> Acked-by: Stefan Reinauer <stepan at coresystems.de> Modified: trunk/util/flashrom/chipset_enable.c =================================================================== --- trunk/util/flashrom/chipset_enable.c 2008-07-05 04:12:37 UTC (rev 3413) +++ trunk/util/flashrom/chipset_enable.c 2008-07-05 09:48:30 UTC (rev 3414) @@ -750,6 +750,7 @@ {0x10de, 0x0365, "NVIDIA MCP55", enable_flash_mcp55}, /* LPC */ {0x10de, 0x0366, "NVIDIA MCP55", enable_flash_mcp55}, /* LPC */ {0x10de, 0x0367, "NVIDIA MCP55", enable_flash_mcp55}, /* Pro */ + {0x10de, 0x0548, "NVIDIA MCP67", enable_flash_mcp55}, {0x1002, 0x4377, "ATI SB400", enable_flash_sb400}, {0x1166, 0x0205, "Broadcom HT-1000", enable_flash_ht1000}, }; From stepan at coresystems.de Sat Jul 5 12:00:18 2008 From: stepan at coresystems.de (Stefan Reinauer) Date: Sat, 05 Jul 2008 12:00:18 +0200 Subject: [coreboot] Remaining LNXI stuff In-Reply-To: <486EC754.3000608@gmx.net> References: <486EC754.3000608@gmx.net> Message-ID: <486F4632.4000505@coresystems.de> Carl-Daniel Hailfinger wrote: > Hi, > > I found a pointer to this site, possibly related to flashrom > http://support.lnxi.com/~syssoftware/dell/bios/ > Have you looked at that stuff? http://linux.dell.com/wiki/index.php/Oss/Firmware_Tools http://linux.dell.com/wiki/index.php/Repository/firmware -- coresystems GmbH ? Brahmsstr. 16 ? D-79104 Freiburg i. Br. Tel.: +49 761 7668825 ? Fax: +49 761 7664613 Email: info at coresystems.de ? http://www.coresystems.de/ Registergericht: Amtsgericht Freiburg ? HRB 7656 Gesch?ftsf?hrer: Stefan Reinauer ? Ust-IdNr.: DE245674866 From c-d.hailfinger.devel.2006 at gmx.net Sat Jul 5 12:05:44 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Sat, 05 Jul 2008 12:05:44 +0200 Subject: [coreboot] Remaining LNXI stuff In-Reply-To: <486F4632.4000505@coresystems.de> References: <486EC754.3000608@gmx.net> <486F4632.4000505@coresystems.de> Message-ID: <486F4778.5020508@gmx.net> On 05.07.2008 12:00, Stefan Reinauer wrote: > Carl-Daniel Hailfinger wrote: > >> Hi, >> >> I found a pointer to this site, possibly related to flashrom >> http://support.lnxi.com/~syssoftware/dell/bios/ >> >> > Have you looked at that stuff? > > http://linux.dell.com/wiki/index.php/Oss/Firmware_Tools > http://linux.dell.com/wiki/index.php/Repository/firmware > The LNXI user group said the BIOSes on the LNXI site were special. I have looked at Dell firmware flashing stuff in the past and it's unusable for our purposes. There might be some stuff I didn't notice, though. Regards, Carl-Daniel -- http://www.hailfinger.org/ From svn at coreboot.org Sat Jul 5 12:11:49 2008 From: svn at coreboot.org (coreboot) Date: Sat, 05 Jul 2008 10:11:49 -0000 Subject: [coreboot] #103: flashrom: Don't exit() after successful erase In-Reply-To: <041.d6f003223df3afe9c38d44f78d70243d@coreboot.org> References: <041.d6f003223df3afe9c38d44f78d70243d@coreboot.org> Message-ID: <050.9a6db49142f796a266973d297bf10d58@coreboot.org> #103: flashrom: Don't exit() after successful erase -------------------------+-------------------------------------------------- Reporter: stuge | Owner: stuge Type: defect | Status: assigned Priority: major | Milestone: flashrom v1.0 Component: flashrom | Version: Resolution: | Keywords: erase exit Dependencies: | Patchstatus: patch needs review -------------------------+-------------------------------------------------- Comment(by hailfinger): While I do like the patch, I fear the user interface of flashrom is less than optimal in this case. AFAICS flashrom -Er and flashrom -rE are equivalent, but user expectation is completely different. Can we honor the order of commands or at least place reading before erasing and writing? The best solution would be making -r and -E mutually exclusive like -r -and -w are. -- Ticket URL: <http://tracker.coreboot.org/trac/coreboot/ticket/103#comment:4> coreboot <http://www.coreboot.org/> From svn at coreboot.org Sat Jul 5 12:14:14 2008 From: svn at coreboot.org (coreboot) Date: Sat, 05 Jul 2008 10:14:14 -0000 Subject: [coreboot] #106: flashrom: Add -T to automatically test all flash chip operations In-Reply-To: <041.16204f2bdbfde4e3eac5ffa09962d8e9@coreboot.org> References: <041.16204f2bdbfde4e3eac5ffa09962d8e9@coreboot.org> Message-ID: <050.f4d7dc46e3d01237a82e3204a96d5981@coreboot.org> #106: flashrom: Add -T to automatically test all flash chip operations ----------------------------+----------------------------------------------- Reporter: stuge | Owner: somebody Type: enhancement | Status: new Priority: major | Milestone: flashrom v1.0 Component: flashrom | Version: Resolution: | Keywords: testing Dependencies: | Patchstatus: there is no patch ----------------------------+----------------------------------------------- Comment(by hailfinger): For -T to work, you have to remove the mutual exclusion between -r and -w in a meaningful way. This may require a rewrite of the main loop. -- Ticket URL: <http://tracker.coreboot.org/trac/coreboot/ticket/106#comment:2> coreboot <http://www.coreboot.org/> From c-d.hailfinger.devel.2006 at gmx.net Sat Jul 5 12:59:41 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Sat, 05 Jul 2008 12:59:41 +0200 Subject: [coreboot] [RFC] v3 DTS and Kconfig Message-ID: <486F541D.6070507@gmx.net> Hi, v3 currently has hardware information scattered between DTS and Kconfig. I'd like to use the DTC in v3 to create a #define for every component type in the tree. That way, all hardware description could be removed from Kconfig files. Besides the obvious stuff (no CPU specified in the DTS, etc.) this looks doable. The question is, however, for which property/key type we want to emit a #define. The following device tree /{ mainboard-vendor = "PC Engines"; mainboard-name = "ALIX1.C"; cpus { }; apic at 0 { /config/("northbridge/amd/geodelx/apic"); }; domain at 0 { /config/("northbridge/amd/geodelx/domain"); /* Video RAM has to be in 2MB chunks. */ geode_video_mb = "8"; pci at 1,0 { /config/("northbridge/amd/geodelx/pci"); }; pci at 15,0 { /config/("southbridge/amd/cs5536/dts"); /* Interrupt enables for LPC bus. * Each bit is an IRQ 0-15. */ lpc_serirq_enable = "0x0000105A"; /* LPC IRQ polarity. Each bit is an IRQ 0-15. */ lpc_serirq_polarity = "0x0000EFA5"; /* 0:continuous 1:quiet */ lpc_serirq_mode = "1"; /* GPIO(0-0x20) for INT D:C:B:A, 0xFF=none. * See virtual PIC spec. */ enable_gpio_int_route = "0x0D0C0700"; }; pci at 15,2 { /config/("southbridge/amd/cs5536/ide"); enable_ide = "1"; }; ioport at 46 { /config/("superio/winbond/w83627hf/dts"); com1enable = "1"; }; }; }; would lead to the following #defines emitted from a special DTC mode: #define CONFIG_NORTHBRIDGE_AMD_GEODELX_APIC #define CONFIG_NORTHBRIDGE_AMD_GEODELX_DOMAIN #define CONFIG_NORTHBRIDGE_AMD_GEODELX_PCI #define CONFIG_SOUTHBRIDGE_AMD_CS5536_DTS #define CONFIG_SOUTHBRIDGE_AMD_CS5536_IDE #define CONFIG_SUPERIO_WINBOND_W83627HF_DTS Comments? Thoughts? Regards, Carl-Daniel -- http://www.hailfinger.org/ From stepan at coresystems.de Sat Jul 5 13:48:43 2008 From: stepan at coresystems.de (Stefan Reinauer) Date: Sat, 05 Jul 2008 13:48:43 +0200 Subject: [coreboot] Remaining LNXI stuff In-Reply-To: <486F4778.5020508@gmx.net> References: <486EC754.3000608@gmx.net> <486F4632.4000505@coresystems.de> <486F4778.5020508@gmx.net> Message-ID: <486F5F9B.2020102@coresystems.de> Carl-Daniel Hailfinger wrote: > On 05.07.2008 12:00, Stefan Reinauer wrote: > >> Carl-Daniel Hailfinger wrote: >> >> >>> Hi, >>> >>> I found a pointer to this site, possibly related to flashrom >>> http://support.lnxi.com/~syssoftware/dell/bios/ >>> >>> >>> >> Have you looked at that stuff? >> >> http://linux.dell.com/wiki/index.php/Oss/Firmware_Tools >> http://linux.dell.com/wiki/index.php/Repository/firmware >> >> > > The LNXI user group said the BIOSes on the LNXI site were special. > I have looked at Dell firmware flashing stuff in the past and it's > unusable for our purposes. There might be some stuff I didn't notice, > though. Sure, but where did you see the connection to flashrom? -- coresystems GmbH ? Brahmsstr. 16 ? D-79104 Freiburg i. Br. Tel.: +49 761 7668825 ? Fax: +49 761 7664613 Email: info at coresystems.de ? http://www.coresystems.de/ Registergericht: Amtsgericht Freiburg ? HRB 7656 Gesch?ftsf?hrer: Stefan Reinauer ? Ust-IdNr.: DE245674866 From c-d.hailfinger.devel.2006 at gmx.net Sat Jul 5 15:35:54 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Sat, 05 Jul 2008 15:35:54 +0200 Subject: [coreboot] Remaining LNXI stuff In-Reply-To: <486F5F9B.2020102@coresystems.de> References: <486EC754.3000608@gmx.net> <486F4632.4000505@coresystems.de> <486F4778.5020508@gmx.net> <486F5F9B.2020102@coresystems.de> Message-ID: <486F78BA.9080605@gmx.net> On 05.07.2008 13:48, Stefan Reinauer wrote: > Carl-Daniel Hailfinger wrote: > >> On 05.07.2008 12:00, Stefan Reinauer wrote: >> >> >>> Carl-Daniel Hailfinger wrote: >>> >>> >>> >>>> I found a pointer to this site, possibly related to flashrom >>>> http://support.lnxi.com/~syssoftware/dell/bios/ >>>> >>>> >>> Have you looked at that stuff? >>> >>> http://linux.dell.com/wiki/index.php/Oss/Firmware_Tools >>> http://linux.dell.com/wiki/index.php/Repository/firmware >>> >>> >> The LNXI user group said the BIOSes on the LNXI site were special. >> I have looked at Dell firmware flashing stuff in the past and it's >> unusable for our purposes. There might be some stuff I didn't notice, >> though. >> > > Sure, but where did you see the connection to flashrom? > It was late and I interpreted a few sentences in a newsgroup to mean something they didn't. Sorry for the false alarm. Regards, Carl-Daniel From c-d.hailfinger.devel.2006 at gmx.net Sat Jul 5 16:35:29 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Sat, 05 Jul 2008 16:35:29 +0200 Subject: [coreboot] [PATCH] v3: Move default mainboard vendor/subsystem from Kconfig to dts In-Reply-To: <47D091F7.9060109@gmx.net> References: <13426df10802281040n4afcdce1p1af052b71ce556f1@mail.gmail.com> <13426df10803050753h52f8030fjfeee5b678ff8b4e6@mail.gmail.com> <47CEC43F.8010307@gmx.net> <13426df10803050810u62fb6b68o3a3d7dc672bdfbe6@mail.gmail.com> <47CECB60.9060401@gmx.net> <47CF28F1.3060605@gmx.net> <13426df10803051527v56be68e2tabfb37141a026ab4@mail.gmail.com> <47CF38D5.3040608@gmx.net> <13426df10803051700j590288b4s12c0796d033eae2e@mail.gmail.com> <47D08726.7010009@gmx.net> <13426df10803061632j4878fe2dlebe335f3822957ab@mail.gmail.com> <47D091F7.9060109@gmx.net> Message-ID: <486F86B1.1080805@gmx.net> On 07.03.2008 01:53, Carl-Daniel Hailfinger wrote: > On 07.03.2008 01:32, ron minnich wrote: > >> On Thu, Mar 6, 2008 at 4:07 PM, Carl-Daniel Hailfinger >> <c-d.hailfinger.devel.2006 at gmx.net> wrote: >> >> >>> It fits the scheme at first glance, but the sub{vendor,device} stuff is >>> pci specific and having it in a place where the identifier/address would >>> normally be makes me uncomfortable. >>> >>> >> I think I agree. I'll test your patch on its own, before I test the other one. >> >> > > If possible, I'd like to delay committing the patch a bit until I'm sure > about the final design. > Testing would be great, though. > Redesigned, more efficient and more readable patch follows. Move default mainboard vendor/subsystem from Kconfig to dts. Compile tested including boundary cases. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net> Index: LinuxBIOSv3-mainboard_subsystem/mainboard/adl/msm800sev/Kconfig =================================================================== --- LinuxBIOSv3-mainboard_subsystem/mainboard/adl/msm800sev/Kconfig (Revision 692) +++ LinuxBIOSv3-mainboard_subsystem/mainboard/adl/msm800sev/Kconfig (Arbeitskopie) @@ -26,19 +26,3 @@ help This is the name for the Advanced Digital Logic MSM800SEV mainboard. -config MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID - hex - # TODO: Fix the PCI ID. - default 0x1022 - depends BOARD_ADL_MSM800SEV - help - Mainboard specific PCI subsystem vendor ID. - -config MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID - hex - # TODO: Fix the PCI ID. - default 0x2323 - depends BOARD_ADL_MSM800SEV - help - Mainboard specific PCI subsystem vendor ID. - Index: LinuxBIOSv3-mainboard_subsystem/mainboard/adl/msm800sev/dts =================================================================== --- LinuxBIOSv3-mainboard_subsystem/mainboard/adl/msm800sev/dts (Revision 692) +++ LinuxBIOSv3-mainboard_subsystem/mainboard/adl/msm800sev/dts (Arbeitskopie) @@ -23,6 +23,8 @@ /{ mainboard-vendor = "Advanced Digital Logic"; mainboard-name = "MSM800SEV"; + mainboard_pci_subsystem_vendor = "0x1022"; + mainboard_pci_subsystem_device = "0x2323"; cpus { }; apic at 0 { /config/("northbridge/amd/geodelx/apic"); Index: LinuxBIOSv3-mainboard_subsystem/mainboard/amd/norwich/Kconfig =================================================================== --- LinuxBIOSv3-mainboard_subsystem/mainboard/amd/norwich/Kconfig (Revision 692) +++ LinuxBIOSv3-mainboard_subsystem/mainboard/amd/norwich/Kconfig (Arbeitskopie) @@ -26,19 +26,3 @@ help This is the default mainboard name. -config MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID - hex - # TODO: Fix PCI ID. - default 0x1022 - depends BOARD_AMD_NORWICH - help - Mainboard specific PCI subsystem vendor ID. - -config MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID - hex - # TODO: Fix PCI ID. - default 0x2323 - depends BOARD_AMD_NORWICH - help - Mainboard specific PCI subsystem device ID. - Index: LinuxBIOSv3-mainboard_subsystem/mainboard/amd/norwich/dts =================================================================== --- LinuxBIOSv3-mainboard_subsystem/mainboard/amd/norwich/dts (Revision 692) +++ LinuxBIOSv3-mainboard_subsystem/mainboard/amd/norwich/dts (Arbeitskopie) @@ -21,6 +21,8 @@ /{ mainboard-vendor = "AMD"; mainboard-name = "NORWICH"; + mainboard_pci_subsystem_vendor = "0x1022"; + mainboard_pci_subsystem_device = "0x2323"; cpus { }; apic at 0 { /config/("northbridge/amd/geodelx/apic"); Index: LinuxBIOSv3-mainboard_subsystem/mainboard/artecgroup/dbe61/Kconfig =================================================================== --- LinuxBIOSv3-mainboard_subsystem/mainboard/artecgroup/dbe61/Kconfig (Revision 692) +++ LinuxBIOSv3-mainboard_subsystem/mainboard/artecgroup/dbe61/Kconfig (Arbeitskopie) @@ -26,19 +26,3 @@ help This is the default mainboard name. -config MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID - hex - # TODO: Fix PCI ID. - default 0x1022 - depends BOARD_ARTECGROUP_DBE61 - help - Mainboard specific PCI subsystem vendor ID. - -config MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID - hex - # TODO: Fix PCI ID. - default 0x2323 - depends BOARD_ARTECGROUP_DBE61 - help - Mainboard specific PCI subsystem device ID. - Index: LinuxBIOSv3-mainboard_subsystem/mainboard/artecgroup/dbe61/dts =================================================================== --- LinuxBIOSv3-mainboard_subsystem/mainboard/artecgroup/dbe61/dts (Revision 692) +++ LinuxBIOSv3-mainboard_subsystem/mainboard/artecgroup/dbe61/dts (Arbeitskopie) @@ -75,6 +75,8 @@ /{ mainboard-vendor = "Artec Group"; mainboard-name = "DBE61"; + mainboard_pci_subsystem_vendor = "0x1022"; + mainboard_pci_subsystem_device = "0x2323"; cpus { }; apic at 0 { /config/("northbridge/amd/geodelx/apic"); Index: LinuxBIOSv3-mainboard_subsystem/mainboard/emulation/qemu-x86/Kconfig =================================================================== --- LinuxBIOSv3-mainboard_subsystem/mainboard/emulation/qemu-x86/Kconfig (Revision 692) +++ LinuxBIOSv3-mainboard_subsystem/mainboard/emulation/qemu-x86/Kconfig (Arbeitskopie) @@ -27,17 +27,3 @@ help This is the default mainboard name. -config MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID - hex - default 0x15ad - depends BOARD_EMULATION_QEMU_X86 - help - Mainboard specific PCI subsystem vendor ID. - -config MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID - hex - default 0x1976 - depends BOARD_EMULATION_QEMU_X86 - help - Mainboard specific PCI subsystem device ID. - Index: LinuxBIOSv3-mainboard_subsystem/mainboard/emulation/qemu-x86/dts =================================================================== --- LinuxBIOSv3-mainboard_subsystem/mainboard/emulation/qemu-x86/dts (Revision 692) +++ LinuxBIOSv3-mainboard_subsystem/mainboard/emulation/qemu-x86/dts (Arbeitskopie) @@ -21,6 +21,8 @@ /{ mainboard-vendor = "Emulation"; mainboard-name = "QEMU x86"; + mainboard_pci_subsystem_vendor = "0x15ad"; + mainboard_pci_subsystem_device = "0x1976"; device_operations = "qemuvga_pci_ops_dev"; cpus {}; domain at 0 { Index: LinuxBIOSv3-mainboard_subsystem/device/pci_device.c =================================================================== --- LinuxBIOSv3-mainboard_subsystem/device/pci_device.c (Revision 692) +++ LinuxBIOSv3-mainboard_subsystem/device/pci_device.c (Arbeitskopie) @@ -50,6 +50,7 @@ #if CONFIG_CARDBUS_PLUGIN_SUPPORT == 1 #include <device/cardbus.h> #endif +#include <statictree.h> u8 pci_moving_config8(struct device *dev, unsigned int reg) { @@ -627,19 +628,18 @@ /* Set the subsystem vendor and device ID for mainboard devices. */ ops = ops_pci(dev); -#if defined(CONFIG_MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID) && \ - defined(CONFIG_MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID) +#ifdef HAVE_MAINBOARD_PCI_SUBSYSTEM_ID if (dev->on_mainboard && ops && ops->set_subsystem) { printk(BIOS_DEBUG, "%s: Setting subsystem VID/DID to %02x/%02x\n", - dev_path(dev), CONFIG_MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID, - CONFIG_MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID); + dev_path(dev), mainboard_pci_subsystem_vendor, + mainboard_pci_subsystem_device); - ops->set_subsystem(dev, - CONFIG_MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID, - CONFIG_MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID); + ops->set_subsystem(dev, mainboard_pci_subsystem_vendor, + mainboard_pci_subsystem_device); } #endif + command = pci_read_config16(dev, PCI_COMMAND); command |= dev->command; command |= (PCI_COMMAND_PARITY + PCI_COMMAND_SERR); // Error check. Index: LinuxBIOSv3-mainboard_subsystem/util/dtc/flattree.c =================================================================== --- LinuxBIOSv3-mainboard_subsystem/util/dtc/flattree.c (Revision 692) +++ LinuxBIOSv3-mainboard_subsystem/util/dtc/flattree.c (Arbeitskopie) @@ -1328,7 +1328,7 @@ extern char *code; struct node *next; extern struct node *first_node; - int found_mainboard_vendor = 0, found_mainboard_partnumber = 0; + int found_mainboard_vendor = 0, found_mainboard_partnumber = 0, found_mainboard_subsys = 0; labeltree(bi->dt); @@ -1361,6 +1361,14 @@ found_mainboard_partnumber = 1; fprintf(f, "const char *mainboard_part_number = \"%s\";\n", prop->val.val); } + if (streq(prop->name, "mainboard_pci_subsystem_vendor")){ + found_mainboard_subsys++; + fprintf(f, "const u16 mainboard_pci_subsystem_vendor = %s;\n", prop->val.val); + } + if (streq(prop->name, "mainboard_pci_subsystem_device")){ + found_mainboard_subsys++; + fprintf(f, "const u16 mainboard_pci_subsystem_device = %s;\n", prop->val.val); + } } if (! found_mainboard_vendor){ @@ -1374,6 +1382,17 @@ "(and make sure there is a mainboard-vendor property too"); } + switch (found_mainboard_subsys) { + case 0: + break; + case 1: + die("There is only one of mainboard_pci_subsystem_vendor and " + "mainboard_pci_subsystem_device properties in the root. " + "Please add the other one or remove the existing one."); + break; + case 2: + break; + } /* emit the code, if any */ if (code) @@ -1395,6 +1414,8 @@ char *symprefix = "dt"; extern char *code; struct node *next; + struct property *prop; + int found_mainboard_subsys = 0; extern struct node *first_node; labeltree(bi->dt); @@ -1416,6 +1437,31 @@ /* emit any includes that we need -- TODO: ONLY ONCE PER TYPE*/ fprintf(f, "#include <device/device.h>\n#include <device/pci.h>\n"); fprintf(f, "extern const char *mainboard_vendor, *mainboard_part_number;\n"); + + for_each_property(bi->dt, prop) { + if (streq(prop->name, "mainboard_pci_subsystem_vendor")){ + found_mainboard_subsys++; + } + if (streq(prop->name, "mainboard_pci_subsystem_device")){ + found_mainboard_subsys++; + } + } + + switch (found_mainboard_subsys) { + case 0: + break; + case 1: + die("There is only one of mainboard_pci_subsystem_vendor and " + "mainboard_pci_subsystem_device properties in the root. " + "Please add the other one or remove the existing one."); + break; + case 2: + fprintf(f, "#define HAVE_MAINBOARD_PCI_SUBSYSTEM_ID\n"); + fprintf(f, "extern const u16 mainboard_pci_subsystem_vendor;\n"); + fprintf(f, "extern const u16 mainboard_pci_subsystem_device;\n"); + break; + } + flatten_tree_emit_includes(bi->dt, &coreboot_emitter, f, &strbuf, vi); flatten_tree_emit_structdecls(bi->dt, &coreboot_emitter, f, &strbuf, vi); -- http://www.hailfinger.org/ From c-d.hailfinger.devel.2006 at gmx.net Sat Jul 5 17:18:29 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Sat, 05 Jul 2008 17:18:29 +0200 Subject: [coreboot] [PATCH] flashrom: Recognize the MSI K8N Neo3 Message-ID: <486F90C5.2080809@gmx.net> Recognize the MSI K8N Neo3 coreboot ID string in flashrom. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net> Index: flashrom-tmp1/board_enable.c =================================================================== --- flashrom-tmp1/board_enable.c (Revision 3412) +++ flashrom-tmp1/board_enable.c (Arbeitskopie) @@ -586,7 +586,7 @@ {0x1022, 0x7468, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, "iwill", "dk8_htx", "IWILL DK8-HTX", w83627hf_gpio24_raise_2e}, {0x10de, 0x005e, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - "msi", "k8n-neo3", "MSI K8N Neo3", w83627thf_gpio4_4_raise_4e}, + "MSI", "K8N Neo3 (MS-7135)", "MSI K8N Neo3", w83627thf_gpio4_4_raise_4e}, {0x1022, 0x746B, 0x1022, 0x36C0, 0x0000, 0x0000, 0x0000, 0x0000, "AGAMI", "ARUMA", "agami Aruma", w83627hf_gpio24_raise_2e}, {0x1106, 0x3177, 0x1106, 0xAA01, 0x1106, 0x3123, 0x1106, 0xAA01, -- http://www.hailfinger.org/ From svn at coreboot.org Sat Jul 5 19:25:08 2008 From: svn at coreboot.org (coreboot) Date: Sat, 05 Jul 2008 17:25:08 -0000 Subject: [coreboot] #109: flash base autodetection on AMD SC520 Message-ID: <042.dd2a4ac52c99eda42cddbbfeec557d3f@coreboot.org> #109: flash base autodetection on AMD SC520 ----------------------------------+----------------------------------------- Reporter: stepan | Owner: stepan Type: defect | Status: new Priority: major | Milestone: Component: adlo | Version: v2 Keywords: | Dependencies: Patchstatus: patch needs review | ----------------------------------+----------------------------------------- this code has been sitting on my hard disk for a while. It drops the nasty ifdefs and implements auto detection for AMD SC520 systems, such as the Technologic Systems TS5300. -- Ticket URL: <http://tracker.coreboot.org/trac/coreboot/ticket/109> coreboot <http://www.coreboot.org/> From svn at coreboot.org Sat Jul 5 19:28:31 2008 From: svn at coreboot.org (coreboot) Date: Sat, 05 Jul 2008 17:28:31 -0000 Subject: [coreboot] #109: flash base autodetection on AMD SC520 In-Reply-To: <042.dd2a4ac52c99eda42cddbbfeec557d3f@coreboot.org> References: <042.dd2a4ac52c99eda42cddbbfeec557d3f@coreboot.org> Message-ID: <051.a85c84a898811f874847e246523beea0@coreboot.org> #109: flash base autodetection on AMD SC520 -------------------------+-------------------------------------------------- Reporter: stepan | Owner: stepan Type: defect | Status: new Priority: major | Milestone: flashrom v1.0 Component: flashrom | Version: Resolution: | Keywords: Dependencies: | Patchstatus: patch needs review -------------------------+-------------------------------------------------- Changes (by stepan): * version: v2 => * component: adlo => flashrom * milestone: => flashrom v1.0 -- Ticket URL: <http://tracker.coreboot.org/trac/coreboot/ticket/109#comment:1> coreboot <http://www.coreboot.org/> From svn at coreboot.org Sat Jul 5 19:29:14 2008 From: svn at coreboot.org (coreboot) Date: Sat, 05 Jul 2008 17:29:14 -0000 Subject: [coreboot] #101: flashrom: Remove pciutils check from Makefile In-Reply-To: <041.17fb32e3a5c300f5053da0fa3e652820@coreboot.org> References: <041.17fb32e3a5c300f5053da0fa3e652820@coreboot.org> Message-ID: <050.987c87d1065d012030196685b3e023e0@coreboot.org> #101: flashrom: Remove pciutils check from Makefile -------------------------+-------------------------------------------------- Reporter: stuge | Owner: stuge Type: defect | Status: new Priority: trivial | Milestone: flashrom 1.1 Component: flashrom | Version: Resolution: | Keywords: pciutils libpci build ldflags Dependencies: | Patchstatus: patch needs work -------------------------+-------------------------------------------------- Changes (by stepan): * milestone: flashrom v1.0 => flashrom 1.1 Comment: Moving this to 1.1 -- Ticket URL: <http://tracker.coreboot.org/trac/coreboot/ticket/101#comment:3> coreboot <http://www.coreboot.org/> From svn at coreboot.org Sat Jul 5 19:30:33 2008 From: svn at coreboot.org (coreboot) Date: Sat, 05 Jul 2008 17:30:33 -0000 Subject: [coreboot] #105: flashrom: add documentation files (ChangeLog etc) that need to be in the release In-Reply-To: <041.43c89429f4bc2b157cdb53f0a41b38c3@coreboot.org> References: <041.43c89429f4bc2b157cdb53f0a41b38c3@coreboot.org> Message-ID: <050.6de9f5042136015f6f0fb5e2b840a67b@coreboot.org> #105: flashrom: add documentation files (ChangeLog etc) that need to be in the release ----------------------------+----------------------------------------------- Reporter: stuge | Owner: somebody Type: enhancement | Status: new Priority: blocker | Milestone: flashrom v1.0 Component: flashrom | Version: Resolution: | Keywords: documentation Dependencies: | Patchstatus: there is no patch ----------------------------+----------------------------------------------- Comment(by stepan): Is this only about changelog, or anything else? (topic says "ChangeLog etc") -- Ticket URL: <http://tracker.coreboot.org/trac/coreboot/ticket/105#comment:3> coreboot <http://www.coreboot.org/> From svn at coreboot.org Sat Jul 5 19:31:00 2008 From: svn at coreboot.org (coreboot) Date: Sat, 05 Jul 2008 17:31:00 -0000 Subject: [coreboot] #106: flashrom: Add -T to automatically test all flash chip operations In-Reply-To: <041.16204f2bdbfde4e3eac5ffa09962d8e9@coreboot.org> References: <041.16204f2bdbfde4e3eac5ffa09962d8e9@coreboot.org> Message-ID: <050.64501b026a86423d2816cc85da73fa2a@coreboot.org> #106: flashrom: Add -T to automatically test all flash chip operations ----------------------------+----------------------------------------------- Reporter: stuge | Owner: somebody Type: enhancement | Status: new Priority: major | Milestone: flashrom 1.1 Component: flashrom | Version: Resolution: | Keywords: testing Dependencies: | Patchstatus: there is no patch ----------------------------+----------------------------------------------- Changes (by stepan): * milestone: flashrom v1.0 => flashrom 1.1 -- Ticket URL: <http://tracker.coreboot.org/trac/coreboot/ticket/106#comment:3> coreboot <http://www.coreboot.org/> From stepan at coresystems.de Sat Jul 5 19:36:12 2008 From: stepan at coresystems.de (Stefan Reinauer) Date: Sat, 05 Jul 2008 19:36:12 +0200 Subject: [coreboot] [PATCH] flashrom: Recognize the MSI K8N Neo3 In-Reply-To: <486F90C5.2080809@gmx.net> References: <486F90C5.2080809@gmx.net> Message-ID: <486FB10C.8080303@coresystems.de> Carl-Daniel Hailfinger wrote: > Recognize the MSI K8N Neo3 coreboot ID string in flashrom. > > Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net> > > Index: flashrom-tmp1/board_enable.c > =================================================================== > --- flashrom-tmp1/board_enable.c (Revision 3412) > +++ flashrom-tmp1/board_enable.c (Arbeitskopie) > @@ -586,7 +586,7 @@ > {0x1022, 0x7468, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, > "iwill", "dk8_htx", "IWILL DK8-HTX", w83627hf_gpio24_raise_2e}, > {0x10de, 0x005e, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, > - "msi", "k8n-neo3", "MSI K8N Neo3", w83627thf_gpio4_4_raise_4e}, > + "MSI", "K8N Neo3 (MS-7135)", "MSI K8N Neo3", w83627thf_gpio4_4_raise_4e}, > {0x1022, 0x746B, 0x1022, 0x36C0, 0x0000, 0x0000, 0x0000, 0x0000, > "AGAMI", "ARUMA", "agami Aruma", w83627hf_gpio24_raise_2e}, > {0x1106, 0x3177, 0x1106, 0xAA01, 0x1106, 0x3123, 0x1106, 0xAA01, > I don't think these names should have spaces and brackets in them. I vote for fixing it in the Options.lb instead -- coresystems GmbH ? Brahmsstr. 16 ? D-79104 Freiburg i. Br. Tel.: +49 761 7668825 ? Fax: +49 761 7664613 Email: info at coresystems.de ? http://www.coresystems.de/ Registergericht: Amtsgericht Freiburg ? HRB 7656 Gesch?ftsf?hrer: Stefan Reinauer ? Ust-IdNr.: DE245674866 From svn at coreboot.org Sat Jul 5 19:45:04 2008 From: svn at coreboot.org (coreboot) Date: Sat, 05 Jul 2008 17:45:04 -0000 Subject: [coreboot] #104: flashrom: Change flash drivers to never erase data before writing In-Reply-To: <041.613243c7ca7145feb67f1cb5420bf35c@coreboot.org> References: <041.613243c7ca7145feb67f1cb5420bf35c@coreboot.org> Message-ID: <050.b570094d12b00abaae11a6a3d6ab3298@coreboot.org> #104: flashrom: Change flash drivers to never erase data before writing -------------------------+-------------------------------------------------- Reporter: stuge | Owner: somebody Type: defect | Status: new Priority: major | Milestone: flashrom v1.0 Component: flashrom | Version: Resolution: | Keywords: erase write Dependencies: #103 | Patchstatus: there is no patch -------------------------+-------------------------------------------------- Comment(by stepan): If this should become agreed upon, which I don't hope, I suggest that we at least check the area before writing, if the writing can theoretically succeed at all. ie. if all bytes are 0xff. And print a warning if they are not all ff. Plus print an error if those bits that we try to set to 1 are 0. -- Ticket URL: <http://tracker.coreboot.org/trac/coreboot/ticket/104#comment:4> coreboot <http://www.coreboot.org/> From rminnich at gmail.com Sat Jul 5 22:19:10 2008 From: rminnich at gmail.com (ron minnich) Date: Sat, 5 Jul 2008 13:19:10 -0700 Subject: [coreboot] [RFC] v3 DTS and Kconfig In-Reply-To: <486F541D.6070507@gmx.net> References: <486F541D.6070507@gmx.net> Message-ID: <13426df10807051319v5478e6c2k3d0f4a8301cc3e7d@mail.gmail.com> I like it. ron From c-d.hailfinger.devel.2006 at gmx.net Sun Jul 6 01:24:41 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Sun, 06 Jul 2008 01:24:41 +0200 Subject: [coreboot] [RFC] v3 DTS and Kconfig In-Reply-To: <13426df10807051319v5478e6c2k3d0f4a8301cc3e7d@mail.gmail.com> References: <486F541D.6070507@gmx.net> <13426df10807051319v5478e6c2k3d0f4a8301cc3e7d@mail.gmail.com> Message-ID: <487002B9.9060108@gmx.net> On 05.07.2008 22:19, ron minnich wrote: > I like it. > Great. Getting this coded up depends somewhat on a review/commit of [coreboot] [PATCH] v3: Move default mainboard vendor/subsystem from Kconfig to dts And, of course, we'll have to decide how fine the granularity should be. - One #define per included DTS? - One #define per component? Regards, Carl-Daniel -- http://www.hailfinger.org/ From yinghailu at gmail.com Sun Jul 6 07:20:50 2008 From: yinghailu at gmail.com (yhlu) Date: Sat, 5 Jul 2008 22:20:50 -0700 Subject: [coreboot] Top 256 bytes in ROM for Nvidia In-Reply-To: <486ECBA2.3090107@gmx.net> References: <486ECBA2.3090107@gmx.net> Message-ID: <2ea3fae10807052220t3d1fa5b5r71109d5d19d6c75f@mail.gmail.com> On Fri, Jul 4, 2008 at 6:17 PM, Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net> wrote: > Hi Yinghai, > > is there any public information about the usage of the top 256 bytes in > ROM for Nvidia chipsets? The only information I found was > http://coreboot.org/pipermail/coreboot/2005-November/012918.html but > that does not explain the reasons or give me a memory map. > I'm looking at this diff and wonder if 0x80 is the only possible > location for ID information in the ROM. > > --- ./src/arch/i386/lib/id.lds 2007-12-30 01:04:02.000000000 +0100 > +++ ./src/southbridge/nvidia/ck804/id.lds 2007-12-30 01:04:06.000000000 +0100 > @@ -1,5 +1,5 @@ > SECTIONS { > - . = (_ROMBASE + ROM_IMAGE_SIZE - 0x10) - (__id_end - __id_start); > + . = (_ROMBASE + ROM_IMAGE_SIZE - 0x80) - (__id_end - __id_start); > .id (.): { > *(.id) > } > just need to leave some space below -0x10 YH From zrfail at gmail.com Sun Jul 6 17:29:04 2008 From: zrfail at gmail.com (Zhang Rui) Date: Sun, 6 Jul 2008 23:29:04 +0800 Subject: [coreboot] Question about call LegacyBIOS in the memory(GSoC__SCSI boot) In-Reply-To: <20080625124450.GA23783@morn.localdomain> References: <92cbc4c70806242353i39cb2592x377e5c804f7c1ab3@mail.gmail.com> <20080625124450.GA23783@morn.localdomain> Message-ID: <92cbc4c70807060829x327e3878mee80ed077bde0706@mail.gmail.com> Hello Stefan, 2008/6/25, Zhang Rui <zrfail at gmail.com>: > 4. Where is the entrance call of util/x86emu in coreboot v3? > There are several x86EMU_XXX function exported in e86emu.h. But they > are called only in run_bios() in biosemu.c. I placed a printk at the > beginning of run_bios() but it seems not executed. How does the codes > in util/x86emu used? > Where is the entrance call of util/x86emu in coreboot v3? Where should > I place the code to extract LegacyBIOS to the memory? Should I write a > new function and export it? > > Stefan, could you help me with this question? Thanks. > I finally find that in arch/x86/, function pci_dev_init() called run_bios() in util/x86emu. The order is : pci_dev_init -->pci_rom_probe -->run_bios(vm86.c/biosemu.c) my problem is: in pci_rom_probe, most rom_address is 0 and return NULL; only one rom_address is 0x c0000 but the rom_header->signature is 0 so it also return NULL. So no run_bios is running. How can I get run_bios() running and test my code in it? Best regards. Zhang Rui Here is the output of qemu: coreboot-3.0. Thu Jun 19 10:21:30 CST 2008 starting... Choosing fallback boot. LAR: Attempting to open 'fallback/initram/segment0'. LAR: Start 0xfffc0000 len 0x40000 LAR: seen member normal/option_table LAR: seen member normal/initram/segment0 LAR: seen member normal/stage2/segment0 LAR: seen member normal/stage2/segment1 LAR: seen member normal/stage2/segment2 LAR: seen member bootblock LAR: File not found! LAR: Run file fallback/initram/segment0 failed: No such file. Fallback failed. Try normal boot LAR: Attempting to open 'normal/initram/segment0'. LAR: Start 0xfffc0000 len 0x40000 LAR: seen member normal/option_table LAR: seen member normal/initram/segment0 LAR: CHECK normal/initram/segment0 @ 0xfffc0400 start 0xfffc0450 len 432 reallen 432 compression 0 entry 0x00000042 loadaddress 0x00000000 Entry point is 0xfffc0492 RAM init code started. Nothing to do. printktest1: If the immediately preceding line does not say "Nothing to do.", then execution did not start at main() Trying absolute call from non-_MAINOBJECT XIP code. Absolute call successful. Done. run_file returns with 0 Done RAM init code LAR: Attempting to open 'normal/stage2/segment0'. LAR: Start 0xfffc0000 len 0x40000 LAR: seen member normal/option_table LAR: seen member normal/initram/segment0 LAR: seen member normal/stage2/segment0 LAR: CHECK normal/stage2/segment0 @ 0xfffc0600 start 0xfffc0650 len 1 reallen 192928 compression 3 entry 0x00002000 loadaddress 0x00013e20 LAR: Compression algorithm #3 (zeroes) used LAR: Attempting to open 'normal/stage2/segment1'. LAR: Start 0xfffc0000 len 0x40000 LAR: seen member normal/option_table LAR: seen member normal/initram/segment0 LAR: seen member normal/stage2/segment0 LAR: seen member normal/stage2/segment1 LAR: CHECK normal/stage2/segment1 @ 0xfffc0660 start 0xfffc06b0 len 27389 reallen 62884 compression 1 entry 0x00002000 loadaddress 0x00002000 LAR: Compression algorithm #1 (lzma) used LAR: Attempting to open 'normal/stage2/segment2'. LAR: Start 0xfffc0000 len 0x40000 LAR: seen member normal/option_table LAR: seen member normal/initram/segment0 LAR: seen member normal/stage2/segment0 LAR: seen member normal/stage2/segment1 LAR: seen member normal/stage2/segment2 LAR: CHECK normal/stage2/segment2 @ 0xfffc71b0 start 0xfffc7200 len 774 reallen 7696 compression 1 entry 0x00002000 loadaddress 0x00012000 LAR: Compression algorithm #1 (lzma) used LAR: Attempting to open 'normal/stage2/segment3'. LAR: Start 0xfffc0000 len 0x40000 LAR: seen member normal/option_table LAR: seen member normal/initram/segment0 LAR: seen member normal/stage2/segment0 LAR: seen member normal/stage2/segment1 LAR: seen member normal/stage2/segment2 LAR: seen member bootblock LAR: File not found! LAR: load_file: No such file 'normal/stage2/segment3' LAR: load_file_segments: All loaded, entry 0x00002000 Phase 1: Very early setup... Phase 1: done Show all devs... root(Root Device): enabled 1 have_resources 0 initialized 0 cpus: Unknown device path type: 0 cpus(): enabled 1 have_resources 0 initialized 0 pci_0_0(PCI: 00:00.0): enabled 1 have_resources 0 initialized 0 pci_1_0(PCI: 00:01.0): enabled 1 have_resources 0 initialized 0 bus_0(PCI_BUS: 0000): enabled 1 have_resources 0 initialized 0 domain_0(PCI_DOMAIN: 0000): enabled 1 have_resources 0 initialized 0 Phase 2: Early setup... dev_phase2: dev root: ops 0x00012020 ops->phase2_setup_scan_bus 0x00000000 dev_phase2: dev cpus: ops 0x00000000 ops->phase2_setup_scan_bus 0x00000000 dev_phase2: dev pci_0_0: ops 0x00000000 ops->phase2_setup_scan_bus 0x00000000 dev_phase2: dev pci_1_0: ops 0x00013500 ops->phase2_setup_scan_bus 0x00000000 dev_phase2: dev bus_0: ops 0x00000000 ops->phase2_setup_scan_bus 0x00000000 dev_phase2: dev domain_0: ops 0x00013440 ops->phase2_setup_scan_bus 0x00000000 Phase 2: Done. Show all devs... root(Root Device): enabled 1 have_resources 0 initialized 0 cpus: Unknown device path type: 0 cpus(): enabled 1 have_resources 0 initialized 0 pci_0_0(PCI: 00:00.0): enabled 1 have_resources 0 initialized 0 pci_1_0(PCI: 00:01.0): enabled 1 have_resources 0 initialized 0 bus_0(PCI_BUS: 0000): enabled 1 have_resources 0 initialized 0 domain_0(PCI_DOMAIN: 0000): enabled 1 have_resources 0 initialized 0 Phase 3: Enumerating buses... dev_phase3_scan: scanning root(Root Device) scan_static_bus for root (Root Device) cpus: Unknown device path type: 0 cpus() enabled dev_phase5: bus_0(PCI_BUS: 0000) missing ops domain_0(PCI_DOMAIN: 0000) enabled domain_0(PCI_DOMAIN: 0000) scanning... dev_phase3_scan: scanning domain_0(PCI_DOMAIN: 0000) pci_scan_bus start bus 0x00012a80, bus->dev 0x00012840 PCI: pci_scan_bus for bus 00 pci_scan_bus: old_devices 0x00012b40, dev for this bus 0x00012840 (domain_0) PCI: scan devfn 0x0 to 0xff PCI: devfn 0x0 pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) new_device: devcnt 1 find_device_operations: check all_device_operations[i] 0x000121c0 find_device_operations: cons 0x000121c0, cons id PCI: 1013:00b8 find_device_operations: check all_device_operations[i] 0x00013440 find_device_operations: cons 0x00013440, cons id PCI_DOMAIN: 8086:7190 find_device_operations: check all_device_operations[i] 0x00013500 find_device_operations: cons 0x00013500, cons id PCI: 8086:7010 constructor: constructor is 0x00000000 No ops found and no constructor called for PCI: 8086:1237. find_device_operations: check all_device_operations[i] 0x000121c0 find_device_operations: cons 0x000121c0, cons id PCI: 1013:00b8 find_device_operations: check all_device_operations[i] 0x00013440 find_device_operations: cons 0x00013440, cons id PCI_DOMAIN: 8086:7190 find_device_operations: check all_device_operations[i] 0x00013500 find_device_operations: cons 0x00013500, cons id PCI: 8086:7010 set_pci_ops: dev 0x0001414c(dynamic PCI: 00:00.0) set ops to 0x000120a0 PCI: 00:00.0 [PCI: 8086:1237] enabled PCI: pci_scan_bus pci_probe_dev returns dev 0x0001414c(dynamic PCI: 00:00.0) PCI: devfn 0x8 pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) new_device: devcnt 2 find_device_operations: check all_device_operations[i] 0x000121c0 find_device_operations: cons 0x000121c0, cons id PCI: 1013:00b8 find_device_operations: check all_device_operations[i] 0x00013440 find_device_operations: cons 0x00013440, cons id PCI_DOMAIN: 8086:7190 find_device_operations: check all_device_operations[i] 0x00013500 find_device_operations: cons 0x00013500, cons id PCI: 8086:7010 constructor: constructor is 0x00000000 No ops found and no constructor called for PCI: 8086:7000. find_device_operations: check all_device_operations[i] 0x000121c0 find_device_operations: cons 0x000121c0, cons id PCI: 1013:00b8 find_device_operations: check all_device_operations[i] 0x00013440 find_device_operations: cons 0x00013440, cons id PCI_DOMAIN: 8086:7190 find_device_operations: check all_device_operations[i] 0x00013500 find_device_operations: cons 0x00013500, cons id PCI: 8086:7010 set_pci_ops: dev 0x00014438(dynamic PCI: 00:01.0) set ops to 0x000120a0 PCI: 00:01.0 [PCI: 8086:7000] enabled PCI: pci_scan_bus pci_probe_dev returns dev 0x00014438(dynamic PCI: 00:01.0) PCI: devfn 0x9 pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) new_device: devcnt 3 find_device_operations: check all_device_operations[i] 0x000121c0 find_device_operations: cons 0x000121c0, cons id PCI: 1013:00b8 find_device_operations: check all_device_operations[i] 0x00013440 find_device_operations: cons 0x00013440, cons id PCI_DOMAIN: 8086:7190 find_device_operations: check all_device_operations[i] 0x00013500 find_device_operations: cons 0x00013500, cons id PCI: 8086:7010 find_device_operations: match constructor: constructor is 0x00013500 default device constructor called set_pci_ops: dev 0x00014724(dynamic PCI: 00:01.1) already has ops 0x00013500 PCI: 00:01.1 [PCI: 8086:7010] enabled PCI: pci_scan_bus pci_probe_dev returns dev 0x00014724(dynamic PCI: 00:01.1) PCI: devfn 0xa pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) PCI: devfn 0xa, bad id 0xffffffff PCI: pci_scan_bus pci_probe_dev returns dev 0x00000000(None (not found)) PCI: devfn 0xb pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) new_device: devcnt 4 find_device_operations: check all_device_operations[i] 0x000121c0 find_device_operations: cons 0x000121c0, cons id PCI: 1013:00b8 find_device_operations: check all_device_operations[i] 0x00013440 find_device_operations: cons 0x00013440, cons id PCI_DOMAIN: 8086:7190 find_device_operations: check all_device_operations[i] 0x00013500 find_device_operations: cons 0x00013500, cons id PCI: 8086:7010 constructor: constructor is 0x00000000 No ops found and no constructor called for PCI: 8086:7113. find_device_operations: check all_device_operations[i] 0x000121c0 find_device_operations: cons 0x000121c0, cons id PCI: 1013:00b8 find_device_operations: check all_device_operations[i] 0x00013440 find_device_operations: cons 0x00013440, cons id PCI_DOMAIN: 8086:7190 find_device_operations: check all_device_operations[i] 0x00013500 find_device_operations: cons 0x00013500, cons id PCI: 8086:7010 set_pci_ops: dev 0x00014a10(dynamic PCI: 00:01.3) set ops to 0x000120a0 PCI: 00:01.3 [PCI: 8086:7113] enabled PCI: pci_scan_bus pci_probe_dev returns dev 0x00014a10(dynamic PCI: 00:01.3) PCI: devfn 0xc pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) PCI: devfn 0xc, bad id 0xffffffff PCI: pci_scan_bus pci_probe_dev returns dev 0x00000000(None (not found)) PCI: devfn 0xd pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) PCI: devfn 0xd, bad id 0xffffffff PCI: pci_scan_bus pci_probe_dev returns dev 0x00000000(None (not found)) PCI: devfn 0xe pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) PCI: devfn 0xe, bad id 0xffffffff PCI: pci_scan_bus pci_probe_dev returns dev 0x00000000(None (not found)) PCI: devfn 0xf pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) PCI: devfn 0xf, bad id 0xffffffff PCI: pci_scan_bus pci_probe_dev returns dev 0x00000000(None (not found)) PCI: devfn 0x10 pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) new_device: devcnt 5 find_device_operations: check all_device_operations[i] 0x000121c0 find_device_operations: cons 0x000121c0, cons id PCI: 1013:00b8 find_device_operations: match constructor: constructor is 0x000121c0 default device constructor called set_pci_ops: dev 0x00014cfc(dynamic PCI: 00:02.0) already has ops 0x000121c0 Init VGA device PCI: 00:02.0 [PCI: 1013:00b8] enabled PCI: pci_scan_bus pci_probe_dev returns dev 0x00014cfc(dynamic PCI: 00:02.0) PCI: devfn 0x18 pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) new_device: devcnt 6 find_device_operations: check all_device_operations[i] 0x000121c0 find_device_operations: cons 0x000121c0, cons id PCI: 1013:00b8 find_device_operations: check all_device_operations[i] 0x00013440 find_device_operations: cons 0x00013440, cons id PCI_DOMAIN: 8086:7190 find_device_operations: check all_device_operations[i] 0x00013500 find_device_operations: cons 0x00013500, cons id PCI: 8086:7010 constructor: constructor is 0x00000000 No ops found and no constructor called for PCI: 10ec:8029. find_device_operations: check all_device_operations[i] 0x000121c0 find_device_operations: cons 0x000121c0, cons id PCI: 1013:00b8 find_device_operations: check all_device_operations[i] 0x00013440 find_device_operations: cons 0x00013440, cons id PCI_DOMAIN: 8086:7190 find_device_operations: check all_device_operations[i] 0x00013500 find_device_operations: cons 0x00013500, cons id PCI: 8086:7010 set_pci_ops: dev 0x00014fe8(dynamic PCI: 00:03.0) set ops to 0x000120a0 PCI: 00:03.0 [PCI: 10ec:8029] enabled PCI: pci_scan_bus pci_probe_dev returns dev 0x00014fe8(dynamic PCI: 00:03.0) PCI: devfn 0x20 pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) PCI: devfn 0x20, bad id 0xffffffff PCI: pci_scan_bus pci_probe_dev returns dev 0x00000000(None (not found)) PCI: devfn 0x28 pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) PCI: devfn 0x28, bad id 0xffffffff PCI: pci_scan_bus pci_probe_dev returns dev 0x00000000(None (not found)) PCI: devfn 0x30 pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) PCI: devfn 0x30, bad id 0xffffffff PCI: pci_scan_bus pci_probe_dev returns dev 0x00000000(None (not found)) PCI: devfn 0x38 pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) PCI: devfn 0x38, bad id 0xffffffff PCI: pci_scan_bus pci_probe_dev returns dev 0x00000000(None (not found)) PCI: devfn 0x40 pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) PCI: devfn 0x40, bad id 0xffffffff PCI: pci_scan_bus pci_probe_dev returns dev 0x00000000(None (not found)) PCI: devfn 0x48 pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) PCI: devfn 0x48, bad id 0xffffffff PCI: pci_scan_bus pci_probe_dev returns dev 0x00000000(None (not found)) PCI: devfn 0x50 pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) PCI: devfn 0x50, bad id 0xffffffff PCI: pci_scan_bus pci_probe_dev returns dev 0x00000000(None (not found)) PCI: devfn 0x58 pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) PCI: devfn 0x58, bad id 0xffffffff PCI: pci_scan_bus pci_probe_dev returns dev 0x00000000(None (not found)) PCI: devfn 0x60 pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) PCI: devfn 0x60, bad id 0xffffffff PCI: pci_scan_bus pci_probe_dev returns dev 0x00000000(None (not found)) PCI: devfn 0x68 pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) PCI: devfn 0x68, bad id 0xffffffff PCI: pci_scan_bus pci_probe_dev returns dev 0x00000000(None (not found)) PCI: devfn 0x70 pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) PCI: devfn 0x70, bad id 0xffffffff PCI: pci_scan_bus pci_probe_dev returns dev 0x00000000(None (not found)) PCI: devfn 0x78 pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) PCI: devfn 0x78, bad id 0xffffffff PCI: pci_scan_bus pci_probe_dev returns dev 0x00000000(None (not found)) PCI: devfn 0x80 pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) PCI: devfn 0x80, bad id 0xffffffff PCI: pci_scan_bus pci_probe_dev returns dev 0x00000000(None (not found)) PCI: devfn 0x88 pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) PCI: devfn 0x88, bad id 0xffffffff PCI: pci_scan_bus pci_probe_dev returns dev 0x00000000(None (not found)) PCI: devfn 0x90 pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) PCI: devfn 0x90, bad id 0xffffffff PCI: pci_scan_bus pci_probe_dev returns dev 0x00000000(None (not found)) PCI: devfn 0x98 pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) PCI: devfn 0x98, bad id 0xffffffff PCI: pci_scan_bus pci_probe_dev returns dev 0x00000000(None (not found)) PCI: devfn 0xa0 pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) PCI: devfn 0xa0, bad id 0xffffffff PCI: pci_scan_bus pci_probe_dev returns dev 0x00000000(None (not found)) PCI: devfn 0xa8 pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) PCI: devfn 0xa8, bad id 0xffffffff PCI: pci_scan_bus pci_probe_dev returns dev 0x00000000(None (not found)) PCI: devfn 0xb0 pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) PCI: devfn 0xb0, bad id 0xffffffff PCI: pci_scan_bus pci_probe_dev returns dev 0x00000000(None (not found)) PCI: devfn 0xb8 pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) PCI: devfn 0xb8, bad id 0xffffffff PCI: pci_scan_bus pci_probe_dev returns dev 0x00000000(None (not found)) PCI: devfn 0xc0 pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) PCI: devfn 0xc0, bad id 0xffffffff PCI: pci_scan_bus pci_probe_dev returns dev 0x00000000(None (not found)) PCI: devfn 0xc8 pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) PCI: devfn 0xc8, bad id 0xffffffff PCI: pci_scan_bus pci_probe_dev returns dev 0x00000000(None (not found)) PCI: devfn 0xd0 pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) PCI: devfn 0xd0, bad id 0xffffffff PCI: pci_scan_bus pci_probe_dev returns dev 0x00000000(None (not found)) PCI: devfn 0xd8 pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) PCI: devfn 0xd8, bad id 0xffffffff PCI: pci_scan_bus pci_probe_dev returns dev 0x00000000(None (not found)) PCI: devfn 0xe0 pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) PCI: devfn 0xe0, bad id 0xffffffff PCI: pci_scan_bus pci_probe_dev returns dev 0x00000000(None (not found)) PCI: devfn 0xe8 pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) PCI: devfn 0xe8, bad id 0xffffffff PCI: pci_scan_bus pci_probe_dev returns dev 0x00000000(None (not found)) PCI: devfn 0xf0 pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) PCI: devfn 0xf0, bad id 0xffffffff PCI: pci_scan_bus pci_probe_dev returns dev 0x00000000(None (not found)) PCI: devfn 0xf8 pci_scan_get_dev: list is 0x0008fecc, *list is 0x00012b40 pci_scan_get_dev: check dev bus_0 pci_scan_get_dev: child bus_0(PCI_BUS: 0000) not a pci device: it's type 3 PCI: pci_scan_bus pci_scan_get_dev returns dev None (no dev in tree yet) PCI: devfn 0xf8, bad id 0xffffffff PCI: pci_scan_bus pci_probe_dev returns dev 0x00000000(None (not found)) PCI: Done for loop bus_0 ========== PCI: Left over static devices. ===================================== dev_phase3_scan: dynamic PCI: 00:00.0: busdevice 0x0001414c enabled 1 ops 0x000120a0 dev_phase3_scan: can not scan from here, returning 0 dev_phase3_scan: dynamic PCI: 00:01.0: busdevice 0x00014438 enabled 1 ops 0x000120a0 dev_phase3_scan: can not scan from here, returning 0 dev_phase3_scan: dynamic PCI: 00:01.1: busdevice 0x00014724 enabled 1 ops 0x00013500 dev_phase3_scan: can not scan from here, returning 0 dev_phase3_scan: dynamic PCI: 00:01.3: busdevice 0x00014a10 enabled 1 ops 0x000120a0 dev_phase3_scan: can not scan from here, returning 0 dev_phase3_scan: dynamic PCI: 00:02.0: busdevice 0x00014cfc enabled 1 ops 0x000121c0 dev_phase3_scan: can not scan from here, returning 0 dev_phase3_scan: dynamic PCI: 00:03.0: busdevice 0x00014fe8 enabled 1 ops 0x000120a0 dev_phase3_scan: can not scan from here, returning 0 PCI: pci_scan_bus returning with max=000 dev_phase3_scan: returning 0 scan_static_bus for root(Root Device) done dev_phase3_scan: returning 0 Phase 3: Done. Show all devs... root(Root Device): enabled 1 have_resources 0 initialized 0 cpus: Unknown device path type: 0 cpus(): enabled 1 have_resources 0 initialized 0 pci_0_0(PCI: 00:00.0): enabled 1 have_resources 0 initialized 0 pci_1_0(PCI: 00:01.0): enabled 1 have_resources 0 initialized 0 bus_0(PCI_BUS: 0000): enabled 1 have_resources 0 initialized 0 domain_0(PCI_DOMAIN: 0000): enabled 1 have_resources 0 initialized 0 dynamic PCI: 00:00.0(PCI: 00:00.0): enabled 1 have_resources 0 initialized 0 dynamic PCI: 00:01.0(PCI: 00:01.0): enabled 1 have_resources 0 initialized 0 dynamic PCI: 00:01.1(PCI: 00:01.1): enabled 1 have_resources 0 initialized 0 dynamic PCI: 00:01.3(PCI: 00:01.3): enabled 1 have_resources 0 initialized 0 dynamic PCI: 00:02.0(PCI: 00:02.0): enabled 1 have_resources 0 initialized 0 dynamic PCI: 00:03.0(PCI: 00:03.0): enabled 1 have_resources 0 initialized 0 Phase 4: Allocating resources... Phase 4: Reading resources... Root Device compute_allocate_io: base: 00000400 size: 00000000 align: 0 gran: 0 read_resources: root(Root Device) read_resources bus 0 link: 0 read_resources: root(Root Device) dtsname cpus have_resources 0 enabled 1 cpus: Unknown device path type: 0 read_resources: cpus() missing phase4_read_resources read_resources: root(Root Device) dtsname domain_0 have_resources 0 enabled 1 read_resources: domain_0(PCI_DOMAIN: 0000) read_resources bus 0 link: 0 read_resources: domain_0(PCI_DOMAIN: 0000) dtsname dynamic PCI: 00:00.0 have_resources 0 enabled 1 read_resources: domain_0(PCI_DOMAIN: 0000) dtsname dynamic PCI: 00:01.0 have_resources 0 enabled 1 read_resources: domain_0(PCI_DOMAIN: 0000) dtsname dynamic PCI: 00:01.1 have_resources 0 enabled 1 read_resources: domain_0(PCI_DOMAIN: 0000) dtsname dynamic PCI: 00:01.3 have_resources 0 enabled 1 read_resources: domain_0(PCI_DOMAIN: 0000) dtsname dynamic PCI: 00:02.0 have_resources 0 enabled 1 read_resources: domain_0(PCI_DOMAIN: 0000) dtsname dynamic PCI: 00:03.0 have_resources 0 enabled 1 read_resources: domain_0(PCI_DOMAIN: 0000) read_resources bus 0 link: 0 done read_resources: root(Root Device) read_resources bus 0 link: 0 done PCI: 00:03.0 10 * [0x00000400 - 0x000004ff] io PCI: 00:01.1 20 * [0x00000800 - 0x0000080f] io Root Device compute_allocate_io: base: 00000810 size: 00000410 align: 8 gran: 0 done Root Device compute_allocate_mem: base: 00000000 size: 00000000 align: 0 gran: 0 read_resources: root(Root Device) read_resources bus 0 link: 0 read_resources: root(Root Device) dtsname cpus have_resources 0 enabled 1 cpus: Unknown device path type: 0 read_resources: cpus() missing phase4_read_resources read_resources: root(Root Device) dtsname domain_0 have_resources 1 enabled 1 read_resources: root(Root Device) read_resources bus 0 link: 0 done PCI: 00:02.0 10 * [0x00000000 - 0x01ffffff] prefmem PCI: 00:02.0 14 * [0x02000000 - 0x02000fff] mem Root Device compute_allocate_mem: base: 02001000 size: 02001000 align: 25 gran: 0 done Phase 4: Done reading resources. Allocating VGA resource PCI: 00:02.0 Setting PCI_BRIDGE_CTL_VGA for bridge PCI_DOMAIN: 0000 Setting PCI_BRIDGE_CTL_VGA for bridge Root Device Phase 4: Setting resources... Root Device compute_allocate_io: base: 00001000 size: 00000410 align: 8 gran: 0 read_resources: root(Root Device) read_resources bus 0 link: 0 read_resources: root(Root Device) dtsname cpus have_resources 0 enabled 1 cpus: Unknown device path type: 0 read_resources: cpus() missing phase4_read_resources read_resources: root(Root Device) dtsname domain_0 have_resources 1 enabled 1 read_resources: root(Root Device) read_resources bus 0 link: 0 done PCI: 00:03.0 10 * [0x00001000 - 0x000010ff] io PCI: 00:01.1 20 * [0x00001400 - 0x0000140f] io Root Device compute_allocate_io: base: 00001410 size: 00000410 align: 8 gran: 0 done Root Device compute_allocate_mem: base: fc000000 size: 02001000 align: 25 gran: 0 read_resources: root(Root Device) read_resources bus 0 link: 0 read_resources: root(Root Device) dtsname cpus have_resources 0 enabled 1 cpus: Unknown device path type: 0 read_resources: cpus() missing phase4_read_resources read_resources: root(Root Device) dtsname domain_0 have_resources 1 enabled 1 read_resources: root(Root Device) read_resources bus 0 link: 0 done PCI: 00:02.0 10 * [0xfc000000 - 0xfdffffff] prefmem PCI: 00:02.0 14 * [0xfe000000 - 0xfe000fff] mem Root Device compute_allocate_mem: base: fe001000 size: 02001000 align: 25 gran: 0 done root(Root Device) assign_resources, bus 0 link: 0 Adding RAM resource (134217728 bytes) domain_0(PCI_DOMAIN: 0000) assign_resources, bus 0 link: 0 PCI: 00:01.1 20 <- [0x0000001400 - 0x000000140f] size 0x00000010 gran 0x04 io PCI: 00:02.0 10 <- [0x00fc000000 - 0x00fdffffff] size 0x02000000 gran 0x19 prefmem PCI: 00:02.0 14 <- [0x00fe000000 - 0x00fe000fff] size 0x00001000 gran 0x0c mem PCI: 00:03.0 10 <- [0x0000001000 - 0x00000010ff] size 0x00000100 gran 0x08 io domain_0(PCI_DOMAIN: 0000) assign_resources, bus 0 link: 0 root(Root Device) assign_resources, bus 0 link: 0 Phase 4: Done setting resources. Phase 4: Done allocating resources. Show all devs... root(Root Device): enabled 1 have_resources 0 initialized 0 cpus: Unknown device path type: 0 cpus(): enabled 1 have_resources 0 initialized 0 pci_0_0(PCI: 00:00.0): enabled 1 have_resources 0 initialized 0 pci_1_0(PCI: 00:01.0): enabled 1 have_resources 0 initialized 0 bus_0(PCI_BUS: 0000): enabled 1 have_resources 0 initialized 0 domain_0(PCI_DOMAIN: 0000): enabled 1 have_resources 1 initialized 0 dynamic PCI: 00:00.0(PCI: 00:00.0): enabled 1 have_resources 1 initialized 0 dynamic PCI: 00:01.0(PCI: 00:01.0): enabled 1 have_resources 1 initialized 0 dynamic PCI: 00:01.1(PCI: 00:01.1): enabled 1 have_resources 1 initialized 0 dynamic PCI: 00:01.3(PCI: 00:01.3): enabled 1 have_resources 1 initialized 0 dynamic PCI: 00:02.0(PCI: 00:02.0): enabled 1 have_resources 1 initialized 0 dynamic PCI: 00:03.0(PCI: 00:03.0): enabled 1 have_resources 1 initialized 0 Phase 5: Enabling resources... cpus: Unknown device path type: 0 dev_phase5: cpus() missing ops pci_dev_enable_resources: dynamic PCI: 00:00.0 (PCI: 00:00.0) cmd <- 140 pci_dev_enable_resources: dynamic PCI: 00:01.0 (PCI: 00:01.0) cmd <- 147 pci_dev_enable_resources: dynamic PCI: 00:01.1 (PCI: 00:01.1) cmd <- 141 pci_dev_enable_resources: dynamic PCI: 00:01.3 (PCI: 00:01.3) cmd <- 140 pci_dev_enable_resources: dynamic PCI: 00:02.0 (PCI: 00:02.0) cmd <- 143 pci_dev_enable_resources: dynamic PCI: 00:03.0 (PCI: 00:03.0) cmd <- 141 Phase 5: Done. Show all devs... root(Root Device): enabled 1 have_resources 0 initialized 0 cpus: Unknown device path type: 0 cpus(): enabled 1 have_resources 0 initialized 0 pci_0_0(PCI: 00:00.0): enabled 1 have_resources 0 initialized 0 pci_1_0(PCI: 00:01.0): enabled 1 have_resources 0 initialized 0 bus_0(PCI_BUS: 0000): enabled 1 have_resources 0 initialized 0 domain_0(PCI_DOMAIN: 0000): enabled 1 have_resources 1 initialized 0 dynamic PCI: 00:00.0(PCI: 00:00.0): enabled 1 have_resources 1 initialized 0 dynamic PCI: 00:01.0(PCI: 00:01.0): enabled 1 have_resources 1 initialized 0 dynamic PCI: 00:01.1(PCI: 00:01.1): enabled 1 have_resources 1 initialized 0 dynamic PCI: 00:01.3(PCI: 00:01.3): enabled 1 have_resources 1 initialized 0 dynamic PCI: 00:02.0(PCI: 00:02.0): enabled 1 have_resources 1 initialized 0 dynamic PCI: 00:03.0(PCI: 00:03.0): enabled 1 have_resources 1 initialized 0 Phase 6: Initializing devices... Phase 6: Root Device init. Phase 6: PCI: 00:01.0 init. Enabling IDE channel 1 Enabling IDE channel 2 Enabling Legacy IDE Phase 6: PCI: 00:00.0 init. PCI: pci_dev_init Probing for option ROM Phase 6: PCI: 00:01.0 init. PCI: pci_dev_init Probing for option ROM Phase 6: PCI: 00:01.1 init. Enabling IDE channel 1 Enabling IDE channel 2 Enabling Legacy IDE Phase 6: PCI: 00:01.3 init. PCI: pci_dev_init Probing for option ROM Phase 6: PCI: 00:02.0 init. PCI: pci_dev_init Probing for option ROM ROM address for PCI: 00:02.0 = c0000 PCI Expansion ROM, signature 0x0000, INIT size 0x0000, data ptr 0x0000 Incorrect Expansion ROM Header Signature 0000 Phase 6: PCI: 00:03.0 init. PCI: pci_dev_init Probing for option ROM Phase 6: Devices initialized. Show all devs... root(Root Device): enabled 1 have_resources 0 initialized 1 cpus: Unknown device path type: 0 cpus(): enabled 1 have_resources 0 initialized 0 pci_0_0(PCI: 00:00.0): enabled 1 have_resources 0 initialized 0 pci_1_0(PCI: 00:01.0): enabled 1 have_resources 0 initialized 1 bus_0(PCI_BUS: 0000): enabled 1 have_resources 0 initialized 0 domain_0(PCI_DOMAIN: 0000): enabled 1 have_resources 1 initialized 0 dynamic PCI: 00:00.0(PCI: 00:00.0): enabled 1 have_resources 1 initialized 1 dynamic PCI: 00:01.0(PCI: 00:01.0): enabled 1 have_resources 1 initialized 1 dynamic PCI: 00:01.1(PCI: 00:01.1): enabled 1 have_resources 1 initialized 1 dynamic PCI: 00:01.3(PCI: 00:01.3): enabled 1 have_resources 1 initialized 1 dynamic PCI: 00:02.0(PCI: 00:02.0): enabled 1 have_resources 1 initialized 1 dynamic PCI: 00:03.0(PCI: 00:03.0): enabled 1 have_resources 1 initialized 1 LAR: Attempting to open 'normal/option_table'. LAR: Start 0xfffc0000 len 0x40000 LAR: seen member normal/option_table LAR: CHECK normal/option_table @ 0xfffc0000 start 0xfffc0050 len 932 reallen 932 compression 0 entry 0x00000000 loadaddress 0x00000000 search_global_resources: mask 4200 type 4200 search_global_resources: dev root, have_resources 0 #resources 2 search_global_resources: dev cpus, have_resources 0 #resources 0 search_global_resources: dev pci_0_0, have_resources 0 #resources 0 search_global_resources: dev pci_1_0, have_resources 0 #resources 0 search_global_resources: dev bus_0, have_resources 0 #resources 0 search_global_resources: dev domain_0, have_resources 1 #resources 3 search_global_resources: dev domain_0, resource 0, flags 40040100 base 0x0 size 0x0 search_global_resources: dev domain_0, resource 1, flags 40040200 base 0x0 size 0x0 search_global_resources: dev domain_0, resource 2, flags e0004200 base 0x0 size 0x8000000 lb_memory_range: start 0x0 size 0x8000000 search_global_resources: dev dynamic PCI: 00:00.0, have_resources 1 #resources 0 search_global_resources: dev dynamic PCI: 00:01.0, have_resources 1 #resources 0 search_global_resources: dev dynamic PCI: 00:01.1, have_resources 1 #resources 1 search_global_resources: dev dynamic PCI: 00:01.1, resource 0, flags 60000100 base 0x1400 size 0x10 search_global_resources: dev dynamic PCI: 00:01.3, have_resources 1 #resources 0 search_global_resources: dev dynamic PCI: 00:02.0, have_resources 1 #resources 2 search_global_resources: dev dynamic PCI: 00:02.0, resource 0, flags 60001200 base 0xfc000000 size 0x2000000 search_global_resources: dev dynamic PCI: 00:02.0, resource 1, flags 60000200 base 0xfe000000 size 0x1000 search_global_resources: dev dynamic PCI: 00:03.0, have_resources 1 #resources 1 search_global_resources: dev dynamic PCI: 00:03.0, resource 0, flags 60000100 base 0x1000 size 0x100 lb_cleanup_memory_ranges: # entries 1 #0: base 0x00000000 size 0x8000000 lb_memory_range: start 0x0 size 0x500 lb_cleanup_memory_ranges: # entries 2 #0: base 0x00000500 size 0x7fffb00 #1: base 0x00000000 size 0x500 lb_memory_range: start 0xf0000 size 0x0 lb_cleanup_memory_ranges: # entries 4 #0: base 0x00000000 size 0x500 #1: base 0x00000500 size 0xefb00 #2: base 0x000f0000 size 0x7f10000 #3: base 0x000f0000 size 0x0 Wrote coreboot table at: 0x00000500 - 0x00000a74 checksum f37f Show all devs... root(Root Device): enabled 1 have_resources 0 initialized 1 cpus: Unknown device path type: 0 cpus(): enabled 1 have_resources 0 initialized 0 pci_0_0(PCI: 00:00.0): enabled 1 have_resources 0 initialized 0 pci_1_0(PCI: 00:01.0): enabled 1 have_resources 0 initialized 1 bus_0(PCI_BUS: 0000): enabled 1 have_resources 0 initialized 0 domain_0(PCI_DOMAIN: 0000): enabled 1 have_resources 1 initialized 0 dynamic PCI: 00:00.0(PCI: 00:00.0): enabled 1 have_resources 1 initialized 1 dynamic PCI: 00:01.0(PCI: 00:01.0): enabled 1 have_resources 1 initialized 1 dynamic PCI: 00:01.1(PCI: 00:01.1): enabled 1 have_resources 1 initialized 1 dynamic PCI: 00:01.3(PCI: 00:01.3): enabled 1 have_resources 1 initialized 1 dynamic PCI: 00:02.0(PCI: 00:02.0): enabled 1 have_resources 1 initialized 1 dynamic PCI: 00:03.0(PCI: 00:03.0): enabled 1 have_resources 1 initialized 1 Stage2 code done. LAR: Attempting to open 'normal/payload/segment0'. LAR: Start 0xfffc0000 len 0x40000 LAR: seen member normal/option_table LAR: seen member normal/initram/segment0 LAR: seen member normal/stage2/segment0 LAR: seen member normal/stage2/segment1 LAR: seen member normal/stage2/segment2 LAR: seen member bootblock LAR: File not found! LAR: load_file: No such file 'normal/payload/segment0' LAR: load_file_segments: Failed for normal/payload FATAL: No usable payload found. From andreas at bawue.net Sun Jul 6 19:24:12 2008 From: andreas at bawue.net (Andreas Thienemann) Date: Sun, 6 Jul 2008 19:24:12 +0200 (CEST) Subject: [coreboot] [PATCH] Add A29002bt support to flashrom Message-ID: <Pine.LNX.4.58.0807061923560.5257@gate.bb.dicp.net> This patch adds support to the AMIC A29002 chip in its top and bottom configuration to flashrom. Additionally, the alphabetic order of the AMIC chips was fixed. The datasheet is at <http://www.amictechnology.com/pdf/A29002.pdf>. A29002T PREW functionality was tested and works. Signed-off-by: Andreas Thienemann <andreas at bawue.net> --- flash.h | 2 ++ flashchips.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) regards, andreas -------------- next part -------------- Index: flash.h =================================================================== --- flash.h (revision 3414) +++ flash.h (working copy) @@ -119,6 +119,8 @@ #define AMIC_ID 0x7F37 /* AMIC */ #define AMIC_ID_NOPREFIX 0x37 /* AMIC */ #define AMIC_A25L40P 0x2013 +#define AMIC_A29002B 0x0d +#define AMIC_A29002T 0x8c #define AMIC_A29040B 0x86 #define AMIC_A49LF040A 0x9d Index: flashchips.c =================================================================== --- flashchips.c (revision 3414) +++ flashchips.c (working copy) @@ -42,8 +42,10 @@ {"Atmel", "AT49F002(N)T", ATMEL_ID, AT_49F002NT, 256, 256, TEST_UNTESTED, probe_jedec, erase_chip_jedec, write_jedec}, {"Atmel", "AT25DF321", ATMEL_ID, AT_25DF321, 4096, 256, TEST_OK_PREW, probe_spi_rdid, spi_chip_erase_c7, spi_chip_write, spi_chip_read}, {"AMIC", "A25L40P", AMIC_ID, AMIC_A25L40P, 512, 256, TEST_OK_PREW, probe_spi_rdid4, spi_chip_erase_c7, spi_chip_write, spi_chip_read}, + {"AMIC", "A29002B", AMIC_ID_NOPREFIX, AMIC_A29002B, 256, 64 * 1024, TEST_UNTESTED, probe_29f002, erase_29f002, write_29f002}, + {"AMIC", "A29002T", AMIC_ID_NOPREFIX, AMIC_A29002T, 256, 64 * 1024, TEST_OK_PREW, probe_29f002, erase_29f002, write_29f002}, + {"AMIC", "A29040B", AMIC_ID_NOPREFIX, AMIC_A29040B, 512, 64 * 1024, TEST_OK_PR, probe_29f040b, erase_29f040b, write_29f040b}, {"AMIC", "A49LF040A", AMIC_ID_NOPREFIX, AMIC_A49LF040A, 512, 64 * 1024, TEST_OK_PREW, probe_49fl00x, erase_49fl00x, write_49fl00x}, - {"AMIC", "A29040B", AMIC_ID_NOPREFIX, AMIC_A29040B, 512, 64 * 1024, TEST_OK_PR, probe_29f040b, erase_29f040b, write_29f040b}, {"EMST", "F49B002UA", EMST_ID, EMST_F49B002UA, 256, 4096, TEST_UNTESTED, probe_jedec, erase_chip_jedec, write_49f002}, {"EON", "EN29F002(A)(N)B", EON_ID, EN_29F002B, 256, 256, TEST_UNTESTED, probe_jedec, erase_chip_jedec, write_jedec}, {"EON", "EN29F002(A)(N)T", EON_ID, EN_29F002T, 256, 256, TEST_UNTESTED, probe_jedec, erase_chip_jedec, write_jedec}, From svn at coreboot.org Sun Jul 6 19:35:30 2008 From: svn at coreboot.org (svn at coreboot.org) Date: Sun, 6 Jul 2008 19:35:30 +0200 Subject: [coreboot] r3415 - trunk/util/flashrom Message-ID: <mailman.1689.1355071341.16123.coreboot@coreboot.org> Author: stuge Date: 2008-07-06 19:35:30 +0200 (Sun, 06 Jul 2008) New Revision: 3415 Modified: trunk/util/flashrom/flash.h trunk/util/flashrom/flashchips.c Log: flashrom: Add AMIC A29002 This patch adds support to the AMIC A29002 chip in its top and bottom configuration to flashrom. Additionally, the alphabetic order of the AMIC chips was fixed. The datasheet is at <http://www.amictechnology.com/pdf/A29002.pdf>. A29002T PREW functionality was tested and works. This flash chip has asymmetric sector layout so it is important to use the mx29f002 driver, which does chip erase before writing, rather than am29f040b, which uses sector erase. Signed-off-by: Andreas Thienemann <andreas at bawue.net> Acked-by: Peter Stuge <peter at stuge.se> Modified: trunk/util/flashrom/flash.h =================================================================== --- trunk/util/flashrom/flash.h 2008-07-05 09:48:30 UTC (rev 3414) +++ trunk/util/flashrom/flash.h 2008-07-06 17:35:30 UTC (rev 3415) @@ -119,7 +119,6 @@ #define AMIC_ID 0x7F37 /* AMIC */ #define AMIC_ID_NOPREFIX 0x37 /* AMIC */ #define AMIC_A25L40P 0x2013 -#define AMIC_A29040B 0x86 #define AMIC_A49LF040A 0x9d #define ASD_ID 0x25 /* ASD, not listed in JEP106W */ Modified: trunk/util/flashrom/flashchips.c =================================================================== --- trunk/util/flashrom/flashchips.c 2008-07-05 09:48:30 UTC (rev 3414) +++ trunk/util/flashrom/flashchips.c 2008-07-06 17:35:30 UTC (rev 3415) @@ -42,8 +42,10 @@ {"Atmel", "AT49F002(N)T", ATMEL_ID, AT_49F002NT, 256, 256, TEST_UNTESTED, probe_jedec, erase_chip_jedec, write_jedec}, {"Atmel", "AT25DF321", ATMEL_ID, AT_25DF321, 4096, 256, TEST_OK_PREW, probe_spi_rdid, spi_chip_erase_c7, spi_chip_write, spi_chip_read}, {"AMIC", "A25L40P", AMIC_ID, AMIC_A25L40P, 512, 256, TEST_OK_PREW, probe_spi_rdid4, spi_chip_erase_c7, spi_chip_write, spi_chip_read}, + {"AMIC", "A29002B", 0x37, 0x0d, 256, 64 * 1024, TEST_UNTESTED, probe_29f002, erase_29f002, write_29f002}, + {"AMIC", "A29002T", 0x37, 0x8c, 256, 64 * 1024, TEST_OK_PREW, probe_29f002, erase_29f002, write_29f002}, + {"AMIC", "A29040B", 0x37, 0x86, 512, 64 * 1024, TEST_OK_PR, probe_29f040b, erase_29f040b, write_29f040b}, {"AMIC", "A49LF040A", AMIC_ID_NOPREFIX, AMIC_A49LF040A, 512, 64 * 1024, TEST_OK_PREW, probe_49fl00x, erase_49fl00x, write_49fl00x}, - {"AMIC", "A29040B", AMIC_ID_NOPREFIX, AMIC_A29040B, 512, 64 * 1024, TEST_OK_PR, probe_29f040b, erase_29f040b, write_29f040b}, {"EMST", "F49B002UA", EMST_ID, EMST_F49B002UA, 256, 4096, TEST_UNTESTED, probe_jedec, erase_chip_jedec, write_49f002}, {"EON", "EN29F002(A)(N)B", EON_ID, EN_29F002B, 256, 256, TEST_UNTESTED, probe_jedec, erase_chip_jedec, write_jedec}, {"EON", "EN29F002(A)(N)T", EON_ID, EN_29F002T, 256, 256, TEST_UNTESTED, probe_jedec, erase_chip_jedec, write_jedec}, From peter at stuge.se Sun Jul 6 19:36:38 2008 From: peter at stuge.se (Peter Stuge) Date: Sun, 6 Jul 2008 19:36:38 +0200 Subject: [coreboot] [PATCH] Add A29002bt support to flashrom In-Reply-To: <Pine.LNX.4.58.0807061923560.5257@gate.bb.dicp.net> References: <Pine.LNX.4.58.0807061923560.5257@gate.bb.dicp.net> Message-ID: <20080706173638.14561.qmail@stuge.se> On Sun, Jul 06, 2008 at 07:24:12PM +0200, Andreas Thienemann wrote: > Signed-off-by: Andreas Thienemann <andreas at bawue.net> Removed the device ID defines per IRC discussion. Acked-by: Peter Stuge <peter at stuge.se> r3415. Thanks! //Peter From andreas at thienemann.net Sun Jul 6 19:17:51 2008 From: andreas at thienemann.net (Andreas Thienemann) Date: Sun, 6 Jul 2008 19:17:51 +0200 (CEST) Subject: [coreboot] [PATCH] Add A29002bt support to flashrom Message-ID: <Pine.LNX.4.58.0807061917360.5257@gate.bb.dicp.net> This patch adds support to the AMIC A29002 chip in its top and bottom configuration to flashrom. Additionally, the alphabetic order of the AMIC chips was fixed. The datasheet is at <http://www.amictechnology.com/pdf/A29002.pdf>. A29002T PREW functionality was tested and works. Signed-off-by: Andreas Thienemann <andreas at bawue.net> --- flash.h | 2 ++ flashchips.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) regards, andreas -------------- next part -------------- Index: flash.h =================================================================== --- flash.h (revision 3414) +++ flash.h (working copy) @@ -119,6 +119,8 @@ #define AMIC_ID 0x7F37 /* AMIC */ #define AMIC_ID_NOPREFIX 0x37 /* AMIC */ #define AMIC_A25L40P 0x2013 +#define AMIC_A29002B 0x0d +#define AMIC_A29002T 0x8c #define AMIC_A29040B 0x86 #define AMIC_A49LF040A 0x9d Index: flashchips.c =================================================================== --- flashchips.c (revision 3414) +++ flashchips.c (working copy) @@ -42,8 +42,10 @@ {"Atmel", "AT49F002(N)T", ATMEL_ID, AT_49F002NT, 256, 256, TEST_UNTESTED, probe_jedec, erase_chip_jedec, write_jedec}, {"Atmel", "AT25DF321", ATMEL_ID, AT_25DF321, 4096, 256, TEST_OK_PREW, probe_spi_rdid, spi_chip_erase_c7, spi_chip_write, spi_chip_read}, {"AMIC", "A25L40P", AMIC_ID, AMIC_A25L40P, 512, 256, TEST_OK_PREW, probe_spi_rdid4, spi_chip_erase_c7, spi_chip_write, spi_chip_read}, + {"AMIC", "A29002B", AMIC_ID_NOPREFIX, AMIC_A29002B, 256, 64 * 1024, TEST_UNTESTED, probe_29f002, erase_29f002, write_29f002}, + {"AMIC", "A29002T", AMIC_ID_NOPREFIX, AMIC_A29002T, 256, 64 * 1024, TEST_OK_PREW, probe_29f002, erase_29f002, write_29f002}, + {"AMIC", "A29040B", AMIC_ID_NOPREFIX, AMIC_A29040B, 512, 64 * 1024, TEST_OK_PR, probe_29f040b, erase_29f040b, write_29f040b}, {"AMIC", "A49LF040A", AMIC_ID_NOPREFIX, AMIC_A49LF040A, 512, 64 * 1024, TEST_OK_PREW, probe_49fl00x, erase_49fl00x, write_49fl00x}, - {"AMIC", "A29040B", AMIC_ID_NOPREFIX, AMIC_A29040B, 512, 64 * 1024, TEST_OK_PR, probe_29f040b, erase_29f040b, write_29f040b}, {"EMST", "F49B002UA", EMST_ID, EMST_F49B002UA, 256, 4096, TEST_UNTESTED, probe_jedec, erase_chip_jedec, write_49f002}, {"EON", "EN29F002(A)(N)B", EON_ID, EN_29F002B, 256, 256, TEST_UNTESTED, probe_jedec, erase_chip_jedec, write_jedec}, {"EON", "EN29F002(A)(N)T", EON_ID, EN_29F002T, 256, 256, TEST_UNTESTED, probe_jedec, erase_chip_jedec, write_jedec}, From svn at coreboot.org Mon Jul 7 01:04:02 2008 From: svn at coreboot.org (svn at coreboot.org) Date: Mon, 7 Jul 2008 01:04:02 +0200 Subject: [coreboot] r3416 - trunk/util/flashrom Message-ID: <mailman.1690.1355071341.16123.coreboot@coreboot.org> Author: hailfinger Date: 2008-07-07 01:04:01 +0200 (Mon, 07 Jul 2008) New Revision: 3416 Modified: trunk/util/flashrom/flash.h trunk/util/flashrom/flashchips.c Log: r3415 removed symbolic constants for device IDs by accident. flash.h is a database of known IDs, whereas flashchips.c is a database of chips for which support has been implemented. Keep it that way. Trivial. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net> Modified: trunk/util/flashrom/flash.h =================================================================== --- trunk/util/flashrom/flash.h 2008-07-06 17:35:30 UTC (rev 3415) +++ trunk/util/flashrom/flash.h 2008-07-06 23:04:01 UTC (rev 3416) @@ -119,6 +119,9 @@ #define AMIC_ID 0x7F37 /* AMIC */ #define AMIC_ID_NOPREFIX 0x37 /* AMIC */ #define AMIC_A25L40P 0x2013 +#define AMIC_A29002B 0x0d +#define AMIC_A29002T 0x8c +#define AMIC_A29040B 0x86 #define AMIC_A49LF040A 0x9d #define ASD_ID 0x25 /* ASD, not listed in JEP106W */ Modified: trunk/util/flashrom/flashchips.c =================================================================== --- trunk/util/flashrom/flashchips.c 2008-07-06 17:35:30 UTC (rev 3415) +++ trunk/util/flashrom/flashchips.c 2008-07-06 23:04:01 UTC (rev 3416) @@ -42,9 +42,9 @@ {"Atmel", "AT49F002(N)T", ATMEL_ID, AT_49F002NT, 256, 256, TEST_UNTESTED, probe_jedec, erase_chip_jedec, write_jedec}, {"Atmel", "AT25DF321", ATMEL_ID, AT_25DF321, 4096, 256, TEST_OK_PREW, probe_spi_rdid, spi_chip_erase_c7, spi_chip_write, spi_chip_read}, {"AMIC", "A25L40P", AMIC_ID, AMIC_A25L40P, 512, 256, TEST_OK_PREW, probe_spi_rdid4, spi_chip_erase_c7, spi_chip_write, spi_chip_read}, - {"AMIC", "A29002B", 0x37, 0x0d, 256, 64 * 1024, TEST_UNTESTED, probe_29f002, erase_29f002, write_29f002}, - {"AMIC", "A29002T", 0x37, 0x8c, 256, 64 * 1024, TEST_OK_PREW, probe_29f002, erase_29f002, write_29f002}, - {"AMIC", "A29040B", 0x37, 0x86, 512, 64 * 1024, TEST_OK_PR, probe_29f040b, erase_29f040b, write_29f040b}, + {"AMIC", "A29002B", AMIC_ID_NOPREFIX, AMIC_A29002B, 256, 64 * 1024, TEST_UNTESTED, probe_29f002, erase_29f002, write_29f002}, + {"AMIC", "A29002T", AMIC_ID_NOPREFIX, AMIC_A29002T, 256, 64 * 1024, TEST_OK_PREW, probe_29f002, erase_29f002, write_29f002}, + {"AMIC", "A29040B", AMIC_ID_NOPREFIX, AMIC_A29040B, 512, 64 * 1024, TEST_OK_PR, probe_29f040b, erase_29f040b, write_29f040b}, {"AMIC", "A49LF040A", AMIC_ID_NOPREFIX, AMIC_A49LF040A, 512, 64 * 1024, TEST_OK_PREW, probe_49fl00x, erase_49fl00x, write_49fl00x}, {"EMST", "F49B002UA", EMST_ID, EMST_F49B002UA, 256, 4096, TEST_UNTESTED, probe_jedec, erase_chip_jedec, write_49f002}, {"EON", "EN29F002(A)(N)B", EON_ID, EN_29F002B, 256, 256, TEST_UNTESTED, probe_jedec, erase_chip_jedec, write_jedec}, From svn at coreboot.org Mon Jul 7 07:14:07 2008 From: svn at coreboot.org (svn at coreboot.org) Date: Mon, 7 Jul 2008 07:14:07 +0200 Subject: [coreboot] r3417 - trunk/util/flashrom Message-ID: <mailman.1691.1355071341.16123.coreboot@coreboot.org> Author: stuge Date: 2008-07-07 07:14:06 +0200 (Mon, 07 Jul 2008) New Revision: 3417 Modified: trunk/util/flashrom/ichspi.c Log: flashrom: Trivial indent fix in ichspi.c Signed-off-by: Peter Stuge <peter at stuge.se> Acked-by: Peter Stuge <peter at stuge.se> Modified: trunk/util/flashrom/ichspi.c =================================================================== --- trunk/util/flashrom/ichspi.c 2008-07-06 23:04:01 UTC (rev 3416) +++ trunk/util/flashrom/ichspi.c 2008-07-07 05:14:06 UTC (rev 3417) @@ -573,9 +573,9 @@ break; } - if (flashbus == BUS_TYPE_VIA_SPI) { - maxdata = 16; - } + if (flashbus == BUS_TYPE_VIA_SPI) + maxdata = 16; + for (j = 0; j < erase_size / page_size; j++) { ich_spi_write_page(flash, (void *)(buf + (i * erase_size) + (j * page_size)), (i * erase_size) + (j * page_size), maxdata); From stepan at coresystems.de Mon Jul 7 07:50:50 2008 From: stepan at coresystems.de (Stefan Reinauer) Date: Mon, 07 Jul 2008 07:50:50 +0200 Subject: [coreboot] r3416 - trunk/util/flashrom Message-ID: <4871AEBA.30906@coresystems.de> svn at coreboot.org wrote: > Author: hailfinger > Date: 2008-07-07 01:04:01 +0200 (Mon, 07 Jul 2008) > New Revision: 3416 > > Modified: > trunk/util/flashrom/flash.h > trunk/util/flashrom/flashchips.c > Log: > r3415 removed symbolic constants for device IDs by accident. > flash.h is a database of known IDs, whereas flashchips.c is a database > of chips for which support has been implemented. Keep it that way. > > Trivial. > > NACK. This was done on purpose, not by accident. As discussed before, we will not pursue the useless facility of defines for those IDs anymore because they serve no purpose. Stefan -- coresystems GmbH ? Brahmsstr. 16 ? D-79104 Freiburg i. Br. Tel.: +49 761 7668825 ? Fax: +49 761 7664613 Email: info at coresystems.de ? http://www.coresystems.de/ Registergericht: Amtsgericht Freiburg ? HRB 7656 Gesch?ftsf?hrer: Stefan Reinauer ? Ust-IdNr.: DE245674866 From svn at coreboot.org Mon Jul 7 08:38:52 2008 From: svn at coreboot.org (svn at coreboot.org) Date: Mon, 7 Jul 2008 08:38:52 +0200 Subject: [coreboot] r3418 - trunk/util/flashrom Message-ID: <mailman.1692.1355071341.16123.coreboot@coreboot.org> Author: stuge Date: 2008-07-07 08:38:51 +0200 (Mon, 07 Jul 2008) New Revision: 3418 Modified: trunk/util/flashrom/flash.h trunk/util/flashrom/it87spi.c trunk/util/flashrom/spi.c trunk/util/flashrom/spi.h Log: flashrom: Trivial SPI cleanups While writing a new SPI driver I fixed some things in the SPI code: All calls to spi_command() had unneccessary #define duplications, and in some cases the read count define could theoretically become harmful because NULL was passed for the read buffer. Avoid a crash, should someone change the #defines. I also noticed that the only caller of spi_page_program() was the it87 driver, and spi_page_program() could only call back into the it87 driver. Removed the function for easier-to-follow code and made it8716f_spi_page_program() static. The ichspi driver's static page functions are already static. Signed-off-by: Peter Stuge <peter at stuge.se> Acked-by: Peter Stuge <peter at stuge.se> Modified: trunk/util/flashrom/flash.h =================================================================== --- trunk/util/flashrom/flash.h 2008-07-07 05:14:06 UTC (rev 3417) +++ trunk/util/flashrom/flash.h 2008-07-07 06:38:51 UTC (rev 3418) @@ -423,7 +423,6 @@ uint8_t spi_read_status_register(); void spi_disable_blockprotect(void); void spi_byte_program(int address, uint8_t byte); -void spi_page_program(int block, uint8_t *buf, uint8_t *bios); void spi_nbyte_read(int address, uint8_t *bytes, int len); /* 82802ab.c */ @@ -447,7 +446,6 @@ int it8716f_spi_command(unsigned int writecnt, unsigned int readcnt, const unsigned char *writearr, unsigned char *readarr); int it8716f_spi_chip_read(struct flashchip *flash, uint8_t *buf); int it8716f_spi_chip_write(struct flashchip *flash, uint8_t *buf); -void it8716f_spi_page_program(int block, uint8_t *buf, uint8_t *bios); /* jedec.c */ uint8_t oddparity(uint8_t val); Modified: trunk/util/flashrom/it87spi.c =================================================================== --- trunk/util/flashrom/it87spi.c 2008-07-07 05:14:06 UTC (rev 3417) +++ trunk/util/flashrom/it87spi.c 2008-07-07 06:38:51 UTC (rev 3418) @@ -192,7 +192,7 @@ } /* Page size is usually 256 bytes */ -void it8716f_spi_page_program(int block, uint8_t *buf, uint8_t *bios) { +static void it8716f_spi_page_program(int block, uint8_t *buf, uint8_t *bios) { int i; spi_write_enable(); @@ -261,7 +261,7 @@ it8716f_over512k_spi_chip_write(flash, buf); } else { for (i = 0; i < total_size / 256; i++) { - spi_page_program(i, buf, (uint8_t *)flash->virtual_memory); + it8716f_spi_page_program(i, buf, (uint8_t *)flash->virtual_memory); } } return 0; Modified: trunk/util/flashrom/spi.c =================================================================== --- trunk/util/flashrom/spi.c 2008-07-07 05:14:06 UTC (rev 3417) +++ trunk/util/flashrom/spi.c 2008-07-07 06:38:51 UTC (rev 3418) @@ -51,7 +51,7 @@ { const unsigned char cmd[JEDEC_RDID_OUTSIZE] = {JEDEC_RDID}; - if (spi_command(JEDEC_RDID_OUTSIZE, bytes, cmd, readarr)) + if (spi_command(sizeof(cmd), bytes, cmd, readarr)) return 1; printf_debug("RDID returned %02x %02x %02x.\n", readarr[0], readarr[1], readarr[2]); return 0; @@ -61,7 +61,7 @@ { const unsigned char cmd[JEDEC_RES_OUTSIZE] = {JEDEC_RES, 0, 0, 0}; - if (spi_command(JEDEC_RES_OUTSIZE, JEDEC_RES_INSIZE, cmd, readarr)) + if (spi_command(sizeof(cmd), JEDEC_RES_INSIZE, cmd, readarr)) return 1; printf_debug("RES returned %02x.\n", readarr[0]); return 0; @@ -72,7 +72,7 @@ const unsigned char cmd[JEDEC_WREN_OUTSIZE] = {JEDEC_WREN}; /* Send WREN (Write Enable) */ - spi_command(JEDEC_WREN_OUTSIZE, JEDEC_WREN_INSIZE, cmd, NULL); + spi_command(sizeof(cmd), 0, cmd, NULL); } void spi_write_disable() @@ -80,7 +80,7 @@ const unsigned char cmd[JEDEC_WRDI_OUTSIZE] = {JEDEC_WRDI}; /* Send WRDI (Write Disable) */ - spi_command(JEDEC_WRDI_OUTSIZE, JEDEC_WRDI_INSIZE, cmd, NULL); + spi_command(sizeof(cmd), 0, cmd, NULL); } static int probe_spi_rdid_generic(struct flashchip *flash, int bytes) @@ -182,10 +182,10 @@ uint8_t spi_read_status_register() { const unsigned char cmd[JEDEC_RDSR_OUTSIZE] = {JEDEC_RDSR}; - unsigned char readarr[1]; + unsigned char readarr[JEDEC_RDSR_INSIZE]; /* Read Status Register */ - spi_command(JEDEC_RDSR_OUTSIZE, JEDEC_RDSR_INSIZE, cmd, readarr); + spi_command(sizeof(cmd), sizeof(readarr), cmd, readarr); return readarr[0]; } @@ -273,7 +273,7 @@ spi_disable_blockprotect(); spi_write_enable(); /* Send CE (Chip Erase) */ - spi_command(JEDEC_CE_C7_OUTSIZE, JEDEC_CE_C7_INSIZE, cmd, NULL); + spi_command(sizeof(cmd), 0, cmd, NULL); /* Wait until the Write-In-Progress bit is cleared. * This usually takes 1-85 s, so wait in 1 s steps. */ @@ -296,7 +296,7 @@ cmd[3] = (addr & 0x000000ff); spi_write_enable(); /* Send BE (Block Erase) */ - spi_command(JEDEC_BE_D8_OUTSIZE, JEDEC_BE_D8_INSIZE, cmd, NULL); + spi_command(sizeof(cmd), 0, cmd, NULL); /* Wait until the Write-In-Progress bit is cleared. * This usually takes 100-4000 ms, so wait in 100 ms steps. */ @@ -315,7 +315,7 @@ spi_write_enable(); /* Send SE (Sector Erase) */ - spi_command(JEDEC_SE_OUTSIZE, JEDEC_SE_INSIZE, cmd, NULL); + spi_command(sizeof(cmd), 0, cmd, NULL); /* Wait until the Write-In-Progress bit is cleared. * This usually takes 15-800 ms, so wait in 10 ms steps. */ @@ -324,21 +324,6 @@ return 0; } -void spi_page_program(int block, uint8_t *buf, uint8_t *bios) -{ - switch (flashbus) { - case BUS_TYPE_IT87XX_SPI: - it8716f_spi_page_program(block, buf, bios); - break; - case BUS_TYPE_ICH7_SPI: - case BUS_TYPE_ICH9_SPI: - printf_debug("%s called, but not implemented for ICH\n", __FUNCTION__); - break; - default: - printf_debug("%s called, but no SPI chipset/strapping detected\n", __FUNCTION__); - } -} - /* * This is according the SST25VF016 datasheet, who knows it is more * generic that this... @@ -348,7 +333,7 @@ const unsigned char cmd[JEDEC_WRSR_OUTSIZE] = {JEDEC_WRSR, (unsigned char)status}; /* Send WRSR (Write Status Register) */ - spi_command(JEDEC_WRSR_OUTSIZE, JEDEC_WRSR_INSIZE, cmd, NULL); + spi_command(sizeof(cmd), 0, cmd, NULL); } void spi_byte_program(int address, uint8_t byte) @@ -361,7 +346,7 @@ }; /* Send Byte-Program */ - spi_command(JEDEC_BYTE_PROGRAM_OUTSIZE, JEDEC_BYTE_PROGRAM_INSIZE, cmd, NULL); + spi_command(sizeof(cmd), 0, cmd, NULL); } void spi_disable_blockprotect(void) @@ -386,7 +371,7 @@ }; /* Send Read */ - spi_command(JEDEC_READ_OUTSIZE, len, cmd, bytes); + spi_command(sizeof(cmd), len, cmd, bytes); } int spi_chip_read(struct flashchip *flash, uint8_t *buf) Modified: trunk/util/flashrom/spi.h =================================================================== --- trunk/util/flashrom/spi.h 2008-07-07 05:14:06 UTC (rev 3417) +++ trunk/util/flashrom/spi.h 2008-07-07 06:38:51 UTC (rev 3418) @@ -49,7 +49,7 @@ #define JEDEC_CE_60_OUTSIZE 0x01 #define JEDEC_CE_60_INSIZE 0x00 -/* Chip Erase 0xc7 is supported by ST/EON/Macronix chips. */ +/* Chip Erase 0xc7 is supported by SST/ST/EON/Macronix chips. */ #define JEDEC_CE_C7 0xc7 #define JEDEC_CE_C7_OUTSIZE 0x01 #define JEDEC_CE_C7_INSIZE 0x00 From peter at stuge.se Mon Jul 7 09:03:16 2008 From: peter at stuge.se (Peter Stuge) Date: Mon, 7 Jul 2008 09:03:16 +0200 Subject: [coreboot] r3416 - trunk/util/flashrom In-Reply-To: <4871AEBA.30906@coresystems.de> References: <4871AEBA.30906@coresystems.de> Message-ID: <20080707070316.6282.qmail@stuge.se> On Mon, Jul 07, 2008 at 07:50:50AM +0200, Stefan Reinauer wrote: > svn at coreboot.org wrote: > > Author: hailfinger > > > > r3415 removed symbolic constants for device IDs by accident. > > flash.h is a database of known IDs, whereas flashchips.c is a database > > of chips for which support has been implemented. Keep it that way. > > NACK. This was done on purpose, not by accident. As discussed before, > we will not pursue the useless facility of defines for those IDs > anymore because they serve no purpose. Agreed. Carl-Daniel, please revert this. //Peter From peter at stuge.se Mon Jul 7 09:18:06 2008 From: peter at stuge.se (Peter Stuge) Date: Mon, 7 Jul 2008 09:18:06 +0200 Subject: [coreboot] flashrom: Winbond W83627DHG SPI, RDID 90, SST AAI & Intel D201GLY Message-ID: <20080707071806.16552.qmail@stuge.se> Patch attached. The wbsio driver has been tested by rphlx to work correctly for probe and read on the Intel D201GLY board, but erase and write was not tested since he had no easy recovery strategy in case of failure. If anyone can test erase, write or both on a board with W83627DHG or compatible (please add ids to wbsio_get_spibase()) I would be most grateful. Comments, as always, appreciated. //Peter -------------- next part -------------- A non-text attachment was scrubbed... Name: fr.wbsio_spi.d201gly.patch Type: text/x-diff Size: 16310 bytes Desc: not available URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20080707/43c9c11a/attachment.bin> From c-d.hailfinger.devel.2006 at gmx.net Mon Jul 7 14:13:38 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Mon, 07 Jul 2008 14:13:38 +0200 Subject: [coreboot] r3416 - trunk/util/flashrom In-Reply-To: <4871AEBA.30906@coresystems.de> References: <4871AEBA.30906@coresystems.de> Message-ID: <48720872.3060003@gmx.net> On 07.07.2008 07:50, Stefan Reinauer wrote: > svn at coreboot.org wrote: > >> Author: hailfinger >> Date: 2008-07-07 01:04:01 +0200 (Mon, 07 Jul 2008) >> New Revision: 3416 >> >> Modified: >> trunk/util/flashrom/flash.h >> trunk/util/flashrom/flashchips.c >> Log: >> r3415 removed symbolic constants for device IDs by accident. >> flash.h is a database of known IDs, whereas flashchips.c is a database >> of chips for which support has been implemented. Keep it that way. >> >> Trivial. >> >> >> > NACK. This was done on purpose, not by accident. As discussed before, we > will not pursue the useless facility of defines for those IDs anymore > because they serve no purpose. > It would have been nice if this had been mentioned on the mailing list. Are you willing to implement support for a few dozen flash chips which are included in flash.h but not in flashchips.c? Regards Carl-Daniel -- http://www.hailfinger.org/ From c-d.hailfinger.devel.2006 at gmx.net Mon Jul 7 14:56:36 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Mon, 07 Jul 2008 14:56:36 +0200 Subject: [coreboot] r3416 - trunk/util/flashrom In-Reply-To: <4871AEBA.30906@coresystems.de> References: <4871AEBA.30906@coresystems.de> Message-ID: <48721284.7080802@gmx.net> On 07.07.2008 07:50, Stefan Reinauer wrote: > svn at coreboot.org wrote: > >> Author: hailfinger >> Date: 2008-07-07 01:04:01 +0200 (Mon, 07 Jul 2008) >> New Revision: 3416 >> >> Modified: >> trunk/util/flashrom/flash.h >> trunk/util/flashrom/flashchips.c >> Log: >> r3415 removed symbolic constants for device IDs by accident. >> flash.h is a database of known IDs, whereas flashchips.c is a database >> of chips for which support has been implemented. Keep it that way. >> >> Trivial. >> >> >> > NACK. This was done on purpose, not by accident. As discussed before, we > will not pursue the useless facility of defines for those IDs anymore > because they serve no purpose. > Thanks for the hint to search the archives. I finally found the mail you are referring to: http://coreboot.org/pipermail/coreboot/2008-January/029760.html On Sun 2008-01-27 03:15:58, Stefan Reinauer wrote: > flash.h is the only place where the VENDOR_ID defines are > defined and the array in flashchips.c is the only place where they are > used. That reasoning may have been valid back then, but now there are multiple places outside flashchips.c where we use vendor and device IDs. Peter's latest patch to add prettyprinting for SST25VF040B illustrates this quite nicely. Please reconsider your reasoning based on the new situation. Besides that, flash.h often has additional info about a chip which is totally missing in flashchips.c (and the lines there are growing more and more and barely fit into my 227 char wide terminal), so someone would have to merge the info. Regards, Carl-Daniel -- http://www.hailfinger.org/ From c-d.hailfinger.devel.2006 at gmx.net Mon Jul 7 15:55:24 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Mon, 07 Jul 2008 15:55:24 +0200 Subject: [coreboot] flashrom: Winbond W83627DHG SPI, RDID 90, SST AAI & Intel D201GLY In-Reply-To: <20080707071806.16552.qmail@stuge.se> References: <20080707071806.16552.qmail@stuge.se> Message-ID: <4872204C.8010208@gmx.net> On 07.07.2008 09:18, Peter Stuge wrote: > Patch attached. > > The wbsio driver has been tested by rphlx to work correctly for probe > and read on the Intel D201GLY board, but erase and write was not > tested since he had no easy recovery strategy in case of failure. If > anyone can test erase, write or both on a board with W83627DHG or > compatible (please add ids to wbsio_get_spibase()) I would be most > grateful. Comments, as always, appreciated. > Nice patch. Review follows: > flashrom: Winbond SPI driver, RDID 90 probe, SST25VF040B.RDID90 chip, SST AAI write and Intel D201GLY board enable > > The Winbond superio SPI driver supports the maximum possible flash chip size > of 8Mbit. Unfortunately Winbond left out the 4 top address bits in the > programming interface, so there is no way to reach data below 4GB-1Mbyte. > Chip erase still works. > I have not yet reviewed the Winbond driver itself, only the hooks for it in generic code. > Winbond superio SPI masters only support certain command types, so a new probe > is needed at least for the SST25VF040B. > It should be possible to use Winbond command mode 3 (for partial match) and command mode b (for cycling match) to emulate RDID. If that doesn't work, we need a set of 3 IDs per SPI chip: RDID, REMS, RES. > Add prettyprinting for the SST25VF040B status register. > > SST AAI is Auto Address Increment writing, a streamed write to the flash chip > where the first write command sets a starting address, and following commands > simply append data. Unfortunately not supported by Winbond SPI masters. > I believe AAI may be slower than per-page programming due to bigger overhead. Programming in AAI needs 1(command)+3(dummyaddr)+2(data)+(1(command)+2(data))*127(aaiwrites) = 387 cycles for 256 bytes Programming in 16 byte chunks needs (1(command)+3(address)+16(data))*16(chunks) = 320 cycles for 256 bytes Programming in 64 byte chunks needs (1(command)+3(address)+64(data))*4(chunks) = 272 cycles for 256 bytes Programming in 256 byte chunks needs 1(command)+3(address)+256(data) = 260 cycles for 256 bytes > Add an autodetected board enable for the mini-ITX Intel Desktop Board D201GLY. > The PCI ids are 0:2.5 SiS IDE and 1:0.0 SiS VGA with Intel subsystem ids. > > Signed-off-by: Peter Stuge <peter at stuge.se> > Can you split this patch into multiple ones? - Winbond SPI master support - SST status prettyprinting support - AAI support (which is chip-specific) - D201GLY board enable > Index: flash.h > =================================================================== > --- flash.h (revision 3418) > +++ flash.h (working copy) > @@ -378,7 +378,8 @@ > BUS_TYPE_ICH7_SPI, > BUS_TYPE_ICH9_SPI, > BUS_TYPE_IT87XX_SPI, > - BUS_TYPE_VIA_SPI > + BUS_TYPE_VIA_SPI, > + BUS_TYPE_WBSIO_SPI > } flashbus_t; > > extern flashbus_t flashbus; > @@ -411,6 +412,7 @@ > extern char *lb_part, *lb_vendor; > > /* spi.c */ > +int probe_spi_rdid_90(struct flashchip *flash); > That's actually the REMS (read electronci manufacturer signature) command, not a RDID variant. Please call it probe_spi_rems. > int probe_spi_rdid(struct flashchip *flash); > int probe_spi_rdid4(struct flashchip *flash); > int probe_spi_res(struct flashchip *flash); > @@ -424,6 +426,7 @@ > void spi_disable_blockprotect(void); > void spi_byte_program(int address, uint8_t byte); > void spi_nbyte_read(int address, uint8_t *bytes, int len); > +int spi_aai_write(struct flashchip *flash, uint8_t *buf); > > /* 82802ab.c */ > int probe_82802ab(struct flashchip *flash); > @@ -435,6 +438,12 @@ > int erase_29f040b(struct flashchip *flash); > int write_29f040b(struct flashchip *flash, uint8_t *buf); > > +/* board_enable.c */ > +void w836xx_ext_enter(uint16_t port); > +void w836xx_ext_leave(uint16_t port); > +unsigned char wbsio_read(uint16_t index, uint8_t reg); > +void wbsio_write(uint16_t index, uint8_t reg, uint8_t data); > + > /* ichspi.c */ > int ich_spi_command(unsigned int writecnt, unsigned int readcnt, const unsigned char *writearr, unsigned char *readarr); > int ich_spi_read(struct flashchip *flash, uint8_t * buf); > @@ -528,6 +537,12 @@ > /* w49f002u.c */ > int write_49f002(struct flashchip *flash, uint8_t *buf); > > +/* wbsio_spi.c */ > +int wbsio_check_for_spi(const char *name); > +int wbsio_spi_command(unsigned int writecnt, unsigned int readcnt, const unsigned char *writearr, unsigned char *readarr); > +int wbsio_spi_read(struct flashchip *flash, uint8_t *buf); > +int wbsio_spi_write(struct flashchip *flash, uint8_t *buf); > + > /* stm50flw0x0x.c */ > int probe_stm50flw0x0x(struct flashchip *flash); > int erase_stm50flw0x0x(struct flashchip *flash); > Index: flashchips.c > =================================================================== > --- flashchips.c (revision 3418) > +++ flashchips.c (working copy) > @@ -69,6 +69,7 @@ > {"Spansion", "S25FL016A", SPANSION_ID, SPANSION_S25FL016A, 2048, 256, TEST_OK_PREW, probe_spi_rdid, spi_chip_erase_c7, spi_chip_write, spi_chip_read}, > {"SST", "SST25VF016B", SST_ID, SST_25VF016B, 2048, 256, TEST_UNTESTED, probe_spi_rdid, spi_chip_erase_c7, spi_chip_write, spi_chip_read}, > {"SST", "SST25VF040B", SST_ID, SST_25VF040B, 512, 256, TEST_UNTESTED, probe_spi_rdid, spi_chip_erase_c7, spi_chip_write, spi_chip_read}, > + {"SST", "SST25VF040B.RDID90", 0xbf, 0x8d, 512, 64 * 1024, TEST_OK_PR, probe_spi_rdid_90, spi_chip_erase_c7, spi_aai_write, spi_chip_read}, > probe_spi_rems instead of probe_spi_rdid_90, but to be honest, having a SPI controller which does not support RDID is a real PITA and needs a structure redesign. > {"SST", "SST28SF040A", SST_ID, SST_28SF040, 512, 256, TEST_UNTESTED, probe_28sf040, erase_28sf040, write_28sf040}, > {"SST", "SST29EE010", SST_ID, SST_29EE010, 128, 128, TEST_OK_PREW, probe_jedec, erase_chip_jedec, write_jedec}, > {"SST", "SST29LE010", SST_ID, SST_29LE010, 128, 128, TEST_UNTESTED, probe_jedec, erase_chip_jedec, write_jedec}, > Index: spi.c > =================================================================== > --- spi.c (revision 3418) > +++ spi.c (working copy) > @@ -41,6 +41,8 @@ > case BUS_TYPE_ICH9_SPI: > case BUS_TYPE_VIA_SPI: > return ich_spi_command(writecnt, readcnt, writearr, readarr); > + case BUS_TYPE_WBSIO_SPI: > + return wbsio_spi_command(writecnt, readcnt, writearr, readarr); > default: > printf_debug("%s called, but no SPI chipset/strapping detected\n", __FUNCTION__); > } > @@ -130,6 +132,25 @@ > return 0; > } > > +int probe_spi_rdid_90(struct flashchip *flash) { > probe_spi_rems > + unsigned char r[2]; > please call this readarr for consistency > + const unsigned char cmd[4] = {0x90, 0, 0, 0}; > const unsigned char cmd[JEDEC_REMS_OUTSIZE] = {JEDEC_REMS, 0, 0, 0}; > + > + if (spi_command(sizeof(cmd), 2, cmd, r)) > if (spi_command(JEDEC_REMS_OUTSIZE, JEDEC_REMS_INSIZE, cmd, r)) > + return 0; > + > + if (!oddparity(r[0])) > + printf_debug("0x90 RDID byte 0 parity violation.\n"); > "REMS..." > + > + printf_debug("%s: id1 0x%02x, id2 0x%02x\n", __func__, r[0], r[1]); > + > + if (r[0] != flash->manufacture_id || r[1] != flash->model_id) > + return 0; > + > + spi_prettyprint_status_register(flash); > + return 1; > +} > + > int probe_spi_rdid(struct flashchip *flash) { > return probe_spi_rdid_generic(flash, 3); > } > @@ -142,6 +163,7 @@ > case BUS_TYPE_ICH7_SPI: > case BUS_TYPE_ICH9_SPI: > case BUS_TYPE_VIA_SPI: > + case BUS_TYPE_WBSIO_SPI: > return probe_spi_rdid_generic(flash, 4); > default: > printf_debug("4b ID not supported on this SPI controller\n"); > @@ -182,7 +204,7 @@ > uint8_t spi_read_status_register() > { > const unsigned char cmd[JEDEC_RDSR_OUTSIZE] = {JEDEC_RDSR}; > - unsigned char readarr[JEDEC_RDSR_INSIZE]; > + unsigned char readarr[2]; /* JEDEC_RDSR_INSIZE=1 but wbsio needs 2 */ > Simply change JEDEC_RDSR_INSIZE to 2. > > /* Read Status Register */ > spi_command(sizeof(cmd), sizeof(readarr), cmd, readarr); > @@ -243,6 +265,24 @@ > bpt[(status & 0x1c) >> 2]); > } > > +void spi_prettyprint_status_register_sst25vf040b(uint8_t status) > +{ > + const char *bpt[] = { > + "none", > + "0x70000-0x7ffff", > + "0x60000-0x7ffff", > + "0x40000-0x7ffff", > + "all blocks", "all blocks", "all blocks", "all blocks" > + }; > + printf_debug("Chip status register: Block Protect Write Disable " > + "(BPL) is %sset\n", (status & (1 << 7)) ? "" : "not "); > + printf_debug("Chip status register: Auto Address Increment Programming " > + "(AAI) is %sset\n", (status & (1 << 6)) ? "" : "not "); > + spi_prettyprint_status_register_common(status); > + printf_debug("Resulting block protection : %s\n", > + bpt[(status & 0x3c) >> 2]); > +} > + > void spi_prettyprint_status_register(struct flashchip *flash) > { > uint8_t status; > @@ -260,8 +300,15 @@ > spi_prettyprint_status_register_st_m25p(status); > break; > case SST_ID: > - if (flash->model_id == SST_25VF016B) > + switch (flash->model_id) { > + case SST_25VF016B: > spi_prettyprint_status_register_sst25vf016(status); > + break; > + case 0x8d: > + case SST_25VF040B: > These case statements are very inconsistent. Please use #defines for all of them. > + spi_prettyprint_status_register_sst25vf040b(status); > + break; > + } > break; > } > } > @@ -384,6 +431,8 @@ > case BUS_TYPE_ICH9_SPI: > case BUS_TYPE_VIA_SPI: > return ich_spi_read(flash, buf); > + case BUS_TYPE_WBSIO_SPI: > + return wbsio_spi_read(flash, buf); > default: > printf_debug("%s called, but no SPI chipset/strapping detected\n", __FUNCTION__); > } > @@ -400,6 +449,8 @@ > case BUS_TYPE_ICH9_SPI: > case BUS_TYPE_VIA_SPI: > return ich_spi_write(flash, buf); > + case BUS_TYPE_WBSIO_SPI: > + return wbsio_spi_write(flash, buf); > default: > printf_debug("%s called, but no SPI chipset/strapping detected\n", __FUNCTION__); > } > @@ -407,3 +458,28 @@ > return 1; > } > > +int spi_aai_write(struct flashchip *flash, uint8_t *buf) { > + uint32_t pos = 2, size = flash->total_size * 1024; > + unsigned char w[6] = {0xad, 0, 0, 0, buf[0], buf[1]}; > Symbolic constants/#define please. > + switch (flashbus) { > + case BUS_TYPE_WBSIO_SPI: > This switch/case statement needs to be a bit more complicated: For IT87 SPI, something similar to AAI is possible if the number of bytes is 256 or less and if the addresses are below 512k. > + fprintf(stderr, "%s: impossible through Winbond SPI masters, degrading to byte program\n", __func__); > + return spi_chip_write(flash, buf); > + default: > + break; > + } > + spi_chip_erase_c7(flash); > Please use the corresponding pointer in struct flashchip. > + spi_write_enable(); > + spi_command(6, 0, w, NULL); > Symbolic constants/#define please. > + while (spi_read_status_register() & JEDEC_RDSR_BIT_WIP) > + myusec_delay(5); /* SST25VF040B Tbp is max 10us */ > + while (pos < size) { > + w[1] = buf[pos++]; > + w[2] = buf[pos++]; > + spi_command(3, 0, w, NULL); > + while (spi_read_status_register() & JEDEC_RDSR_BIT_WIP) > + myusec_delay(5); /* SST25VF040B Tbp is max 10us */ > + } > + spi_write_disable(); > + return 0; > +} > The function definitely needs more comments. The inner workings are not obvious at first glance which suggests some rather clever programming. > Index: Makefile > =================================================================== > --- Makefile (revision 3418) > +++ Makefile (working copy) > @@ -29,7 +29,7 @@ > w49f002u.o 82802ab.o pm49fl00x.o sst49lf040.o \ > sst49lfxxxc.o sst_fwhub.o layout.o cbtable.o flashchips.o \ > flashrom.o w39v080fa.o sharplhf00l04.o w29ee011.o spi.o it87spi.o \ > - ichspi.o > + ichspi.o wbsio_spi.o > > all: pciutils dep $(PROGRAM) > > Index: wbsio_spi.c > =================================================================== > --- wbsio_spi.c (revision 0) > +++ wbsio_spi.c (revision 0) > @@ -0,0 +1,195 @@ > +/* > + * This file is part of the flashrom project. > + * > + * Copyright (C) 2008 Peter Stuge <peter at stuge.se> > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License as published by > + * the Free Software Foundation; version 2 of the License. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program; if not, write to the Free Software > + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA > + */ > + > +#include <stdio.h> > +#include <pci/pci.h> > +#include <stdint.h> > +#include <string.h> > +#include "flash.h" > +#include "spi.h" > + > +#define WBSIO_PORT1 0x2e > +#define WBSIO_PORT2 0x4e > + > +static uint16_t wbsio_spibase = 0; > + > +static uint16_t wbsio_get_spibase(uint16_t port) { > + uint8_t id; > + uint16_t flashport = 0; > + > + w836xx_ext_enter(port); > + id = wbsio_read(port, 0x20); > + if(id != 0xa0) { > + fprintf(stderr, "W83627 not found at 0x%x, id=0x%02x want=0xa0.\n", port, id); > + goto done; > + } > + > + if (0 == (wbsio_read(port, 0x24) & 2)) { > + fprintf(stderr, "W83627 found at 0x%x, but SPI pins are not enabled. (CR[0x24] bit 1=0)\n", port); > + goto done; > + } > + > + wbsio_write(port, 0x07, 0x06); > + if (0 == (wbsio_read(port, 0x30) & 1)) { > + fprintf(stderr, "W83627 found at 0x%x, but SPI is not enabled. (LDN6[0x30] bit 0=0)\n", port); > + goto done; > + } > + > + flashport = (wbsio_read(port, 0x62) << 8) | wbsio_read(port, 0x63); > + > +done: > + w836xx_ext_leave(port); > + return flashport; > +} > + > +int wbsio_check_for_spi(const char *name) { > + if (0 == (wbsio_spibase = wbsio_get_spibase(WBSIO_PORT1))) > + if (0 == (wbsio_spibase = wbsio_get_spibase(WBSIO_PORT2))) > + return 1; > + > + printf_debug("wbsio_spibase = 0x%x\n", wbsio_spibase); > + flashbus = BUS_TYPE_WBSIO_SPI; > + return 0; > +} > + > +/* W83627DHG has 11 command modes: > + * 1=1 command only > + * 2=1 command+1 data write > + * 3=1 command+2 data read > + * 4=1 command+3 address > + * 5=1 command+3 address+1 data write > + * 6=1 command+3 address+4 data write > + * 7=1 command+3 address+1 dummy address inserted by wbsio+4 data read > + * 8=1 command+3 address+1 data read > + * 9=1 command+3 address+2 data read > + * a=1 command+3 address+3 data read > + * b=1 command+3 address+4 data read > + */ > +int wbsio_spi_command(unsigned int writecnt, unsigned int readcnt, const unsigned char *writearr, unsigned char *readarr) { > + int i; > + uint8_t mode = 0; > + > + printf_debug("%s:", __func__); > + > + if (1 == writecnt && 0 == readcnt) { > + mode = 0x10; > + } else if (2 == writecnt && 0 == readcnt) { > + OUTB(writearr[1], wbsio_spibase + 4); > + printf_debug(" data=0x%02x", writearr[1]); > + mode = 0x20; > + } else if (1 == writecnt && 2 == readcnt) { > + mode = 0x30; > + } else if (4 == writecnt && 0 == readcnt) { > + printf_debug(" addr=0x%02x", (writearr[1] & 0x0f)); > + for (i = 2; i < writecnt; i++) { > + OUTB(writearr[i], wbsio_spibase + i); > + printf_debug("%02x", writearr[i]); > + } > + mode = 0x40 | (writearr[1] & 0x0f); > + } else if (5 == writecnt && 0 == readcnt) { > + printf_debug(" addr=0x%02x", (writearr[1] & 0x0f)); > + for (i = 2; i < 4; i++) { > + OUTB(writearr[i], wbsio_spibase + i); > + printf_debug("%02x", writearr[i]); > + } > + OUTB(writearr[i], wbsio_spibase + i); > + printf_debug(" data=0x%02x", writearr[i]); > + mode = 0x50 | (writearr[1] & 0x0f); > + } else if (8 == writecnt && 0 == readcnt) { > + printf_debug(" addr=0x%02x", (writearr[1] & 0x0f)); > + for (i = 2; i < 4; i++) { > + OUTB(writearr[i], wbsio_spibase + i); > + printf_debug("%02x", writearr[i]); > + } > + printf_debug(" data=0x"); > + for (; i < writecnt; i++) { > + OUTB(writearr[i], wbsio_spibase + i); > + printf_debug("%02x", writearr[i]); > + } > + mode = 0x60 | (writearr[1] & 0x0f); > + } else if (5 == writecnt && 4 == readcnt) { > + /* XXX: TODO not supported by flashrom infrastructure! > + * This mode, 7, discards the fifth byte in writecnt, > + * but since we can not express that in flashrom, fail > + * the operation for now. > + */ > + ; > + } else if (4 == writecnt && readcnt >= 1 && readcnt <= 4) { > + printf_debug(" addr=0x%02x", (writearr[1] & 0x0f)); > + for (i = 2; i < writecnt; i++) { > + OUTB(writearr[i], wbsio_spibase + i); > + printf_debug("%02x", writearr[i]); > + } > + mode = ((7 + readcnt) << 4) | (writearr[1] & 0x0f); > + } > + printf_debug(" cmd=%02x mode=%02x\n", writearr[0], mode); > + > + if (!mode) { > + fprintf(stderr, "%s: unsupported command type wr=%d rd=%d\n", > + __func__, writecnt, readcnt); > + return 1; > + } > + > + OUTB(writearr[0], wbsio_spibase); > + OUTB(mode, wbsio_spibase + 1); > + myusec_delay(10); > + > + if (!readcnt) > + return 0; > + > + printf_debug("%s: returning data =", __func__); > + for (i = 0; i < readcnt; i++) { > + readarr[i] = INB(wbsio_spibase + 4 + i); > + printf_debug(" 0x%02x", readarr[i]); > + } > + printf_debug("\n"); > + > + return 0; > +} > + > +int wbsio_spi_read(struct flashchip *flash, uint8_t *buf) { > + int size = flash->total_size * 1024; > + > + if (flash->total_size > 1024) { > + fprintf(stderr, "%s: Winbond saved on 4 register bits, max chip size is 512 KB. :\\\n", __func__); > + return 1; > + } > + > + memcpy(buf, (const char *)flash->virtual_memory, size); > + return 0; > +} > + > +int wbsio_spi_write(struct flashchip *flash, uint8_t *buf) { > + int pos, size = flash->total_size * 1024; > + > + if (flash->total_size > 1024) { > + fprintf(stderr, "%s: Winbond saved on 4 register bits, max chip size is 512 KB. :\\\n", __func__); > + return 1; > + } > + > + flash->erase(flash); > + spi_write_enable(); > + for (pos = 0; pos < size; pos++) { > + spi_byte_program(pos, buf[pos]); > + while (spi_read_status_register() & JEDEC_RDSR_BIT_WIP) > + myusec_delay(10); > + } > + spi_write_disable(); > + return 0; > +} > Index: board_enable.c > =================================================================== > --- board_enable.c (revision 3418) > +++ board_enable.c (working copy) > @@ -35,32 +35,32 @@ > * Helper functions for many Winbond Super I/Os of the W836xx range. > */ > /* Enter extended functions */ > -static void w836xx_ext_enter(uint16_t port) > +void w836xx_ext_enter(uint16_t port) > { > OUTB(0x87, port); > OUTB(0x87, port); > } > > /* Leave extended functions */ > -static void w836xx_ext_leave(uint16_t port) > +void w836xx_ext_leave(uint16_t port) > { > OUTB(0xAA, port); > } > > /* General functions for reading/writing Winbond Super I/Os. */ > -static unsigned char wbsio_read(uint16_t index, uint8_t reg) > +unsigned char wbsio_read(uint16_t index, uint8_t reg) > { > OUTB(reg, index); > return INB(index + 1); > } > > -static void wbsio_write(uint16_t index, uint8_t reg, uint8_t data) > +void wbsio_write(uint16_t index, uint8_t reg, uint8_t data) > { > OUTB(reg, index); > OUTB(data, index + 1); > } > > -static void wbsio_mask(uint16_t index, uint8_t reg, uint8_t data, uint8_t mask) > +void wbsio_mask(uint16_t index, uint8_t reg, uint8_t data, uint8_t mask) > { > uint8_t tmp; > > @@ -617,6 +617,8 @@ > NULL, NULL, "BioStar P4M80-M4", board_biostar_p4m80_m4}, > {0x1106, 0x3227, 0x1458, 0x5001, 0x10ec, 0x8139, 0x1458, 0xe000, > NULL, NULL, "GIGABYTE GA-7VT600", board_biostar_p4m80_m4}, > + {0x1039, 0x5513, 0x8086, 0xd61f, 0x1039, 0x6330, 0x8086, 0xd61f, > + NULL, NULL, "Intel Desktop Board D201GLY", wbsio_check_for_spi}, > {0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL} /* Keep this */ > }; > > > Regards, Carl-Daniel -- http://www.hailfinger.org/ From svn at coreboot.org Mon Jul 7 17:24:19 2008 From: svn at coreboot.org (svn at coreboot.org) Date: Mon, 7 Jul 2008 17:24:19 +0200 Subject: [coreboot] r212 - buildrom-devel/packages/seabios Message-ID: <mailman.1693.1355071341.16123.coreboot@coreboot.org> Author: myles Date: 2008-07-07 17:24:19 +0200 (Mon, 07 Jul 2008) New Revision: 212 Modified: buildrom-devel/packages/seabios/hardcode.diff buildrom-devel/packages/seabios/seabios.mk Log: This trivial patch changes the git URL for seabios and disables floppy support by default. Signed-off-by: Myles Watson <mylesgw at gmail.com> Acked-by: Myles Watson <mylesgw at gmail.com> Modified: buildrom-devel/packages/seabios/hardcode.diff =================================================================== --- buildrom-devel/packages/seabios/hardcode.diff 2008-07-03 21:48:26 UTC (rev 211) +++ buildrom-devel/packages/seabios/hardcode.diff 2008-07-07 15:24:19 UTC (rev 212) @@ -16,7 +16,7 @@ +#define CONFIG_DEBUG_SERIAL 1 -#define CONFIG_FLOPPY_SUPPORT 1 -+#define CONFIG_FLOPPY_SUPPORT 1 ++#define CONFIG_FLOPPY_SUPPORT 0 #define CONFIG_PS2_MOUSE 1 #define CONFIG_ATA 1 #define CONFIG_KBD_CALL_INT15_4F 1 Modified: buildrom-devel/packages/seabios/seabios.mk =================================================================== --- buildrom-devel/packages/seabios/seabios.mk 2008-07-03 21:48:26 UTC (rev 211) +++ buildrom-devel/packages/seabios/seabios.mk 2008-07-07 15:24:19 UTC (rev 212) @@ -1,4 +1,4 @@ -SEABIOS_URL=git://git.linuxtogo.org/home/kevin/legacybios/ +SEABIOS_URL=git://git.linuxtogo.org/home/kevin/seabios/ SEABIOS_TAG=master SEABIOS_DIR=$(BUILD_DIR)/seabios From c-d.hailfinger.devel.2006 at gmx.net Mon Jul 7 18:12:24 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Mon, 07 Jul 2008 18:12:24 +0200 Subject: [coreboot] which spi chip support interrupt transfer? In-Reply-To: <BBAB206624C8D24E900C73AFAFC031AF03DAFEE5@exchbj03.viatech.com.bj> References: <BBAB206624C8D24E900C73AFAFC031AF03DAFEE5@exchbj03.viatech.com.bj> Message-ID: <48724068.9@gmx.net> Hi! On 05.07.2008 10:51, TigerLiu at viatech.com.cn wrote: > Which type of spi chip support interrupt transfer? > > I have a SST25VF080B, but it does not support interrupt transfter. > What do you mean with interrupt transfer? HOLD support? Regards, Carl-Daniel From marekpenther at aol.com Mon Jul 7 18:34:21 2008 From: marekpenther at aol.com (Marek Artur Penther) Date: Mon, 7 Jul 2008 16:34:21 +0000 Subject: [coreboot] What's new about AMD76x Message-ID: <200807071634.22989.marekpenther@aol.com> Are someone took some effort to write coreboot for AMD76x family?? From c-d.hailfinger.devel.2006 at gmx.net Mon Jul 7 18:55:01 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Mon, 07 Jul 2008 18:55:01 +0200 Subject: [coreboot] What's new about AMD76x In-Reply-To: <200807071634.22989.marekpenther@aol.com> References: <200807071634.22989.marekpenther@aol.com> Message-ID: <48724A65.80005@gmx.net> On 07.07.2008 18:34, Marek Artur Penther wrote: > Are someone took some effort to write coreboot for AMD76x family?? > There is support for AMD76x in coreboot v1. Regards, Carl-Daniel -- http://www.hailfinger.org/ From uwe at hermann-uwe.de Mon Jul 7 19:24:26 2008 From: uwe at hermann-uwe.de (Uwe Hermann) Date: Mon, 7 Jul 2008 19:24:26 +0200 Subject: [coreboot] [PATCH] coreinfo: Add RAM Dump module Message-ID: <20080707172425.GA22136@greenwood> Hi, I've hacked up a small module for coreinfo which should be able to dump arbitrary RAM contents (in hexdump format). I'm using this to demonstrate the "cold boot" RAM attacks published at http://citp.princeton.edu/memory/, which works pretty nicely. Please review, it's possible that the code has some bugs, I'm short on time and didn't program very carefully. Uwe. -- http://www.hermann-uwe.de | http://www.holsham-traders.de http://www.crazy-hacks.org | http://www.unmaintained-free-software.org -------------- next part -------------- A non-text attachment was scrubbed... Name: coreinfo_ramdump.patch Type: text/x-diff Size: 4557 bytes Desc: not available URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20080707/a2e960cc/attachment.bin> From peter at stuge.se Mon Jul 7 19:29:51 2008 From: peter at stuge.se (Peter Stuge) Date: Mon, 7 Jul 2008 19:29:51 +0200 Subject: [coreboot] [PATCH] coreinfo: Add RAM Dump module In-Reply-To: <20080707172425.GA22136@greenwood> References: <20080707172425.GA22136@greenwood> Message-ID: <20080707172951.14756.qmail@stuge.se> On Mon, Jul 07, 2008 at 07:24:26PM +0200, Uwe Hermann wrote: > Please review, it's possible that the code has some bugs, I'm short > on time and didn't program very carefully. Looks good enough. > Add a coreinfo module which can hexdump arbitrary RAM regions and > allows you to scroll through the RAM contents. > > Signed-off-by: Uwe Hermann <uwe at hermann-uwe.de> Acked-by: Peter Stuge <peter at stuge.se> > Index: Kconfig > =================================================================== > --- Kconfig (Revision 3418) > +++ Kconfig (Arbeitskopie) > @@ -68,6 +68,10 @@ > bool "Enable the coreboot bootlog module" > default y > > +config MODULE_RAMDUMP > + bool "Enable the RAM dump module" > + default y > + > config MODULE_LAR > bool "Enable the coreboot LAR module" > default y > Index: coreinfo.c > =================================================================== > --- coreinfo.c (Revision 3418) > +++ coreinfo.c (Arbeitskopie) > @@ -29,6 +29,7 @@ > extern struct coreinfo_module coreboot_module; > extern struct coreinfo_module nvram_module; > extern struct coreinfo_module bootlog_module; > +extern struct coreinfo_module ramdump_module; > extern struct coreinfo_module lar_module; > > struct coreinfo_module *system_modules[] = { > @@ -41,6 +42,9 @@ > #ifdef CONFIG_MODULE_NVRAM > &nvram_module, > #endif > +#ifdef CONFIG_MODULE_RAMDUMP > + &ramdump_module, > +#endif > }; > > struct coreinfo_module *coreboot_modules[] = { > Index: ramdump_module.c > =================================================================== > --- ramdump_module.c (Revision 0) > +++ ramdump_module.c (Revision 0) > @@ -0,0 +1,112 @@ > +/* > + * This file is part of the coreinfo project. > + * > + * Copyright (C) 2008 Uwe Hermann <uwe at hermann-uwe.de> > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License as published by > + * the Free Software Foundation; version 2 of the License. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program; if not, write to the Free Software > + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA > + */ > + > +#include "coreinfo.h" > + > +#ifdef CONFIG_MODULE_RAMDUMP > + > +static s64 cursor = 0; > +static s64 cursor_max = (1 * 1024 * 1024 * 1024); /* Max. 1 GB RAM for now. */ > + > +static int ramdump_module_init(void) > +{ > + return 0; > +} > + > +static void dump_ram(WINDOW *win, uint32_t addr, int row, int col) > +{ > + int i, x = 0, y = 0, count = 0; > + volatile uint8_t *ptr = (void *)(addr); > + > + mvwprintw(win, 0, col + 54, "RAM address: %10d", addr); > + > + /* Dump 256 bytes of RAM. */ > + for (i = 1; i < 257; i++) { > + if (x == 0) { > + mvwprintw(win, row + y, col - 1, "%08x", addr + 16 * y); > + mvwaddch(win, row + y, col + 59, (const chtype)"|"); > + mvwaddch(win, row + y, col + 76, (const chtype)"|"); > + } > + mvwprintw(win, row + y, col + x + 9, "%02x", ptr[i - 1]); > + mvwprintw(win, row + y, 62 + count++, "%c", ptr[i - 1]); > + x += 3; > + if (x == 24) /* One more space after column/byte 8. */ > + x++; > + if (i % 16 == 0) { > + y++; /* Start a newline after 16 bytes. */ > + x = count = 0; > + } > + } > +} > + > +static int ramdump_module_redraw(WINDOW *win) > +{ > + print_module_title(win, "RAM Dump"); > + dump_ram(win, cursor * 256, 2, 2); > + > + return 0; > +} > + > +static int ramdump_module_handle(int key) > +{ > + switch (key) { > + case KEY_DOWN: > + if (cursor == cursor_max) > + return 0; > + cursor++; > + break; > + case KEY_UP: > + if (cursor == 0) > + return 0; > + cursor--; > + break; > + case KEY_NPAGE: > + if (cursor == cursor_max) > + return 0; > + cursor += 4096; /* Jump in 1MB steps. */ > + break; > + case KEY_PPAGE: > + if (cursor == 0) > + return 0; > + cursor -= 4096; /* Jump in 1MB steps. */ > + break; > + } > + > + if (cursor > cursor_max) > + cursor = cursor_max; > + > + if (cursor < 0) > + cursor = 0; > + > + return 1; > +} > + > +struct coreinfo_module ramdump_module = { > + .name = "RAM Dump", > + .init = ramdump_module_init, > + .redraw = ramdump_module_redraw, > + .handle = ramdump_module_handle, > +}; > + > +#else > + > +struct coreinfo_module ramdump_module = { > +}; > + > +#endif > Index: Makefile > =================================================================== > --- Makefile (Revision 3418) > +++ Makefile (Arbeitskopie) > @@ -51,7 +51,8 @@ > INCLUDES = -Ibuild > CFLAGS := -Wall -Werror -Os $(INCLUDES) > OBJECTS = cpuinfo_module.o cpuid.S.o pci_module.o coreboot_module.o \ > - nvram_module.o bootlog_module.o lar_module.o coreinfo.o > + nvram_module.o bootlog_module.o ramdump_module.o lar_module.o \ > + coreinfo.o > OBJS = $(patsubst %,$(obj)/%,$(OBJECTS)) > TARGET = $(obj)/coreinfo.elf > From jordan.crouse at amd.com Mon Jul 7 19:49:15 2008 From: jordan.crouse at amd.com (Jordan Crouse) Date: Mon, 7 Jul 2008 11:49:15 -0600 Subject: [coreboot] coreinfo: Add RAM Dump module In-Reply-To: <20080707172951.14756.qmail@stuge.se> References: <20080707172425.GA22136@greenwood> <20080707172951.14756.qmail@stuge.se> Message-ID: <20080707174915.GC27688@cosmic.amd.com> On 07/07/08 19:29 +0200, Peter Stuge wrote: > On Mon, Jul 07, 2008 at 07:24:26PM +0200, Uwe Hermann wrote: > > Please review, it's possible that the code has some bugs, I'm short > > on time and didn't program very carefully. > > Looks good enough. If it compiles and works for you, thats the most important thing. > > > Add a coreinfo module which can hexdump arbitrary RAM regions and > > allows you to scroll through the RAM contents. > > > > Signed-off-by: Uwe Hermann <uwe at hermann-uwe.de> > > Acked-by: Peter Stuge <peter at stuge.se> Ack the ack. > > > Index: Kconfig > > =================================================================== > > --- Kconfig (Revision 3418) > > +++ Kconfig (Arbeitskopie) > > @@ -68,6 +68,10 @@ > > bool "Enable the coreboot bootlog module" > > default y > > > > +config MODULE_RAMDUMP > > + bool "Enable the RAM dump module" > > + default y > > + > > config MODULE_LAR > > bool "Enable the coreboot LAR module" > > default y > > Index: coreinfo.c > > =================================================================== > > --- coreinfo.c (Revision 3418) > > +++ coreinfo.c (Arbeitskopie) > > @@ -29,6 +29,7 @@ > > extern struct coreinfo_module coreboot_module; > > extern struct coreinfo_module nvram_module; > > extern struct coreinfo_module bootlog_module; > > +extern struct coreinfo_module ramdump_module; > > extern struct coreinfo_module lar_module; > > > > struct coreinfo_module *system_modules[] = { > > @@ -41,6 +42,9 @@ > > #ifdef CONFIG_MODULE_NVRAM > > &nvram_module, > > #endif > > +#ifdef CONFIG_MODULE_RAMDUMP > > + &ramdump_module, > > +#endif > > }; > > > > struct coreinfo_module *coreboot_modules[] = { > > Index: ramdump_module.c > > =================================================================== > > --- ramdump_module.c (Revision 0) > > +++ ramdump_module.c (Revision 0) > > @@ -0,0 +1,112 @@ > > +/* > > + * This file is part of the coreinfo project. > > + * > > + * Copyright (C) 2008 Uwe Hermann <uwe at hermann-uwe.de> > > + * > > + * This program is free software; you can redistribute it and/or modify > > + * it under the terms of the GNU General Public License as published by > > + * the Free Software Foundation; version 2 of the License. > > + * > > + * This program is distributed in the hope that it will be useful, > > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > > + * GNU General Public License for more details. > > + * > > + * You should have received a copy of the GNU General Public License > > + * along with this program; if not, write to the Free Software > > + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA > > + */ > > + > > +#include "coreinfo.h" > > + > > +#ifdef CONFIG_MODULE_RAMDUMP > > + > > +static s64 cursor = 0; > > +static s64 cursor_max = (1 * 1024 * 1024 * 1024); /* Max. 1 GB RAM for now. */ > > + > > +static int ramdump_module_init(void) > > +{ > > + return 0; > > +} > > + > > +static void dump_ram(WINDOW *win, uint32_t addr, int row, int col) > > +{ > > + int i, x = 0, y = 0, count = 0; > > + volatile uint8_t *ptr = (void *)(addr); > > + > > + mvwprintw(win, 0, col + 54, "RAM address: %10d", addr); > > + > > + /* Dump 256 bytes of RAM. */ > > + for (i = 1; i < 257; i++) { > > + if (x == 0) { > > + mvwprintw(win, row + y, col - 1, "%08x", addr + 16 * y); > > + mvwaddch(win, row + y, col + 59, (const chtype)"|"); > > + mvwaddch(win, row + y, col + 76, (const chtype)"|"); > > + } > > + mvwprintw(win, row + y, col + x + 9, "%02x", ptr[i - 1]); > > + mvwprintw(win, row + y, 62 + count++, "%c", ptr[i - 1]); > > + x += 3; > > + if (x == 24) /* One more space after column/byte 8. */ > > + x++; > > + if (i % 16 == 0) { > > + y++; /* Start a newline after 16 bytes. */ > > + x = count = 0; > > + } > > + } > > +} > > + > > +static int ramdump_module_redraw(WINDOW *win) > > +{ > > + print_module_title(win, "RAM Dump"); > > + dump_ram(win, cursor * 256, 2, 2); > > + > > + return 0; > > +} > > + > > +static int ramdump_module_handle(int key) > > +{ > > + switch (key) { > > + case KEY_DOWN: > > + if (cursor == cursor_max) > > + return 0; > > + cursor++; > > + break; > > + case KEY_UP: > > + if (cursor == 0) > > + return 0; > > + cursor--; > > + break; > > + case KEY_NPAGE: > > + if (cursor == cursor_max) > > + return 0; > > + cursor += 4096; /* Jump in 1MB steps. */ > > + break; > > + case KEY_PPAGE: > > + if (cursor == 0) > > + return 0; > > + cursor -= 4096; /* Jump in 1MB steps. */ > > + break; > > + } > > + > > + if (cursor > cursor_max) > > + cursor = cursor_max; > > + > > + if (cursor < 0) > > + cursor = 0; > > + > > + return 1; > > +} > > + > > +struct coreinfo_module ramdump_module = { > > + .name = "RAM Dump", > > + .init = ramdump_module_init, > > + .redraw = ramdump_module_redraw, > > + .handle = ramdump_module_handle, > > +}; > > + > > +#else > > + > > +struct coreinfo_module ramdump_module = { > > +}; > > + > > +#endif > > Index: Makefile > > =================================================================== > > --- Makefile (Revision 3418) > > +++ Makefile (Arbeitskopie) > > @@ -51,7 +51,8 @@ > > INCLUDES = -Ibuild > > CFLAGS := -Wall -Werror -Os $(INCLUDES) > > OBJECTS = cpuinfo_module.o cpuid.S.o pci_module.o coreboot_module.o \ > > - nvram_module.o bootlog_module.o lar_module.o coreinfo.o > > + nvram_module.o bootlog_module.o ramdump_module.o lar_module.o \ > > + coreinfo.o > > OBJS = $(patsubst %,$(obj)/%,$(OBJECTS)) > > TARGET = $(obj)/coreinfo.elf > > > > -- > coreboot mailing list > coreboot at coreboot.org > http://www.coreboot.org/mailman/listinfo/coreboot > -- Jordan Crouse Systems Software Development Engineer Advanced Micro Devices, Inc. From mylesgw at gmail.com Mon Jul 7 19:52:21 2008 From: mylesgw at gmail.com (Myles Watson) Date: Mon, 7 Jul 2008 11:52:21 -0600 Subject: [coreboot] SeaBIOS booting In-Reply-To: <005701c8de0e$aa495460$0023040a@chimp> References: <2831fecf0807031454x747121a5hadbe5eaf12cc404c@mail.gmail.com> <2831fecf0807031527m16c7a9f5wcac5386b1af398d6@mail.gmail.com> <20080704064047.GB7073@morn.localdomain> <005701c8de0e$aa495460$0023040a@chimp> Message-ID: <2831fecf0807071052j7984ee37v73b1905e7d30d720@mail.gmail.com> On Fri, Jul 4, 2008 at 1:46 PM, Myles Watson <mylesgw at gmail.com> wrote: > > >> -----Original Message----- >> From: Kevin O'Connor [mailto:kevin at koconnor.net] >> Sent: Friday, July 04, 2008 12:41 AM >> To: Myles Watson >> Cc: Coreboot >> Subject: Re: [coreboot] SeaBIOS booting >> >> On Thu, Jul 03, 2008 at 04:27:51PM -0600, Myles Watson wrote: >> > Kevin, >> > >> > I didn't have my windows CD handy, so I tried several Linux install >> > CDs, but I can't get them to boot on my s2892. They boot fine in qemu >> > with SeaBIOS. >> >> Okay - thanks for trying. >> >> > Here's the log: >> Kevin, >> I don't see anything unusual in the log. Did all the OSes die in the >> same way? Yes. >> Did anything come up on the vga screen? I missed this question the first time. Nothing comes up on the VGA screen. That was especially interesting to me because when I tried to boot the Windows CD in qemu, if I press F12 for the boot menu, then select 3. CD-ROM, it says Press Any Key to Boot from CD..... If you wait until all 5 dots are there, you can't press any key any more. It hangs. Maybe that's what's happening, maybe it's something else, I'm still looking. Does the lack of VGA output give any hints? I have VGA output until it jumps to the SeaBIOS, but nothing after that. Thanks, Myles From kevin at koconnor.net Tue Jul 8 01:46:55 2008 From: kevin at koconnor.net (Kevin O'Connor) Date: Mon, 7 Jul 2008 19:46:55 -0400 Subject: [coreboot] SeaBIOS booting In-Reply-To: <2831fecf0807071052j7984ee37v73b1905e7d30d720@mail.gmail.com> References: <2831fecf0807031454x747121a5hadbe5eaf12cc404c@mail.gmail.com> <2831fecf0807031527m16c7a9f5wcac5386b1af398d6@mail.gmail.com> <20080704064047.GB7073@morn.localdomain> <005701c8de0e$aa495460$0023040a@chimp> <2831fecf0807071052j7984ee37v73b1905e7d30d720@mail.gmail.com> Message-ID: <20080707234655.GA27159@morn.localdomain> On Mon, Jul 07, 2008 at 11:52:21AM -0600, Myles Watson wrote: > >> I don't see anything unusual in the log. Did all the OSes die in the > >> same way? > Yes. > > >> Did anything come up on the vga screen? > > I missed this question the first time. Nothing comes up on the VGA > screen. That was especially interesting to me because when I tried to > boot the Windows CD in qemu, if I press F12 for the boot menu, then > select 3. CD-ROM, it says Press Any Key to Boot from CD..... If you > wait until all 5 dots are there, you can't press any key any more. It > hangs. Hrmm - I don't see this on my machine. Did you compile seabios yourself? Maybe it's being miscompiled on your machine. Can you try the elf at: http://linuxtogo.org/~kevin/SeaBIOS/bios.bin.elf-0.2.3 > Maybe that's what's happening, maybe it's something else, I'm still looking. > > Does the lack of VGA output give any hints? I have VGA output until > it jumps to the SeaBIOS, but nothing after that. It's very odd. From your log: Scan for VGA option rom Running option rom at 000c0003 That indicates that seabios found your vga rom and ran it. I don't know why you wouldn't see seabios' output on the screen. It can be pretty challenging to debug these problems. The only thing I can think of that will help is to try and increase the debug levels in src/config.h. I'm currently tracking down a boot failure with os/2 under qemu. Maybe the fix will improve booting on other OSes as well. -Kevin From c-d.hailfinger.devel.2006 at gmx.net Tue Jul 8 11:53:35 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Tue, 08 Jul 2008 11:53:35 +0200 Subject: [coreboot] [PATCH] v3: Move default mainboard vendor/subsystem from Kconfig to dts In-Reply-To: <486F86B1.1080805@gmx.net> References: <13426df10802281040n4afcdce1p1af052b71ce556f1@mail.gmail.com> <13426df10803050753h52f8030fjfeee5b678ff8b4e6@mail.gmail.com> <47CEC43F.8010307@gmx.net> <13426df10803050810u62fb6b68o3a3d7dc672bdfbe6@mail.gmail.com> <47CECB60.9060401@gmx.net> <47CF28F1.3060605@gmx.net> <13426df10803051527v56be68e2tabfb37141a026ab4@mail.gmail.com> <47CF38D5.3040608@gmx.net> <13426df10803051700j590288b4s12c0796d033eae2e@mail.gmail.com> <47D08726.7010009@gmx.net> <13426df10803061632j4878fe2dlebe335f3822957ab@mail.gmail.com> <47D091F7.9060109@gmx.net> <486F86B1.1080805@gmx.net> Message-ID: <4873391F.4020706@gmx.net> Can someone please review this? Besides moving mainboard-specific hardware configuration from Kconfig to DTS (where it belongs), it also reduces the amount of per-mainboard code in the tree. Regards, Carl-Daniel On 05.07.2008 16:35, Carl-Daniel Hailfinger wrote: > Move default mainboard vendor/subsystem from Kconfig to dts. > Compile tested including boundary cases. > > Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net> > > Index: LinuxBIOSv3-mainboard_subsystem/mainboard/adl/msm800sev/Kconfig > =================================================================== > --- LinuxBIOSv3-mainboard_subsystem/mainboard/adl/msm800sev/Kconfig (Revision 692) > +++ LinuxBIOSv3-mainboard_subsystem/mainboard/adl/msm800sev/Kconfig (Arbeitskopie) > @@ -26,19 +26,3 @@ > help > This is the name for the Advanced Digital Logic MSM800SEV mainboard. > > -config MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID > - hex > - # TODO: Fix the PCI ID. > - default 0x1022 > - depends BOARD_ADL_MSM800SEV > - help > - Mainboard specific PCI subsystem vendor ID. > - > -config MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID > - hex > - # TODO: Fix the PCI ID. > - default 0x2323 > - depends BOARD_ADL_MSM800SEV > - help > - Mainboard specific PCI subsystem vendor ID. > - > Index: LinuxBIOSv3-mainboard_subsystem/mainboard/adl/msm800sev/dts > =================================================================== > --- LinuxBIOSv3-mainboard_subsystem/mainboard/adl/msm800sev/dts (Revision 692) > +++ LinuxBIOSv3-mainboard_subsystem/mainboard/adl/msm800sev/dts (Arbeitskopie) > @@ -23,6 +23,8 @@ > /{ > mainboard-vendor = "Advanced Digital Logic"; > mainboard-name = "MSM800SEV"; > + mainboard_pci_subsystem_vendor = "0x1022"; > + mainboard_pci_subsystem_device = "0x2323"; > cpus { }; > apic at 0 { > /config/("northbridge/amd/geodelx/apic"); > Index: LinuxBIOSv3-mainboard_subsystem/mainboard/amd/norwich/Kconfig > =================================================================== > --- LinuxBIOSv3-mainboard_subsystem/mainboard/amd/norwich/Kconfig (Revision 692) > +++ LinuxBIOSv3-mainboard_subsystem/mainboard/amd/norwich/Kconfig (Arbeitskopie) > @@ -26,19 +26,3 @@ > help > This is the default mainboard name. > > -config MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID > - hex > - # TODO: Fix PCI ID. > - default 0x1022 > - depends BOARD_AMD_NORWICH > - help > - Mainboard specific PCI subsystem vendor ID. > - > -config MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID > - hex > - # TODO: Fix PCI ID. > - default 0x2323 > - depends BOARD_AMD_NORWICH > - help > - Mainboard specific PCI subsystem device ID. > - > Index: LinuxBIOSv3-mainboard_subsystem/mainboard/amd/norwich/dts > =================================================================== > --- LinuxBIOSv3-mainboard_subsystem/mainboard/amd/norwich/dts (Revision 692) > +++ LinuxBIOSv3-mainboard_subsystem/mainboard/amd/norwich/dts (Arbeitskopie) > @@ -21,6 +21,8 @@ > /{ > mainboard-vendor = "AMD"; > mainboard-name = "NORWICH"; > + mainboard_pci_subsystem_vendor = "0x1022"; > + mainboard_pci_subsystem_device = "0x2323"; > cpus { }; > apic at 0 { > /config/("northbridge/amd/geodelx/apic"); > Index: LinuxBIOSv3-mainboard_subsystem/mainboard/artecgroup/dbe61/Kconfig > =================================================================== > --- LinuxBIOSv3-mainboard_subsystem/mainboard/artecgroup/dbe61/Kconfig (Revision 692) > +++ LinuxBIOSv3-mainboard_subsystem/mainboard/artecgroup/dbe61/Kconfig (Arbeitskopie) > @@ -26,19 +26,3 @@ > help > This is the default mainboard name. > > -config MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID > - hex > - # TODO: Fix PCI ID. > - default 0x1022 > - depends BOARD_ARTECGROUP_DBE61 > - help > - Mainboard specific PCI subsystem vendor ID. > - > -config MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID > - hex > - # TODO: Fix PCI ID. > - default 0x2323 > - depends BOARD_ARTECGROUP_DBE61 > - help > - Mainboard specific PCI subsystem device ID. > - > Index: LinuxBIOSv3-mainboard_subsystem/mainboard/artecgroup/dbe61/dts > =================================================================== > --- LinuxBIOSv3-mainboard_subsystem/mainboard/artecgroup/dbe61/dts (Revision 692) > +++ LinuxBIOSv3-mainboard_subsystem/mainboard/artecgroup/dbe61/dts (Arbeitskopie) > @@ -75,6 +75,8 @@ > /{ > mainboard-vendor = "Artec Group"; > mainboard-name = "DBE61"; > + mainboard_pci_subsystem_vendor = "0x1022"; > + mainboard_pci_subsystem_device = "0x2323"; > cpus { }; > apic at 0 { > /config/("northbridge/amd/geodelx/apic"); > Index: LinuxBIOSv3-mainboard_subsystem/mainboard/emulation/qemu-x86/Kconfig > =================================================================== > --- LinuxBIOSv3-mainboard_subsystem/mainboard/emulation/qemu-x86/Kconfig (Revision 692) > +++ LinuxBIOSv3-mainboard_subsystem/mainboard/emulation/qemu-x86/Kconfig (Arbeitskopie) > @@ -27,17 +27,3 @@ > help > This is the default mainboard name. > > -config MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID > - hex > - default 0x15ad > - depends BOARD_EMULATION_QEMU_X86 > - help > - Mainboard specific PCI subsystem vendor ID. > - > -config MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID > - hex > - default 0x1976 > - depends BOARD_EMULATION_QEMU_X86 > - help > - Mainboard specific PCI subsystem device ID. > - > Index: LinuxBIOSv3-mainboard_subsystem/mainboard/emulation/qemu-x86/dts > =================================================================== > --- LinuxBIOSv3-mainboard_subsystem/mainboard/emulation/qemu-x86/dts (Revision 692) > +++ LinuxBIOSv3-mainboard_subsystem/mainboard/emulation/qemu-x86/dts (Arbeitskopie) > @@ -21,6 +21,8 @@ > /{ > mainboard-vendor = "Emulation"; > mainboard-name = "QEMU x86"; > + mainboard_pci_subsystem_vendor = "0x15ad"; > + mainboard_pci_subsystem_device = "0x1976"; > device_operations = "qemuvga_pci_ops_dev"; > cpus {}; > domain at 0 { > Index: LinuxBIOSv3-mainboard_subsystem/device/pci_device.c > =================================================================== > --- LinuxBIOSv3-mainboard_subsystem/device/pci_device.c (Revision 692) > +++ LinuxBIOSv3-mainboard_subsystem/device/pci_device.c (Arbeitskopie) > @@ -50,6 +50,7 @@ > #if CONFIG_CARDBUS_PLUGIN_SUPPORT == 1 > #include <device/cardbus.h> > #endif > +#include <statictree.h> > > u8 pci_moving_config8(struct device *dev, unsigned int reg) > { > @@ -627,19 +628,18 @@ > /* Set the subsystem vendor and device ID for mainboard devices. */ > ops = ops_pci(dev); > > -#if defined(CONFIG_MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID) && \ > - defined(CONFIG_MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID) > +#ifdef HAVE_MAINBOARD_PCI_SUBSYSTEM_ID > if (dev->on_mainboard && ops && ops->set_subsystem) { > printk(BIOS_DEBUG, > "%s: Setting subsystem VID/DID to %02x/%02x\n", > - dev_path(dev), CONFIG_MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID, > - CONFIG_MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID); > + dev_path(dev), mainboard_pci_subsystem_vendor, > + mainboard_pci_subsystem_device); > > - ops->set_subsystem(dev, > - CONFIG_MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID, > - CONFIG_MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID); > + ops->set_subsystem(dev, mainboard_pci_subsystem_vendor, > + mainboard_pci_subsystem_device); > } > #endif > + > command = pci_read_config16(dev, PCI_COMMAND); > command |= dev->command; > command |= (PCI_COMMAND_PARITY + PCI_COMMAND_SERR); // Error check. > Index: LinuxBIOSv3-mainboard_subsystem/util/dtc/flattree.c > =================================================================== > --- LinuxBIOSv3-mainboard_subsystem/util/dtc/flattree.c (Revision 692) > +++ LinuxBIOSv3-mainboard_subsystem/util/dtc/flattree.c (Arbeitskopie) > @@ -1328,7 +1328,7 @@ > extern char *code; > struct node *next; > extern struct node *first_node; > - int found_mainboard_vendor = 0, found_mainboard_partnumber = 0; > + int found_mainboard_vendor = 0, found_mainboard_partnumber = 0, found_mainboard_subsys = 0; > > labeltree(bi->dt); > > @@ -1361,6 +1361,14 @@ > found_mainboard_partnumber = 1; > fprintf(f, "const char *mainboard_part_number = \"%s\";\n", prop->val.val); > } > + if (streq(prop->name, "mainboard_pci_subsystem_vendor")){ > + found_mainboard_subsys++; > + fprintf(f, "const u16 mainboard_pci_subsystem_vendor = %s;\n", prop->val.val); > + } > + if (streq(prop->name, "mainboard_pci_subsystem_device")){ > + found_mainboard_subsys++; > + fprintf(f, "const u16 mainboard_pci_subsystem_device = %s;\n", prop->val.val); > + } > } > > if (! found_mainboard_vendor){ > @@ -1374,6 +1382,17 @@ > "(and make sure there is a mainboard-vendor property too"); > } > > + switch (found_mainboard_subsys) { > + case 0: > + break; > + case 1: > + die("There is only one of mainboard_pci_subsystem_vendor and " > + "mainboard_pci_subsystem_device properties in the root. " > + "Please add the other one or remove the existing one."); > + break; > + case 2: > + break; > + } > > /* emit the code, if any */ > if (code) > @@ -1395,6 +1414,8 @@ > char *symprefix = "dt"; > extern char *code; > struct node *next; > + struct property *prop; > + int found_mainboard_subsys = 0; > extern struct node *first_node; > > labeltree(bi->dt); > @@ -1416,6 +1437,31 @@ > /* emit any includes that we need -- TODO: ONLY ONCE PER TYPE*/ > fprintf(f, "#include <device/device.h>\n#include <device/pci.h>\n"); > fprintf(f, "extern const char *mainboard_vendor, *mainboard_part_number;\n"); > + > + for_each_property(bi->dt, prop) { > + if (streq(prop->name, "mainboard_pci_subsystem_vendor")){ > + found_mainboard_subsys++; > + } > + if (streq(prop->name, "mainboard_pci_subsystem_device")){ > + found_mainboard_subsys++; > + } > + } > + > + switch (found_mainboard_subsys) { > + case 0: > + break; > + case 1: > + die("There is only one of mainboard_pci_subsystem_vendor and " > + "mainboard_pci_subsystem_device properties in the root. " > + "Please add the other one or remove the existing one."); > + break; > + case 2: > + fprintf(f, "#define HAVE_MAINBOARD_PCI_SUBSYSTEM_ID\n"); > + fprintf(f, "extern const u16 mainboard_pci_subsystem_vendor;\n"); > + fprintf(f, "extern const u16 mainboard_pci_subsystem_device;\n"); > + break; > + } > + > flatten_tree_emit_includes(bi->dt, &coreboot_emitter, f, &strbuf, vi); > > flatten_tree_emit_structdecls(bi->dt, &coreboot_emitter, f, &strbuf, vi); > > > > -- http://www.hailfinger.org/ From bari at onelabs.com Tue Jul 8 15:31:12 2008 From: bari at onelabs.com (bari) Date: Tue, 08 Jul 2008 08:31:12 -0500 Subject: [coreboot] USB debug cables and emulation In-Reply-To: <D29B6F0B906948AC993891E92C489098@smitty2m> References: <20080703171849.25200.qmail@stuge.se><5316BBB2E44445B99D12D0C00002CCDA@smitty2m> <20080703202130.17415.qmail@stuge.se> <3F563A4B2204444FB6FFDED53F383D1B@smitty2m> <486D5EEF.7000201@coresystems.de><91eeb3f61af892c64e4a0a24a83fd74d@imap.1and1.com> <486D8072.5080408@georgi-clan.de> <D29B6F0B906948AC993891E92C489098@smitty2m> Message-ID: <48736C20.9040402@onelabs.com> Joseph Smith wrote: > > Great. I am going to be on vacation next week. I am about half way through > reading the USB 2.0 specification (http://www.usb.org/developers/docs/), and > I will try to finish by next week and dive right in when I get back :-) > > Take a look at the microchip PIC devices as an inexpensive alternative for a USB debug device. PIC24FJ128 series is ~$5 and should do the job. http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1486&redirects=USB They give you all the source to a USB stack and the device supports custom modes as well as device, Host, and OTG. Some versions have 4 uarts in addition to the USB 2.0 controller if you wanted to do USB --> Serial. -Bari From c-d.hailfinger.devel.2006 at gmx.net Tue Jul 8 17:14:50 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Tue, 08 Jul 2008 17:14:50 +0200 Subject: [coreboot] v3 activity: all-time low Message-ID: <4873846A.2090601@gmx.net> Hi, the statistics below are either a sign of v3 being completed or a sign of v3 being a neglected target. I find both of these scenarios rather frightening. What follows is the number of commits per month since the initial checkin. 1 2008-07 4 2008-06 15 2008-05 25 2008-04 21 2008-03 56 2008-02 28 2008-01 9 2007-12 24 2007-11 7 2007-10 16 2007-09 22 2007-08 38 2007-07 88 2007-06 42 2007-05 25 2007-04 110 2007-03 95 2007-02 12 2007-01 5 2006-12 18 2006-11 31 2006-10 Last month we reached an all-time low and it doesn't really look better for this month. I'll gladly review v3 patches if that helps. If anyone has pending v3 patches, please send them in. Regards, Carl-Daniel From rminnich at gmail.com Tue Jul 8 17:18:49 2008 From: rminnich at gmail.com (ron minnich) Date: Tue, 8 Jul 2008 08:18:49 -0700 Subject: [coreboot] [PATCH] v3: Move default mainboard vendor/subsystem from Kconfig to dts In-Reply-To: <4873391F.4020706@gmx.net> References: <13426df10802281040n4afcdce1p1af052b71ce556f1@mail.gmail.com> <47CF28F1.3060605@gmx.net> <13426df10803051527v56be68e2tabfb37141a026ab4@mail.gmail.com> <47CF38D5.3040608@gmx.net> <13426df10803051700j590288b4s12c0796d033eae2e@mail.gmail.com> <47D08726.7010009@gmx.net> <13426df10803061632j4878fe2dlebe335f3822957ab@mail.gmail.com> <47D091F7.9060109@gmx.net> <486F86B1.1080805@gmx.net> <4873391F.4020706@gmx.net> Message-ID: <13426df10807080818l32334f4dq46172d99b2cc1231@mail.gmail.com> there's something about the patches you post that leaves me with a gmail blob that patch can not use. If you send me an attachment I will apply and test. thanks ron From rminnich at gmail.com Tue Jul 8 17:21:21 2008 From: rminnich at gmail.com (ron minnich) Date: Tue, 8 Jul 2008 08:21:21 -0700 Subject: [coreboot] v3 activity: all-time low In-Reply-To: <4873846A.2090601@gmx.net> References: <4873846A.2090601@gmx.net> Message-ID: <13426df10807080821g5e8961bbo71e4c8abd6e38a99@mail.gmail.com> I would be willing to bet that a lot of that patch activity was me, and I've been pulled away to other things. We need more people involved. It is true that the path of least resistance is v2 -- it's here and it works. But we need people to take the hard path and get on v3. I can tell you, that once you get going on it, you won't want to go back. v3 is really nice. I guess v2 works too well :-) ron From jordan.crouse at amd.com Tue Jul 8 17:44:13 2008 From: jordan.crouse at amd.com (Jordan Crouse) Date: Tue, 8 Jul 2008 09:44:13 -0600 Subject: [coreboot] v3 activity: all-time low In-Reply-To: <13426df10807080821g5e8961bbo71e4c8abd6e38a99@mail.gmail.com> References: <4873846A.2090601@gmx.net> <13426df10807080821g5e8961bbo71e4c8abd6e38a99@mail.gmail.com> Message-ID: <20080708154413.GA28965@cosmic.amd.com> On 08/07/08 08:21 -0700, ron minnich wrote: > I would be willing to bet that a lot of that patch activity was me, > and I've been pulled away to other things. We need more people > involved. It is true that the path of least resistance is v2 -- it's > here and it works. But we need people to take the hard path and get on > v3. I can tell you, that once you get going on it, you won't want to > go back. v3 is really nice. > > I guess v2 works too well :-) Here's the problem. Based on the number of email and IRC requests, it is clear that RS690/SB600 code is in great demand. And right behind that we hear clamoring for RS780/SB700 and Barcelona B3. We currently have two choices - we can go for V3, which would give us big style points but our fans will probably be disappointed while we spend the time to iron out the wrinkles. Or we can go for V2 and run the risk of continuing to prop up the legacy code. Our hope is that eventually v3 will catch up with us, and we can seamlessly switch to v3 for some future chipset or processor. Unfortunately, we don't have the resources to do both, and you will forgive us if we go the path of least resistance for our customers. I think that most every other commercial vendor in this project faces the same dilemma. The solution is to recruit a new generation of developers who are willing to take the time and effort of moving our primary processors and chipsets to v3 and stabilizing it to the point where the customers can reliably move. This has already happened for the most part for the Geode LX with positive results. Once we solve the few remaining warts, then there would be no reason to use V2 for LX. Speaking strictly for myself, I do think that v3 is the way to go, and we look forward to when we can recommend it to our customers. But we just can't justify the extra time and effort at this point, and judging from the emails asking for SB600 code, neither can you. Jordan PS: And I apologize personally for doing more to damage v3 and LAR then any other three developers - I mean well, I promise! :) -- Jordan Crouse Systems Software Development Engineer Advanced Micro Devices, Inc. From c-d.hailfinger.devel.2006 at gmx.net Tue Jul 8 18:04:17 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Tue, 08 Jul 2008 18:04:17 +0200 Subject: [coreboot] v3 activity: all-time low In-Reply-To: <13426df10807080821g5e8961bbo71e4c8abd6e38a99@mail.gmail.com> References: <4873846A.2090601@gmx.net> <13426df10807080821g5e8961bbo71e4c8abd6e38a99@mail.gmail.com> Message-ID: <48739001.4080507@gmx.net> On 08.07.2008 17:21, ron minnich wrote: > I would be willing to bet that a lot of that patch activity was me, > Yes, roughly 28% of the number of commits are yours. I haven't counted number of lines yet. > and I've been pulled away to other things. Can we help you avoid these distractions? ;-) Non-coreboot things are overrated :-P > We need more people involved. Absolutely. I have been invited to talk about coreboot at my local LUG and hope this will give some additional exposure. Apart from that, the OpenExpo booth at the end of September should work nicely as well. > It is true that the path of least resistance is v2 -- it's > here and it works. But we need people to take the hard path and get on > v3. I can tell you, that once you get going on it, you won't want to > go back. v3 is really nice. > Same here. I have barely touched v2 in the last year. > I guess v2 works too well :-) > And there are perceived issues about v3 (X lockup, IRQ routing) where I personally don't know if they are still there because I gave my alix1c tp Peter and he installed it at a zoo where it plays frog sounds... Regards, Carl-Daniel -- http://www.hailfinger.org/ From svn at coreboot.org Tue Jul 8 18:18:38 2008 From: svn at coreboot.org (svn at coreboot.org) Date: Tue, 8 Jul 2008 18:18:38 +0200 Subject: [coreboot] r3419 - trunk/payloads/coreinfo Message-ID: <mailman.1694.1355071342.16123.coreboot@coreboot.org> Author: uwe Date: 2008-07-08 18:18:38 +0200 (Tue, 08 Jul 2008) New Revision: 3419 Added: trunk/payloads/coreinfo/ramdump_module.c Modified: trunk/payloads/coreinfo/Kconfig trunk/payloads/coreinfo/Makefile trunk/payloads/coreinfo/coreinfo.c Log: Add a coreinfo module which can hexdump arbitrary RAM regions and allows you to scroll through the RAM contents. Signed-off-by: Uwe Hermann <uwe at hermann-uwe.de> Acked-by: Peter Stuge <peter at stuge.se> Modified: trunk/payloads/coreinfo/Kconfig =================================================================== --- trunk/payloads/coreinfo/Kconfig 2008-07-07 06:38:51 UTC (rev 3418) +++ trunk/payloads/coreinfo/Kconfig 2008-07-08 16:18:38 UTC (rev 3419) @@ -68,6 +68,10 @@ bool "Enable the coreboot bootlog module" default y +config MODULE_RAMDUMP + bool "Enable the RAM dump module" + default y + config MODULE_LAR bool "Enable the coreboot LAR module" default y Modified: trunk/payloads/coreinfo/Makefile =================================================================== --- trunk/payloads/coreinfo/Makefile 2008-07-07 06:38:51 UTC (rev 3418) +++ trunk/payloads/coreinfo/Makefile 2008-07-08 16:18:38 UTC (rev 3419) @@ -51,7 +51,8 @@ INCLUDES = -Ibuild CFLAGS := -Wall -Werror -Os $(INCLUDES) OBJECTS = cpuinfo_module.o cpuid.S.o pci_module.o coreboot_module.o \ - nvram_module.o bootlog_module.o lar_module.o coreinfo.o + nvram_module.o bootlog_module.o ramdump_module.o lar_module.o \ + coreinfo.o OBJS = $(patsubst %,$(obj)/%,$(OBJECTS)) TARGET = $(obj)/coreinfo.elf Modified: trunk/payloads/coreinfo/coreinfo.c =================================================================== --- trunk/payloads/coreinfo/coreinfo.c 2008-07-07 06:38:51 UTC (rev 3418) +++ trunk/payloads/coreinfo/coreinfo.c 2008-07-08 16:18:38 UTC (rev 3419) @@ -29,6 +29,7 @@ extern struct coreinfo_module coreboot_module; extern struct coreinfo_module nvram_module; extern struct coreinfo_module bootlog_module; +extern struct coreinfo_module ramdump_module; extern struct coreinfo_module lar_module; struct coreinfo_module *system_modules[] = { @@ -41,6 +42,9 @@ #ifdef CONFIG_MODULE_NVRAM &nvram_module, #endif +#ifdef CONFIG_MODULE_RAMDUMP + &ramdump_module, +#endif }; struct coreinfo_module *coreboot_modules[] = { Added: trunk/payloads/coreinfo/ramdump_module.c =================================================================== --- trunk/payloads/coreinfo/ramdump_module.c (rev 0) +++ trunk/payloads/coreinfo/ramdump_module.c 2008-07-08 16:18:38 UTC (rev 3419) @@ -0,0 +1,112 @@ +/* + * This file is part of the coreinfo project. + * + * Copyright (C) 2008 Uwe Hermann <uwe at hermann-uwe.de> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "coreinfo.h" + +#ifdef CONFIG_MODULE_RAMDUMP + +static s64 cursor = 0; +static s64 cursor_max = (1 * 1024 * 1024 * 1024); /* Max. 1 GB RAM for now. */ + +static int ramdump_module_init(void) +{ + return 0; +} + +static void dump_ram(WINDOW *win, uint32_t addr, int row, int col) +{ + int i, x = 0, y = 0, count = 0; + volatile uint8_t *ptr = (void *)(addr); + + mvwprintw(win, 0, col + 54, "RAM address: %10d", addr); + + /* Dump 256 bytes of RAM. */ + for (i = 1; i < 257; i++) { + if (x == 0) { + mvwprintw(win, row + y, col - 1, "%08x", addr + 16 * y); + mvwaddch(win, row + y, col + 59, (const chtype)"|"); + mvwaddch(win, row + y, col + 76, (const chtype)"|"); + } + mvwprintw(win, row + y, col + x + 9, "%02x", ptr[i - 1]); + mvwprintw(win, row + y, 62 + count++, "%c", ptr[i - 1]); + x += 3; + if (x == 24) /* One more space after column/byte 8. */ + x++; + if (i % 16 == 0) { + y++; /* Start a newline after 16 bytes. */ + x = count = 0; + } + } +} + +static int ramdump_module_redraw(WINDOW *win) +{ + print_module_title(win, "RAM Dump"); + dump_ram(win, cursor * 256, 2, 2); + + return 0; +} + +static int ramdump_module_handle(int key) +{ + switch (key) { + case KEY_DOWN: + if (cursor == cursor_max) + return 0; + cursor++; + break; + case KEY_UP: + if (cursor == 0) + return 0; + cursor--; + break; + case KEY_NPAGE: + if (cursor == cursor_max) + return 0; + cursor += 4096; /* Jump in 1MB steps. */ + break; + case KEY_PPAGE: + if (cursor == 0) + return 0; + cursor -= 4096; /* Jump in 1MB steps. */ + break; + } + + if (cursor > cursor_max) + cursor = cursor_max; + + if (cursor < 0) + cursor = 0; + + return 1; +} + +struct coreinfo_module ramdump_module = { + .name = "RAM Dump", + .init = ramdump_module_init, + .redraw = ramdump_module_redraw, + .handle = ramdump_module_handle, +}; + +#else + +struct coreinfo_module ramdump_module = { +}; + +#endif From uwe at hermann-uwe.de Tue Jul 8 18:22:14 2008 From: uwe at hermann-uwe.de (Uwe Hermann) Date: Tue, 8 Jul 2008 18:22:14 +0200 Subject: [coreboot] [PATCH] coreinfo: Add RAM Dump module In-Reply-To: <20080707172951.14756.qmail@stuge.se> References: <20080707172425.GA22136@greenwood> <20080707172951.14756.qmail@stuge.se> Message-ID: <20080708162214.GA25458@greenwood> On Mon, Jul 07, 2008 at 07:29:51PM +0200, Peter Stuge wrote: > > Add a coreinfo module which can hexdump arbitrary RAM regions and > > allows you to scroll through the RAM contents. > > > > Signed-off-by: Uwe Hermann <uwe at hermann-uwe.de> > > Acked-by: Peter Stuge <peter at stuge.se> Thanks, r3419. For reference, here's a screenshot from QEMU: http://www.coreboot.org/Image:Coreinfo_ramdump.jpg Uwe. -- http://www.hermann-uwe.de | http://www.holsham-traders.de http://www.crazy-hacks.org | http://www.unmaintained-free-software.org From bari at onelabs.com Tue Jul 8 18:25:42 2008 From: bari at onelabs.com (bari) Date: Tue, 08 Jul 2008 11:25:42 -0500 Subject: [coreboot] v3 activity: all-time low In-Reply-To: <4873846A.2090601@gmx.net> References: <4873846A.2090601@gmx.net> Message-ID: <48739506.1000708@onelabs.com> Carl-Daniel Hailfinger wrote: > Hi, > > the statistics below are either a sign of v3 being completed or a sign > of v3 being a neglected target. > > Last month we reached an all-time low and it doesn't really look better > for this month. > > I'll gladly review v3 patches if that helps. If anyone has pending v3 > patches, please send them in. > > Can someone familiar with V3 please spend maybe just a couple of hours writing up a V2 --> V3 porting guide? This may help someone interested in taking some working V2 chipsets into V3. -Bari From c-d.hailfinger.devel.2006 at gmx.net Tue Jul 8 18:27:04 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Tue, 08 Jul 2008 18:27:04 +0200 Subject: [coreboot] v3 activity: all-time low In-Reply-To: <20080708154413.GA28965@cosmic.amd.com> References: <4873846A.2090601@gmx.net> <13426df10807080821g5e8961bbo71e4c8abd6e38a99@mail.gmail.com> <20080708154413.GA28965@cosmic.amd.com> Message-ID: <48739558.7010109@gmx.net> On 08.07.2008 17:44, Jordan Crouse wrote: > On 08/07/08 08:21 -0700, ron minnich wrote: > >> I would be willing to bet that a lot of that patch activity was me, >> and I've been pulled away to other things. We need more people >> involved. It is true that the path of least resistance is v2 -- it's >> here and it works. But we need people to take the hard path and get on >> v3. I can tell you, that once you get going on it, you won't want to >> go back. v3 is really nice. >> >> I guess v2 works too well :-) >> > > Here's the problem. Based on the number of email and IRC requests, > it is clear that RS690/SB600 code is in great demand. And right > behind that we hear clamoring for RS780/SB700 and Barcelona B3. > We currently have two choices - we can go for V3, which would give > us big style points but our fans will probably be disappointed while > we spend the time to iron out the wrinkles. Or we can go for V2 and > run the risk of continuing to prop up the legacy code. Our hope is > that eventually v3 will catch up with us, and we can seamlessly switch > to v3 for some future chipset or processor. > > Unfortunately, we don't have the resources to do both, and you will forgive > us if we go the path of least resistance for our customers. I think that > most every other commercial vendor in this project faces the same > dilemma. And I am immensely thankful that AMD is creating support for new chipsets. More supported chipsets mean more users which means more developers (to some extent). This indirectly benefits v3, so a big "thank you" from me. > The solution is to recruit a new generation of developers who > are willing to take the time and effort of moving our primary processors > and chipsets to v3 and stabilizing it to the point where the customers > can reliably move. This has already happened for the most part for > the Geode LX with positive results. Once we solve the few remaining warts, > then there would be no reason to use V2 for LX. > Fully agreed. > Speaking strictly for myself, I do think that v3 is the way to go, and we > look forward to when we can recommend it to our customers. But we just > can't justify the extra time and effort at this point, and judging from > the emails asking for SB600 code, neither can you. > I'm happy with the priorities you outline and hope we'll reach the "customer recommendable" milestone soon. > PS: And I apologize personally for doing more to damage v3 and LAR then > any other three developers - I mean well, I promise! :) > Stirring things up is a great way to get people thinking about the grand scheme of things. You invested a lot of time analyzing LAR and the SELF proposal was a great way to advance our understanding of it. Although no commits resulted from it, I see your actions as very beneficial, not damaging. I hope to prepare a proposal incorporating your SELF design together with a slightly modified LAR design in the next few weeks. Regards, Carl-Daniel -- http://www.hailfinger.org/ From c-d.hailfinger.devel.2006 at gmx.net Tue Jul 8 18:37:34 2008 From: c-d.hailfinger.devel.2006 at gmx.net (Carl-Daniel Hailfinger) Date: Tue, 08 Jul 2008 18:37:34 +0200 Subject: [coreboot] v3 activity: all-time low In-Reply-To: <48739506.1000708@onelabs.com> References: <4873846A.2090601@gmx.net> <48739506.1000708@onelabs.com> Message-ID: <487397CE.2010906@gmx.net> On 08.07.2008 18:25, bari wrote: > Carl-Daniel Hailfinger wrote: > >> Hi, >> >> the statistics below are either a sign of v3 being completed or a sign >> of v3 being a neglected target. >> >> Last month we reached an all-time low and it doesn't really look better >> for this month. >> >> I'll gladly review v3 patches if that helps. If anyone has pending v3 >> patches, please send them in. >> >> >> > Can someone famil