Examples of PCIHeaderType0


Examples of org.jnode.driver.bus.pci.PCIHeaderType0

     *
     * @param device
     * @param flags
     */
    protected int getIOLength(Device device, EEPRO100Flags flags) throws DriverException {
        final PCIHeaderType0 config = ((PCIDevice) device).getConfig().asHeaderType0();
        final PCIBaseAddress[] addrs = config.getBaseAddresses();
        if (addrs.length < 1) {
            throw new DriverException("Cannot find iobase: not base addresses");
        }
        if (!addrs[1].isIOSpace()) {
            throw new DriverException("Cannot find iobase: first address is not I/O");
View Full Code Here

Examples of org.jnode.driver.bus.pci.PCIHeaderType0

     *
     * @param device
     * @param flags
     */
    protected int getIRQ(Device device, EEPRO100Flags flags) throws DriverException {
        final PCIHeaderType0 config = ((PCIDevice) device).getConfig().asHeaderType0();
        return config.getInterruptLine();
    }
View Full Code Here

Examples of org.jnode.driver.bus.pci.PCIHeaderType0

    public LanceCore(LanceDriver driver, ResourceOwner owner, PCIDevice device, Flags flags)
        throws ResourceNotFreeException, DriverException {
        this.driver = driver;
        this.flags = (LanceFlags) flags;

        final PCIHeaderType0 config = device.getConfig().asHeaderType0();
        final int irq = config.getInterruptLine();

        final PCIBaseAddress[] addrs = config.getBaseAddresses();
        if (addrs.length < 1) {
            throw new DriverException("Cannot find iobase: not base addresses");
        }
        if (!addrs[0].isIOSpace()) {
            throw new DriverException("Cannot find iobase: first address is not I/O");
        }

        // Get the start of the IO address space
        iobase = addrs[0].getIOBase();
        final int iolength = addrs[0].getSize();
        log.debug("Found Lance IOBase: 0x" + NumberUtils.hex(iobase) + ", length: " + iolength);
        ResourceManager rm;
        try {
            rm = InitialNaming.lookup(ResourceManager.NAME);
        } catch (NameNotFoundException ex) {
            throw new DriverException("Cannot find ResourceManager");
        }
        this.irq = rm.claimIRQ(owner, irq, this, true);
        try {
            ioResource = claimPorts(rm, owner, iobase, iolength);
        } catch (ResourceNotFreeException ex) {
            this.irq.release();
            throw ex;
        }

        // Determine the type of IO access (Word or DWord)
        io = getIOAccess();
        log.debug("IO Access set to " + io.getType());

        // Set the flags based on the version of the device found
        setFlags();

        // Load the hw address
        this.hwAddress = loadHWAddress();

        log.info("Found " + this.flags.getChipName() + " at 0x" + NumberUtils.hex(iobase, 4) +
                " with MAC Address " + hwAddress);

        // Create rx & tx descriptor rings, initdata and databuffers
        this.bufferManager =
                new BufferManager(RX_DESCRIPTOR_LENGTH, TX_DESCRIPTOR_LENGTH,
                        CSR15_DRX | CSR15_DTX, hwAddress, 0, rm, owner);

        // Enable device to become a bus master on the PCI bus.
        config.setCommand(config.getCommand() | PCIConstants.PCI_COMMAND_MASTER);
    }
View Full Code Here

Examples of org.jnode.driver.bus.pci.PCIHeaderType0

     *
     * @param device
     * @param flags
     */
    protected final int getIOBase(Device device, _3c90xFlags flags) throws DriverException {
        final PCIHeaderType0 config = ((PCIDevice) device).getConfig().asHeaderType0();
        final PCIBaseAddress[] addrs = config.getBaseAddresses();
        if (addrs.length < 1) {
            throw new DriverException("Cannot find iobase: not base addresses");
        }
        if (!addrs[0].isIOSpace()) {
            throw new DriverException("Cannot find iobase: first address is not I/O");
View Full Code Here

Examples of org.jnode.driver.bus.pci.PCIHeaderType0

     *
     * @param device
     * @param flags
     */
    protected int getIOLength(Device device, _3c90xFlags flags) throws DriverException {
        final PCIHeaderType0 config = ((PCIDevice) device).getConfig().asHeaderType0();
        final PCIBaseAddress[] addrs = config.getBaseAddresses();
        if (addrs.length < 1) {
            throw new DriverException("Cannot find iobase: not base addresses");
        }
        if (!addrs[0].isIOSpace()) {
            throw new DriverException("Cannot find iobase: first address is not I/O");
View Full Code Here

Examples of org.jnode.driver.bus.pci.PCIHeaderType0

     *
     * @param device
     * @param flags
     */
    protected int getIRQ(Device device, _3c90xFlags flags) throws DriverException {
        final PCIHeaderType0 config = ((PCIDevice) device).getConfig().asHeaderType0();
        return config.getInterruptLine();
    }
View Full Code Here

Examples of org.jnode.driver.bus.pci.PCIHeaderType0

     * @param device
     * @param flags
     */

    protected int getIOBase(Device device, RTL8139Flags flags) throws DriverException {
        final PCIHeaderType0 config = ((PCIDevice) device).getConfig().asHeaderType0();
        final PCIBaseAddress[] addrs = config.getBaseAddresses();

        if (addrs.length < 1) {
            throw new DriverException("Cannot find iobase: not base addresses");
        }
        if (!addrs[0].isIOSpace()) {
View Full Code Here

Examples of org.jnode.driver.bus.pci.PCIHeaderType0

     *
     * @param device
     * @param flags
     */
    protected int getIOLength(Device device, RTL8139Flags flags) throws DriverException {
        final PCIHeaderType0 config = ((PCIDevice) device).getConfig().asHeaderType0();
        final PCIBaseAddress[] addrs = config.getBaseAddresses();

        if (addrs.length < 1) {
            throw new DriverException("Cannot find iobase: not base addresses");
        }

View Full Code Here

Examples of org.jnode.driver.bus.pci.PCIHeaderType0

     * @param device
     * @param flags
     */

    protected int getIRQ(Device device, RTL8139Flags flags) throws DriverException {
        final PCIHeaderType0 config = ((PCIDevice) device).getConfig().asHeaderType0();

        return config.getInterruptLine();
    }
View Full Code Here

Examples of org.jnode.driver.bus.pci.PCIHeaderType0

    public RadeonCore(RadeonDriver driver, int architecture, String model, PCIDevice device)
        throws ResourceNotFreeException, DriverException {
        this.driver = driver;
        this.fbinfo = new FBInfo(architecture);

        final PCIHeaderType0 pciCfg = device.getConfig().asHeaderType0();
        final PCIBaseAddress ioAddr = pciCfg.getBaseAddresses()[2];
        final PCIBaseAddress fbAddr = pciCfg.getBaseAddresses()[0];
        final PCIRomAddress romAddr = pciCfg.getRomAddress();
        log.info("Found ATI " + model + ", chipset 0x" + NumberUtils.hex(pciCfg.getRevision()));
        try {
            final ResourceManager rm = InitialNaming.lookup(ResourceManager.NAME);
            final int ioBase = (int) ioAddr.getMemoryBase();
            final int ioSize = ioAddr.getSize();
            final int fbBase = (int) fbAddr.getMemoryBase() /* & 0xFF800000 */;

            // Map Memory Mapped IO
            this.mmio =
                    rm.claimMemoryResource(device, Address.fromIntZeroExtend(ioBase), ioSize,
                            ResourceManager.MEMMODE_NORMAL);
            this.vgaIO = new RadeonVgaIO(mmio);
            final int memSize = readMemorySize();
            log.info("Memory size " + NumberUtils.toBinaryByte(memSize));
            this.accel = new RadeonAcceleration(vgaIO);

            // Map Device RAM
            this.deviceRam =
                    rm.claimMemoryResource(device, Address.fromIntZeroExtend(fbBase), memSize,
                            ResourceManager.MEMMODE_NORMAL);
            vgaIO.setVideoRam(deviceRam);

            // Find ROM
            MemoryResource rom = null;
            if (romAddr != null) {
                romAddr.setEnabled(true);
                if (romAddr.isEnabled()) {
                    rom =
                            rm.claimMemoryResource(device, Address.fromIntZeroExtend(romAddr
                                    .getRomBase()), romAddr.getSize(),
                                    ResourceManager.MEMMODE_NORMAL);
                    if (!verifyBiosSignature(rom)) {
                        log.info("Signature mismatch");
                        rom.release();
                        rom = null;
                    }
                } else {
                    log.debug("Failed to enabled expansion ROM");
                }
            }
            if (rom == null) {
                // Use the ISA regions rom instead
                rom = findRom(device, rm);
            }
            this.rom = rom;

            log.debug("Found ATI " + model + ", FB at 0x" + NumberUtils.hex(fbBase) + "s0x" +
                    NumberUtils.hex(memSize) + ", MMIO at 0x" + NumberUtils.hex(ioBase) + ", ROM " +
                    pciCfg.getRomAddress());

            fbinfo.readMonitorInfo(vgaIO);
            if (this.rom != null) {
                log.info("ROM[0-3] 0x" + NumberUtils.hex(rom.getInt(0)));
                // Read monitor information
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.