Examples of PCIBaseAddress


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

    public ViaRhineCore(ViaRhineDriver driver, Device device, ResourceOwner owner, Flags flags)
        throws DriverException, ResourceNotFreeException {
        this.driver = driver;
        final int irq_nr = getIRQ(device, flags);
        PCIBaseAddress addr = getIOBaseAddress(device, flags);
        this.ioBase = addr.getIOBase();
        int io_length = addr.getSize();
        final ResourceManager rm;

        try {
            rm = InitialNaming.lookup(ResourceManager.NAME);
        } catch (NameNotFoundException ex) {
View Full Code Here

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

        final PCIBaseAddress[] baseAddrs = pciCfg.getBaseAddresses();
        if (baseAddrs.length < 1) {
            throw new DriverException(
                "No memory mapped I/O region in PCI config");
        }
        final PCIBaseAddress regsAddr = pciCfg.getBaseAddresses()[0];
        if (!regsAddr.isMemorySpace()) {
            throw new DriverException("Memory mapped I/O is not a memory space");
        }

        // Claim the memory mapped I/O region
        final Address regsAddrPtr = Address.fromLong(regsAddr.getMemoryBase());
        final Extent regsSize = Extent.fromIntZeroExtend(regsAddr.getSize());
        try {
            final MemoryResource regs;
            regs = rm.claimMemoryResource(device, regsAddrPtr, regsSize,
                ResourceManager.MEMMODE_NORMAL);
            this.io = new Prism2IO(regs);
View Full Code Here

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

        int cmd = pciCfg.getCommand();
        cmd &= ~PCIConstants.PCI_COMMAND_IO;
        cmd |= PCIConstants.PCI_COMMAND_MEMORY;
        pciCfg.setCommand(cmd);

        final PCIBaseAddress fbAddr = pciCfg.asHeaderType0().getBaseAddresses()[0];

        log.info("Found ATI " + model + ", pci " + pciCfg);

        try {
            final ResourceManager rm = InitialNaming.lookup(ResourceManager.NAME);

            final int fbBase = (int) fbAddr.getMemoryBase() /* & 0xFF800000 */;
            final int memSize = fbAddr.getSize();
            log.info("Memory size " + NumberUtils.toBinaryByte(memSize));

            // Map Device RAM
            this.deviceRam =
                    rm.claimMemoryResource(device, Address.fromIntZeroExtend(fbBase), memSize,
View Full Code Here

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

        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);
View Full Code Here

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

        throws ResourceNotFreeException, DriverException {
        super(640, 480);
        this.driver = driver;
        this.architecture = architecture;
        final PCIHeaderType0 pciCfg = device.getConfig().asHeaderType0();
        final PCIBaseAddress ioAddr = pciCfg.getBaseAddresses()[0];
        final PCIBaseAddress fbAddr = pciCfg.getBaseAddresses()[1];
        log.info("Found NVidia " + model + ", chipset 0x" + NumberUtils.hex(pciCfg.getRevision()));
        try {
            final ResourceManager rm = InitialNaming.lookup(ResourceManager.NAME);
            final int ioBase = (int) ioAddr.getMemoryBase() & 0xFF800000;
            final int ioSize = ioAddr.getSize();
            final int fbBase = (int) fbAddr.getMemoryBase() & 0xFF800000;
            final int fbSize = fbAddr.getSize();

            log.debug("Found NVidia, FB at 0x" + NumberUtils.hex(fbBase) + "s0x" +
                    NumberUtils.hex(fbSize) + ", MMIO at 0x" + NumberUtils.hex(ioBase));

            this.mmio =
View Full Code Here

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

        super(640, 480);
        this.driver = driver;

        final PCIHeaderType0 pciCfg = device.getConfig().asHeaderType0();

        final PCIBaseAddress fbAddr = pciCfg.getBaseAddresses()[0];
        final PCIBaseAddress mmioAddr = pciCfg.getBaseAddresses()[1];

        log.info("Found "
                + model
                + ", chipset 0x"
                + NumberUtils.hex(pciCfg.getRevision())
                + ", device-vendor ID 0x"
                + NumberUtils.hex(pciCfg.getDeviceID() << 16 + pciCfg
                        .getVendorID()));

        try {
            final ResourceManager rm = (ResourceManager) InitialNaming
                    .lookup(ResourceManager.NAME);
            final IOResource ports = claimPorts(rm, device, CIRRUS_FIRST_PORT,
                    CIRRUS_LAST_PORT - CIRRUS_FIRST_PORT);
            final int mmioBase = (int) mmioAddr.getMemoryBase() & 0xFF000000;
            final int mmioSize = mmioAddr.getSize();
            final int fbBase = (int) fbAddr.getMemoryBase() & 0xFF000000;
            final int fbSize = fbAddr.getSize();

            log.info("Found Cirrus, FB at 0x" + NumberUtils.hex(fbBase)
                    + " s0x" + NumberUtils.hex(fbSize) + ", MMIO at 0x"
View Full Code Here

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

     * @param device
     */
    public UHCICore(PCIDevice device) throws DriverException, ResourceNotFreeException {
        this.device = device;
        final PCIDeviceConfig cfg = device.getConfig();
        final PCIBaseAddress baseAddr = getBaseAddress(cfg);
        try {
            this.rm = InitialNaming.lookup(ResourceManager.NAME);
            final int ioBase = baseAddr.getIOBase();
            final int ioSize = baseAddr.getSize();
            log.info("Found UHCI at 0x" + NumberUtils.hex(ioBase));

            this.io = new UHCIIO(claimPorts(rm, device, ioBase, ioSize));
            this.bus = new USBBus(device, this);
            this.rootHub = new UHCIRootHub(io, bus);
View Full Code Here

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

     *         DriverException
     */
    private PCIBaseAddress getBaseAddress(PCIDeviceConfig cfg) throws DriverException {
        final PCIBaseAddress[] addresses = cfg.asHeaderType0().getBaseAddresses();
        for (int i = 0; i < addresses.length; i++) {
            final PCIBaseAddress a = addresses[i];
            if ((a != null) && (a.isIOSpace())) {
                //log.debug("Found address " + i + " (" + a + ")");
                return a;
            }
        }
        throw new DriverException("No IO base address found");
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.