From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from n28.bullet.mail.mud.yahoo.com (n28.bullet.mail.mud.yahoo.com [68.142.206.223]) by ozlabs.org (Postfix) with SMTP id 043A2DDE20 for ; Fri, 19 Sep 2008 08:15:01 +1000 (EST) Date: Thu, 18 Sep 2008 15:08:45 -0700 (PDT) From: Abg Abg Subject: Network driver on ppc 405EX To: linuxppc-embedded@ozlabs.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-946499256-1221775725=:22518" Message-ID: <371343.22518.qm@web59716.mail.ac4.yahoo.com> List-Id: Linux on Embedded PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , --0-946499256-1221775725=:22518 Content-Type: text/plain; charset=us-ascii Hi, Hope this is the correct list for driver related queries for ppc boards I was porting a network driver for a ppc 405EX based embedded system (kilauea config). The module builds fine and loads and I see the probe routine get called correctly. However when I try remapping the BAR0 address from the PCI config space, the ioremap fails. A little debugging showed that the address passed to ioremap was zero. I pass the address to the ioremap via pci_resource_start(pdev, 0) where pdev is a type struct pci_dev *. I dumped the contents of the pdev and saw that the vendor-id, device id etc were correct, however the BAR0 address seemed to be all zeroes. The question that I had was 1. Is there any kernel config that needs to be done for PCI devices to be able to remap the BAR0 addresses. 2. Any other kernel parameter that needs to be tweaked? Thanks, Abg --0-946499256-1221775725=:22518 Content-Type: text/html; charset=us-ascii
Hi,
  Hope this is the correct list for driver related queries for ppc boards

I was porting a network driver for a ppc 405EX based embedded system (kilauea config).
The module builds fine and loads and I see the probe routine get called correctly.
However when I try remapping the BAR0 address from the PCI config space, the ioremap fails.
A little debugging showed that the address passed to ioremap was zero.
I pass the address to the ioremap via pci_resource_start(pdev, 0) where pdev is a type struct pci_dev *.

I dumped the contents of the pdev and saw that the vendor-id, device id etc were correct, however the BAR0 address seemed to be all zeroes.

The question that I had was
1. Is there any kernel config that needs to be done for PCI devices to be able to remap the BAR0 addresses.
2. Any other kernel parameter that needs to be tweaked?

Thanks,
Abg




