Before cache as ram working, I used fixed size to replace unsigned to make sure romcc can compile my in_coherent.c
Do you have own internal version ROMCC that make use unsigned well....?
YH
-----Original Message----- From: linuxbios-bounces@openbios.org [mailto:linuxbios-bounces@openbios.org] On Behalf Of jason schildt Sent: Friday, September 02, 2005 3:03 PM To: linuxbios@openbios.org Subject: [LinuxBIOS] LNXI Merge: lnxi-patch-11/16
DESCRIPTION: ------------------------------------------------
## lnxi-patch-11 ## src/northbridge/amd/amdk8/incoherent_ht.c Removed K8_HT_FREQ_1G test as we can now compile this with romcc. Bug fix added to ht_optimize_link() To ignore status bits when we read the link freq. Comment added that suggests s/uint8_t/unsigned/g that could save code generated by romcc.
DIFFSTAT: ------------------------------------------------
incoherent_ht.c | 22 ++++++++++++---------- 1 files changed, 12 insertions(+), 10 deletions(-)
PATCH: ------------------------------------------------
Index: northbridge/amd/amdk8/incoherent_ht.c =================================================================== --- northbridge/amd/amdk8/incoherent_ht.c (revision 1105) +++ northbridge/amd/amdk8/incoherent_ht.c (working copy) @@ -1,15 +1,16 @@ /* This should be done by Eric 2004.12 yhlu add multi ht chain dynamically support + */ #include <device/pci_def.h> #include <device/pci_ids.h> #include <device/hypertransport_def.h>
-#ifndef K8_HT_FREQ_1G_SUPPORT - #define K8_HT_FREQ_1G_SUPPORT 0 -#endif - +/* We can reduce the size of code generated by romcc by + * changing all of the fixed size types that live in registers + * into simple unsigned variables. (ie s/uint8_t/unsigned/g) + */ #ifndef K8_SCAN_PCI_BUS #define K8_SCAN_PCI_BUS 0 #endif @@ -130,21 +131,20 @@ /* AMD 8131 Errata 48 */ if (id == (PCI_VENDOR_ID_AMD | (PCI_DEVICE_ID_AMD_8131_PCIX << 16))) { freq_cap &= ~(1 << HT_FREQ_800Mhz); - return freq_cap; }
/* AMD 8151 Errata 23 */ if (id == (PCI_VENDOR_ID_AMD | (PCI_DEVICE_ID_AMD_8151_SYSCTRL << 16))) { freq_cap &= ~(1 << HT_FREQ_800Mhz); - return freq_cap; } /* AMD K8 Unsupported 1Ghz? */ if (id == (PCI_VENDOR_ID_AMD | (0x1100 << 16))) { - #if K8_HT_FREQ_1G_SUPPORT == 1 - if (is_cpu_pre_e0()) // CK804 support 1G? - #endif - freq_cap &= ~(1 << HT_FREQ_1000Mhz); + /* Supported starting with E0 */ + device_t dev_2 = PCI_DEV(0,0x18,2); + if(pci_read_config32(dev_2,0x9c) < 0x20f00) { + freq_cap &= ~(1 << HT_FREQ_1000Mhz); + } }
return freq_cap; @@ -199,8 +199,10 @@
/* See if I am changing the link freqency */ old_freq = pci_read_config8(dev1, pos1 + LINK_FREQ(offs1)); + old_freq &= 0x0f; needs_reset |= old_freq != freq; old_freq = pci_read_config8(dev2, pos2 + LINK_FREQ(offs2)); + old_freq &= 0x0f; needs_reset |= old_freq != freq;
/* Set the Calulcated link frequency */