Author: stepan Date: 2006-06-11 12:59:48 +0200 (Sun, 11 Jun 2006) New Revision: 63
Added: openbios-devel/include/sparc64/pci.h Modified: openbios-devel/config/examples/cross-sparc64_rules.xml openbios-devel/libgcc/build.xml Log: sparc64: fix CFLAGS and add missing pci include
Modified: openbios-devel/config/examples/cross-sparc64_rules.xml =================================================================== --- openbios-devel/config/examples/cross-sparc64_rules.xml 2006-06-11 10:50:31 UTC (rev 62) +++ openbios-devel/config/examples/cross-sparc64_rules.xml 2006-06-11 10:59:48 UTC (rev 63) @@ -20,8 +20,9 @@ NM := sparc64-linux-nm STRIP := sparc64-linux-strip RANLIB := sparc64-linux-ranlib -CFLAGS := -Os -Wall -W -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH -USWAP_ENDIANNESS -fno-builtin -g -CFLAGS+= -Wa,-xarch=v9 -Wa,-64 -m64 -mcpu=ultrasparc -mcmodel=medany +CFLAGS := -Os -Wall -W -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH -USWAP_ENDIANNESS -g +CFLAGS+= -Wa,-xarch=v9 -Wa,-64 -m64 -mcpu=ultrasparc -mcmodel=medany +CFLAGS+= -fno-builtin -nostdlib -ffreestanding CFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations CFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing INCLUDES := -Iinclude -Ikernel/include -I$(ODIR)/target/include
Added: openbios-devel/include/sparc64/pci.h =================================================================== --- openbios-devel/include/sparc64/pci.h (rev 0) +++ openbios-devel/include/sparc64/pci.h 2006-06-11 10:59:48 UTC (rev 63) @@ -0,0 +1,69 @@ +#ifndef SPARC64_PCI_H +#define SPARC64_PCI_H + +#include "asm/io.h" + +#if !(defined(PCI_CONFIG_1) || defined(PCI_CONFIG_2)) +#define PCI_CONFIG_1 1 /* default */ +#endif + +#ifdef PCI_CONFIG_1 + +/* PCI Configuration Mechanism #1 */ + +/* Have pci_addr in the same format as the values written to 0xcf8 + * so register accesses can be made easy. */ +#define PCI_ADDR(bus, dev, fn) \ + ((pci_addr) (0x80000000u \ + | (uint32_t) (bus) << 16 \ + | (uint32_t) (dev) << 11 \ + | (uint32_t) (fn) << 8)) + +#define PCI_BUS(pcidev) ((uint8_t) ((pcidev) >> 16)) +#define PCI_DEV(pcidev) ((uint8_t) ((pcidev) >> 11) & 0x1f) +#define PCI_FN(pcidev) ((uint8_t) ((pcidev) >> 8) & 7) + +#define APB_SPECIAL_BASE 0x1fe00000000ULL +#define PCI_CONFIG (APB_SPECIAL_BASE + 0x2000) + +static inline uint8_t pci_config_read8(pci_addr dev, uint8_t reg) +{ + out_be32((void *)PCI_CONFIG, dev | (reg & ~3)); + return in_8((void *)(PCI_CONFIG | (reg & 3))); +} + +static inline uint16_t pci_config_read16(pci_addr dev, uint8_t reg) +{ + out_be32((void *)PCI_CONFIG, dev | (reg & ~3)); + return in_be16((void *)(PCI_CONFIG | (reg & 2))); +} + +static inline uint32_t pci_config_read32(pci_addr dev, uint8_t reg) +{ + out_be32((void *)PCI_CONFIG, dev | reg); + return in_be32((void *)(PCI_CONFIG | reg)); +} + +static inline void pci_config_write8(pci_addr dev, uint8_t reg, uint8_t val) +{ + out_be32((void *)PCI_CONFIG, dev | (reg & ~3)); + out_8((void *)(PCI_CONFIG | (reg & 3)), val); +} + +static inline void pci_config_write16(pci_addr dev, uint8_t reg, uint16_t val) +{ + out_be32((void *)PCI_CONFIG, dev | (reg & ~3)); + out_be16((void *)(PCI_CONFIG | (reg & 2)), val); +} + +static inline void pci_config_write32(pci_addr dev, uint8_t reg, uint32_t val) +{ + out_be32((void *)PCI_CONFIG, dev | reg); + out_be32((void *)(PCI_CONFIG | reg), val); +} + +#else /* !PCI_CONFIG_1 */ +#error PCI Configuration Mechanism is not specified or implemented +#endif + +#endif /* SPARC64_PCI_H */
Modified: openbios-devel/libgcc/build.xml =================================================================== --- openbios-devel/libgcc/build.xml 2006-06-11 10:50:31 UTC (rev 62) +++ openbios-devel/libgcc/build.xml 2006-06-11 10:59:48 UTC (rev 63) @@ -9,6 +9,8 @@ <object source="__udivdi3.c"/> <object source="__udivmoddi4.c"/> <object source="__umoddi3.c"/> + + <!-- CONDITION="CONFIG_64BITS" --> <object source="__divti3.c"/> <object source="__udivti3.c"/> <object source="__udivmodti4.c"/>