--0-946499256-1221775725=:22518-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nausicaa2.coritel.it (host254-130-static.190-82-b.business.telecomitalia.it [82.190.130.254]) by ozlabs.org (Postfix) with ESMTP id E7DE6DDE1B for ; Fri, 19 Sep 2008 17:04:00 +1000 (EST) Message-ID: <48D34F3D.6000302@coritel.it> Date: Fri, 19 Sep 2008 09:05:33 +0200 From: Marco Stornelli MIME-Version: 1.0 To: Abg Abg Subject: Re: Network driver on ppc 405EX References: <371343.22518.qm@web59716.mail.ac4.yahoo.com> In-Reply-To: <371343.22518.qm@web59716.mail.ac4.yahoo.com> Content-Type: text/plain; charset=ISO-8859-15 Cc: linuxppc-embedded@ozlabs.org List-Id: Linux on Embedded PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Have you already enabled the device? You can enable it with pci_enable_device. Then you can call the pci_request_region and then the ioremap. In addition, you can check the pci configuration with the command lspci. You can found an example on Linux Device Drivers. Regards. Abg Abg ha scritto: > Hi, > Hope this is the correct list for driver related queries for ppc boards > > I was porting a network driver for a ppc 405EX based embedded system (kilauea config). > The module builds fine and loads and I see the probe routine get called correctly. > However when I try remapping the BAR0 address from the PCI config space, the ioremap fails. > A little debugging showed that the address passed to ioremap was zero. > I pass the address to the ioremap via pci_resource_start(pdev, 0) where pdev is a type struct pci_dev *. > > I dumped the contents of the pdev and saw that the vendor-id, device id etc were correct, however the BAR0 address seemed to be all zeroes. > > The question that I had was > 1. Is there any kernel config that needs to be done for PCI devices to be able to remap the BAR0 addresses. > 2. Any other kernel parameter that needs to be tweaked? > > Thanks, > Abg > > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Linuxppc-embedded mailing list > Linuxppc-embedded@ozlabs.org > https://ozlabs.org/mailman/listinfo/linuxppc-embedded -- Marco Stornelli Embedded Software Engineer CoRiTeL - Consorzio di Ricerca sulle Telecomunicazioni http://www.coritel.it marco.stornelli@coritel.it +39 06 72582838 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from n20.bullet.mail.mud.yahoo.com (n20.bullet.mail.mud.yahoo.com [68.142.206.147]) by ozlabs.org (Postfix) with SMTP id 9FB3BDE11A for ; Sat, 20 Sep 2008 02:43:06 +1000 (EST) Date: Fri, 19 Sep 2008 09:43:04 -0700 (PDT) From: Abg Abg Subject: Re: Network driver on ppc 405EX To: Marco Stornelli MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1621726146-1221842584=:99067" Message-ID: <557947.99067.qm@web59707.mail.ac4.yahoo.com> Cc: linuxppc-embedded@ozlabs.org List-Id: Linux on Embedded PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , --0-1621726146-1221842584=:99067 Content-Type: text/plain; charset=us-ascii The device is enabled via pci_enable_device. pci_request_region also succeeds. pci_resource_start(pdev, 0) is what is returning zero. The same driver works on boards with different ppc processor (440SPe). Thanks Abg ----- Original Message ---- From: Marco Stornelli To: Abg Abg Cc: linuxppc-embedded@ozlabs.org Sent: Friday, September 19, 2008 12:35:33 PM Subject: Re: Network driver on ppc 405EX Have you already enabled the device? You can enable it with pci_enable_device. Then you can call the pci_request_region and then the ioremap. In addition, you can check the pci configuration with the command lspci. You can found an example on Linux Device Drivers. Regards. Abg Abg ha scritto: > Hi, > Hope this is the correct list for driver related queries for ppc boards > > I was porting a network driver for a ppc 405EX based embedded system (kilauea config). > The module builds fine and loads and I see the probe routine get called correctly. > However when I try remapping the BAR0 address from the PCI config space, the ioremap fails. > A little debugging showed that the address passed to ioremap was zero. > I pass the address to the ioremap via pci_resource_start(pdev, 0) where pdev is a type struct pci_dev *. > > I dumped the contents of the pdev and saw that the vendor-id, device id etc were correct, however the BAR0 address seemed to be all zeroes. > > The question that I had was > 1. Is there any kernel config that needs to be done for PCI devices to be able to remap the BAR0 addresses. > 2. Any other kernel parameter that needs to be tweaked? > > Thanks, > Abg > > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Linuxppc-embedded mailing list > Linuxppc-embedded@ozlabs.org > https://ozlabs.org/mailman/listinfo/linuxppc-embedded -- Marco Stornelli Embedded Software Engineer CoRiTeL - Consorzio di Ricerca sulle Telecomunicazioni http://www.coritel.it marco.stornelli@coritel.it +39 06 72582838 --0-1621726146-1221842584=:99067 Content-Type: text/html; charset=us-ascii
The device is enabled via pci_enable_device. pci_request_region also succeeds.
pci_resource_start(pdev, 0) is what is returning zero.

The same driver works on boards with different ppc processor (440SPe).

Thanks
Abg

----- Original Message ----
From: Marco Stornelli <marco.stornelli@coritel.it>
To: Abg Abg <abg.mur22@yahoo.com>
Cc: linuxppc-embedded@ozlabs.org
Sent: Friday, September 19, 2008 12:35:33 PM
Subject: Re: Network driver on ppc 405EX

Have you already enabled the device? You can enable it with
pci_enable_device. Then you can call the pci_request_region and then the
ioremap. In addition, you can check the pci configuration with the
command lspci. You can found an example on Linux Device Drivers.

Regards.

Abg Abg ha scritto:
> Hi,
>  Hope this is the correct list for driver related queries for ppc boards
>
> I was porting a network driver for a ppc 405EX based embedded system (kilauea config).
> The module builds fine and loads and I see the probe routine get called correctly.
> However when I try remapping the BAR0 address from the PCI config space, the ioremap fails.
> A little debugging showed that the address passed to ioremap was zero.
> I pass the address to the ioremap via pci_resource_start(pdev, 0) where pdev is a type struct pci_dev *.
>
> I dumped the contents of the pdev and saw that the vendor-id, device id etc were correct, however the BAR0 address seemed to be all zeroes.
>
> The question that I had was
> 1. Is there any kernel config that needs to be done for PCI devices to be able to remap the BAR0 addresses.
> 2. Any other kernel parameter that needs to be tweaked?
>
> Thanks,
> Abg
>
>
>     
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded

--
Marco Stornelli
Embedded Software Engineer
CoRiTeL - Consorzio di Ricerca sulle Telecomunicazioni
http://www.coritel.it

marco.stornelli@coritel.it
+39 06 72582838

--0-1621726146-1221842584=:99067--