Re: newbus ioport usage

From: Nate Lawson (nate_at_root.org)
Date: 01/27/04

  • Next message: M. Warner Losh: "Re: newbus ioport usage"
    Date: Mon, 26 Jan 2004 17:03:58 -0800 (PST)
    To: "M. Warner Losh" <imp@bsdimp.com>
    
    

    On Mon, 26 Jan 2004, M. Warner Losh wrote:
    > In message: <20040126140100.T29680@root.org>
    > Nate Lawson <nate@root.org> writes:
    > : I have a driver that knows the IO port it wants. It's not set up by a
    > : parent bus, so I can't use bus_set_resource(). This call returns NULL.
    > : Any idea how to debug why newbus is rejecting this request? The io port
    > : is not in use and the rid is unique.
    > :
    > : bus_alloc_resource(dev, SYS_RES_IOPORT, rid, 0x101c, 0x101c, 1,
    > : RF_ACTIVE);
    >
    > Ummm, you can use bus_set_resource() in the driver to do this (I've
    > done it before). bus_set_resource() should return 0 to indicate
    > success. bus_alloc_resource should then succeed. There may be one
    > other step to do as well to make this work, but I'm not sure if it is
    > an internal convention or actually required. The pci bus code does a
    > resource_list_add for each of the resources the child uses, but I
    > think that's an internal thing to the pci bus (that other busses do
    > also).

    Ok, I'm doing the set/alloc and it works. However, one weird thing. If I
    allocate all ports at boot time, it succeeds. My driver goes through
    multiple release/allocate cycles and it all works as expected. However if
    I boot and attach to only one of the registers, subsequent attempts to
    attach the second one fail. The resources are 2 IO ports, 0x101c and
    0x101d. Both are 1 byte.

    -Nate
    _______________________________________________
    freebsd-arch@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-arch
    To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"


  • Next message: M. Warner Losh: "Re: newbus ioport usage"

    Relevant Pages

    • Re: Seagate Barracuda 160 GB IDE becomes corrupted. RMA?
      ... Operating System Microsoft Windows 2000 Professional ... System Memory 512 MB ... Communication Port Communications Port ... Driver Download http://www.viaarena.com/?PageID=2 ...
      (comp.sys.ibm.pc.hardware.storage)
    • soft lockup disease (2.6.14-rc1, x86_64)
      ... IA-32 Microcode Update Driver: v1 ... IO window: 1000-1fff] L ... ACPI: PM-Timer IO Port: 0x408 ACPI: Local APIC address 0xfee00000 ...
      (Linux-Kernel)
    • [PATCH]PCI Express Port Bus Driver
      ... A PCI Express Port is a logical PCI-PCI Bridge structure. ... physical device to be handled by only a single driver. ... service drivers will compete for a single PCI-PCI Bridge device. ...
      (Linux-Kernel)
    • Need pci=assign-busses for Acer Aspire 9410
      ... Using APIC driver default ... ACPI: Local APIC address 0xfee00000 ... SELinux: Initializing. ... cs: IO port probe 0x6000-0x6fff: clean. ...
      (Linux-Kernel)
    • 2.6.19-rc2 - Cable detection problem in pata_amd
      ... the pata_amd driver mis-detects the cable connected to the ... 2nd port on my system as 40 wire and sets UDMA/33 for this drive. ... I've tried switching the cables around to see if it truly was a cable ... Linux Plug and Play Support v0.97 Adam Belay ...
      (Linux-Kernel)