[flashrom] [PATCH] Add Suport for Dr.Kaiser PC-Waechter

Uwe Hermann uwe at hermann-uwe.de
Thu Sep 3 01:12:14 CEST 2009


Hi,

On Wed, Sep 02, 2009 at 09:01:01PM +0200, TURBO J wrote:
> this patch adds support for a PCI "flash memory card" named "Dr. Kaiser
> PC-Waechter".

Great, thanks a lot for the patch!

I committed it in r712 with some smaller changes.

 - Small whitespace and coding style fixes.

 - Made PCI_BASE_ADDRESS_2 support a bit more generic, see below.

 - Added programmer to the manpage.


> Unrelated issue: My OpenSUSE 11.2 Beta Box needs
> "make CFLAGS=-fno-strict-aliasing"
> GCC is "gcc version 4.4.1 [gcc-4_4-branch revision 149935] (SUSE Linux)"

Can you post the full build output of your compiler here, so we can fix
the actual issue (so that fno-strict-aliasing is hopefully no longer
needed).

Please also send the output of 'lspci -vvvxxx' for reference, and the
output of a sample write operation of flashrom (flashrom -w foo.bin)
if possible. Thanks!


> +#define PCI_MAGIC_DRKAISER_VALUE 0xA971
[...]
> +	pci_write_word(pcidev_dev,PCI_MAGIC_DRKAISER_ADR, PCI_MAGIC_DRKAISER_VALUE);

Do you know if the magic value above is completely required? Maybe it's
just one of the bits in there that needs to be toggled? Theoretically
this could even be tested using the hardware (toggle one of the bits,
check if writing works; if not, toggle the next bit etc. etc.)
	

> +	// Map 128KB Flash Memory Window
> +	drkaiser_mem=physmap("Dr.Kaiser PC-Waechter FLASH Memory",
> +	pci_read_long(pcidev_dev,PCI_BASE_ADDRESS_2), 128*1024); 

Are you sure 128 KB is the maximum supported size here? The chip on your
board is 128KB, but maybe if bigger chips were soldered on instead they
would still work (depends on the FPGA, hardware wiring etc, I guess)?


> Index: pcidev.c
> ===================================================================
> --- pcidev.c	(Revision 710)
> +++ pcidev.c	(Arbeitskopie)
> @@ -39,6 +39,9 @@
>  
>  		/* Don't use dev->base_addr[0], won't work on older libpci. */
>  		addr = pci_read_long(dev, PCI_BASE_ADDRESS_0) & ~0x03;
> +		
> +		/* Dr. Kaiser has BASE_ADDRESS_0 = 0x000  */
> +		if (!addr) addr= pci_read_long(dev, PCI_BASE_ADDRESS_2) & ~0x03;

I changed this to be a bit more generic, every programmer now passes the
base address in as a parameter, most PCI_BASE_ADDRESS_0 for now,
drkaiser uses PCI_BASE_ADDRESS_2.


Uwe.
-- 
http://www.hermann-uwe.de  | http://www.holsham-traders.de
http://www.crazy-hacks.org | http://www.unmaintained-free-software.org




More information about the flashrom mailing list