Skip to contentSkip to conversation

Linuxppc-dev Digest, Vol 37, Issue 87

DISCUSSION lakshminarayana babu 1 participant 1 message Sep 14, 2007 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

Is there anyone having sample pci circuit for outputting data and display it in the form of leds.

thank you and regards
babu

Quoted 692 lines · On 9/13/07, [email protected] <[email protected]>…

Send Linuxppc-dev mailing list submissions to
[email protected]

To subscribe or unsubscribe via the World Wide Web, visit
https://ozlabs.org/mailman/listinfo/linuxppc-dev
or, via email, send a message with subject or body 'help' to
[email protected]

You can reach the person managing the list at
[email protected]

When replying, please edit your Subject line so it is more specific than "Re: Contents of Linuxppc-dev digest..."

Today's Topics:

1. Re: Linuxppc-dev Digest, Vol 37, Issue 84 (lakshminarayana babu)
2. Re: 2.6.23-rc3 boot hang on MPC8641D (sivaji)
3. Re: 2.6.23-rc3 boot hang on MPC8641D (David Gibson)
4. RE: 2.6.23-rc3 boot hang on MPC8641D (sivaji)
5. Re: Linuxppc-dev Digest, Vol 37, Issue 84 (Kumar Gala)
6. Re: 2.6.23-rc3 boot hang on MPC8641D (Michael Ellerman)
7. Make mpc82xx use generic_calibrate_decr() (David Gibson)
8. Re: [PATCH 10/10] mpc82xx: Add pq2fads board support. (Kumar Gala)

----------------------------------------------------------------------

Message: 1
Date: Thu, 13 Sep 2007 10:53:57 +0530
From: "lakshminarayana babu" <[email protected]>
Subject: Re: Linuxppc-dev Digest, Vol 37, Issue 84
To: "Olof Johansson" <[email protected]>
Cc: [email protected]
Message-ID:

        <[email protected]>

Content-Type: text/plain; charset="iso-8859-1"

sir,
can you plese suggest any book for pci driver writing...At present i am
studying linux device drivers by alexandrorubini

Quoted 7 lines · Olof Johansson
Quoted 2 lines · lakshminarayana babu

i am new to the linux.....can you tell me how to access the pci configuration space using ioremap function...but it is implicit

function

Quoted 1 line

declaration...

Quoted 9 lines

That is architecture and platform dependent. Some platforms don't even have a memory-mappable interface to configuration space.

Instead, please use the abstracted config access functions that the kernel provides. (pci_read_config_word and friends).

-Olof

-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://ozlabs.org/pipermail/linuxppc-dev/attachments/20070913/2aa5ccff/attachment-0001.htm

------------------------------

Message: 2
Date: Wed, 12 Sep 2007 22:24:22 -0700 (PDT)
From: sivaji <[email protected]>
Subject: Re: 2.6.23-rc3 boot hang on MPC8641D
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii

Hi,
I am not willing to upgrade the uboot. Becuase it takes some time
to
port the new uboot for my custom boad.
whether the current problem is related to uboot ? One more point, previously
i tried 2.6.21 with the same uboot(1.1.6) we got linux prompt but we face some issue in the pci express in that version. so we plan to upgrade the kernel version.
by
Sivaji

Quoted 11 lines · Kumar Gala-3 wrote:
Quoted 6 lines · sivaji

Hi,

          I tired to move the dtb to 0x2000000, but the result was

same.
uboot version is 1.1.6

Quoted 9 lines

seems like a pretty old u-boot. Willing to try a 1.3.0-rc1?

- k
_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev

--
View this message in context:
http://www.nabble.com/2.6.23-rc3-boot-hang-on-MPC8641D-tf4433508.html#a12648913
Sent from the linuxppc-dev mailing list archive at Nabble.com.

------------------------------

Message: 3
Date: Thu, 13 Sep 2007 15:29:32 +1000
From: David Gibson <[email protected]>
Subject: Re: 2.6.23-rc3 boot hang on MPC8641D
To: sivaji <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii

Quoted 4 lines · sivaji

Hi,
I am not willing to upgrade the uboot. Becuase it takes some

time to

Quoted 2 lines

port the new uboot for my custom boad.
whether the current problem is related to uboot ? One more point,

previously

Quoted 1 line

i tried 2.6.21 with the same uboot(1.1.6) we got linux prompt but we

face

Quoted 2 lines

some issue in the pci express in that version. so we plan to upgrade the kernel version.

I thought u-boot < 1.3 didn't understand the flat tree at all. In which case you'll need a cuboot zImage.

--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_

                                | _way_ _around_!

http://www.ozlabs.org/~dgibson

------------------------------

Message: 4
Date: Wed, 12 Sep 2007 22:32:24 -0700 (PDT)
From: sivaji <[email protected]>
Subject: RE: 2.6.23-rc3 boot hang on MPC8641D
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii

Hi,
Sorry i specify the wrong version, we r using 1.2.0. This uboot
was taken from the BSP which was released by Freescale. Previously we tested
linux 2.6.21 kernel, we got linux prompt. For this we are using the same uboot(1.2.0).
In that version we face some issues in the pci express, at that time kumar suggest to upgrade the kernel verison 2.6.23-rc3.
Zhang did u suspect the problem is related to uboot?.
by
sivaji

Quoted 33 lines · Zhang Wei-r63237 wrote:

Yes, It's too old. Maybe not fully supports FDT. You can try the version of Kumar said or in the BSP of Freescale released.

- zw

Quoted 19 lines

-----Original Message-----
From: [email protected] [mailto:[email protected] g] On Behalf Of Kumar Gala
Sent: Thursday, September 13, 2007 1:11 PM
To: sivaji
Cc: [email protected]
Subject: Re: 2.6.23-rc3 boot hang on MPC8641D

Quoted 6 lines · sivaji

Hi,

          I tired to move the dtb to 0x2000000, but the result was

same.
uboot version is 1.1.6

Quoted 8 lines

seems like a pretty old u-boot. Willing to try a 1.3.0-rc1?

- k
_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Quoted 6 lines

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev

--
View this message in context:
http://www.nabble.com/2.6.23-rc3-boot-hang-on-MPC8641D-tf4433508.html#a12648963
Sent from the linuxppc-dev mailing list archive at Nabble.com.

------------------------------

Message: 5
Date: Thu, 13 Sep 2007 00:58:18 -0500
From: Kumar Gala <[email protected]>
Subject: Re: Linuxppc-dev Digest, Vol 37, Issue 84
To: "lakshminarayana babu" <[email protected]>
Cc: Olof Johansson <[email protected]>, [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed

Quoted 3 lines · lakshminarayana babu

sir,
can you plese suggest any book for pci driver writing...At
present i am studying linux device drivers by alexandrorubini

That's about as good as it gets. It covers writing a pci driver in there.

- k

------------------------------

Message: 6
Date: Thu, 13 Sep 2007 15:59:32 +1000
From: Michael Ellerman <[email protected]>
Subject: Re: 2.6.23-rc3 boot hang on MPC8641D
To: Kumar Gala <[email protected]>
Cc: [email protected], sivaji <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"

Quoted 13 lines · Kumar Gala
Quoted 5 lines · sivaji

Hi,
I have JTAG Debugger connected to the board. I was given the
following commands in the root path of the kernel source

If you can dump memory w/o connecting GDB, I suggest the following.

Look in your kernel build for System.map and grep for log_buf you should get something like:

Quoted 7 lines

c040b04c d log_buf
c043b1a4 b __log_buf

then dump the memory @ these addresses. I can't remember which one is the correct one. You'll want to subtract c000_0000 from the address to get a physical address that you can dump. This should help provide some possible insight into what's going on.

__log_buf is the actual buffer, log_buf points to the current insertion point IIRC. It should be pretty obvious that you're looking at a dmesg buffer though, unless there's nothing in there for some reason.

cheers

--
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors, we borrow it from our children. - S.M.A.R.T Person -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part Url :
http://ozlabs.org/pipermail/linuxppc-dev/attachments/20070913/30f05247/attachment-0001.pgp

------------------------------

Message: 7
Date: Thu, 13 Sep 2007 16:22:01 +1000
From: David Gibson <[email protected]>
Subject: Make mpc82xx use generic_calibrate_decr()
To: Kumar Gala <[email protected]>, Tony Breeds
<[email protected]>, [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii

The only difference between m82xx_calibrate_decr() and generic_calibrate_decr() is that the former computes the timebase frequency from the cpu node's bus-frequency property, instead of directly from the timebase-frequency property.

But there's no reason the timebase-frequency shouldn't be correct on 82xx like everything else. Certainly the 82xx bootwrapper in arch/powerpc/boot/cuboot-pq2.c should get it right.

Therefore, this patch removes mpc82xx_calibrate_decr(), using generic_calibrate_decr() instead.

---

I've compiled this, but no booted it, since I don't have any 82xx hardware. I'm hoping for an ack from someone who can test boot it.

Index: working-2.6/arch/powerpc/platforms/82xx/mpc82xx_ads.c
===================================================================
--- working-2.6.orig/arch/powerpc/platforms/82xx/mpc82xx_ads.c 2007-09-13 16:14:18.000000000 +1000
+++ working-2.6/arch/powerpc/platforms/82xx/mpc82xx_ads.c 2007-09-13
16:14:38.000000000 +1000

(quoted diff) +1 -1
@@ -635,6 +635,6 @@ define_machine(mpc82xx_ads)
        .init_IRQ =    mpc82xx_ads_pic_init,
        .show_cpuinfo =    mpc82xx_ads_show_cpuinfo,
        .get_irq =    cpm2_get_irq,
-       .calibrate_decr =    m82xx_calibrate_decr,
+       .calibrate_decr = generic_calibrate_decr,
        .restart = m82xx_restart,.halt = m82xx_halt,
 };

Index: working-2.6/arch/powerpc/platforms/82xx/mpc82xx.c
===================================================================
--- working-2.6.orig/arch/powerpc/platforms/82xx/mpc82xx.c 2007-09-13
16:13:48.000000000 +1000
+++ working-2.6/arch/powerpc/platforms/82xx/mpc82xx.c 2007-09-13 16:15:
13.000000000 +1000

(quoted diff) +0 -7
@@ -51,42 +51,6 @@
 
 #include "pq2ads.h"
 
-static int __init get_freq(char *name, unsigned long *val)
-{
-       struct device_node *cpu;
-       const unsigned int *fp;
-       int found = 0;
-
-       /* The cpu node should have timebase and clock frequency

properties */

(quoted diff) +0 -20
-       cpu = of_find_node_by_type(NULL, "cpu");
-
-       if (cpu) {
-               fp = of_get_property(cpu, name, NULL);
-               if (fp) {
-                       found = 1;
-                       *val = *fp;
-               }
-
-               of_node_put(cpu);
-       }
-
-       return found;
-}
-
-void __init m82xx_calibrate_decr(void)
-{
-       ppc_tb_freq = 125000000;
-       if (!get_freq("bus-frequency", &ppc_tb_freq)) {
-               printk(KERN_ERR "WARNING: Estimating decrementer frequency

"

(quoted diff) +0 -9
-                               "(not found)\n");
-       }
-       ppc_tb_freq /= 4;
-       ppc_proc_freq = 1000000000;
-       if (!get_freq("clock-frequency", &ppc_proc_freq))
-               printk(KERN_ERR "WARNING: Estimating processor frequency"
-                               "(not found)\n");
-}
-

void mpc82xx_ads_show_cpuinfo(struct seq_file *m)

{
        uint pvid, svid, phid1;

--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_

                                | _way_ _around_!

http://www.ozlabs.org/~dgibson

------------------------------

Message: 8
Date: Thu, 13 Sep 2007 01:39:58 -0500
From: Kumar Gala <[email protected]>
Subject: Re: [PATCH 10/10] mpc82xx: Add pq2fads board support.
To: Scott Wood <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed

Quoted 34 lines
arch/powerpc/boot/ renamed from arch/powerpc/boot/dts/pq2fads.dts +0 -0

dts/pq2fads.dts
new file mode 100644
index 0000000..ad736f8

arch/powerpc/boot/dts/pq2fads.dts new file +6 -0
@@ -0,0 +1,236 @@
+/*
+ * Device Tree for the PQ2FADS-ZU board with an MPC8280 chip.
+ *
+ * Copyright 2007 Freescale Semiconductor Inc.
+ *
+ * This program is free software; you can redistribute  it and/or

modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ */

arch/powerpc/boot/dts/pq2fads.dts new file +14 -0
+
+/ {
+     model = "pq2fads";
+     compatible = "fsl,pq2fads";
+     #address-cells = <1>;
+     #size-cells = <1>;
+
+     cpus {
+             #address-cells = <1>;
+             #size-cells = <0>;
+
+             cpu@0 {
+                     device_type = "cpu";
+                     reg = <0>;

arch/powerpc/boot/dts/pq2fads.dts

Quoted 10 lines
arch/powerpc/boot/dts/pq2fads.dts new file +10 -0
+                     d-cache-line-size = <d#32>;
+                     i-cache-line-size = <d#32>;
+                     d-cache-size = <d#16384>;
+                     i-cache-size = <d#16384>;
+                     timebase-frequency = <0>;
+                     clock-frequency = <0>;
+             };
+     };
+
+     CS: chipselect {

We need to document this in booting-without-of.

Quoted 150 lines
arch/powerpc/boot/dts/pq2fads.dts new file +150 -0
+             compatible = "fsl,pq2fads-chipselect",
+                          "fsl,mpc8280-chipselect",
+                          "fsl,pq2-chipselect";
+             #address-cells = <2>;
+             #size-cells = <1>;
+             fsl,ctrl = <&CSCTRL>;
+
+             ranges = <0 0 fe000000 00800000
+                       1 0 f4500000 00008000
+                       8 0 f8200000 00008000>;
+
+             flash@0,0 {
+                     device_type = "rom";
+                     compatible = "direct-mapped";
+                     reg = <0 0 800000>;
+                     probe-type = "JEDEC";
+                     bank-width = <4>;
+             };
+
+             bcsr@1,0 {
+                     reg = <1 0 20>;
+                     compatible = "fsl,pq2fads-bcsr";
+             };
+
+             PCI_PIC: pic@8,0 {
+                     #interrupt-cells = <1>;
+                     interrupt-controller;
+                     reg = <8 0 8>;
+                     compatible = "fsl,pq2ads-pci-pic";
+                     interrupt-parent = <&PIC>;
+                     interrupts = <18 8>;
+             };
+     };
+
+     memory {
+             device_type = "memory";
+             reg = <0 0>;
+     };
+
+     soc@f0000000 {
+             #address-cells = <1>;
+             #size-cells = <1>;
+             device_type = "soc";
+             compatible = "fsl,mpc8280", "fsl,pq2-soc";
+             ranges = <00000000 f0000000 00053000
+                       80000000 80000000 40000000
+                       f6000000 f6000000 02000000>;
+
+             CSCTRL: chipselect {
+                     compatible = "fsl,mpc8280-chipselect-ctrl",
+                                  "fsl,pq2-chipselect-ctrl";
+                     reg = <10100 60>;
+                     fsl,bus = <&CS>;
+             };
+
+             cpm@119c0 {
+                     #address-cells = <1>;
+                     #size-cells = <1>;
+                     #interrupt-cells = <2>;
+                     compatible = "fsl,mpc8280-cpm", "fsl,cpm2";
+                     reg = <119c0 30 0 2000>;
+                     ranges;
+
+                     brg@119f0 {
+                             compatible = "fsl,mpc8280-brg",
+                                          "fsl,cpm2-brg",
+                                          "fsl,cpm-brg";
+                             reg = <119f0 10 115f0 10>;
+                     };
+
+                     serial@11a00 {
+                             device_type = "serial";
+                             compatible = "fsl,mpc8280-scc-uart",
+                                          "fsl,cpm2-scc-uart";
+                             reg = <11a00 20 8000 100>;
+                             interrupts = <28 8>;
+                             interrupt-parent = <&PIC>;
+                             fsl,cpm-brg = <1>;
+                             fsl,cpm-command = <00800000>;
+                     };
+
+                     serial@11a20 {
+                             device_type = "serial";
+                             compatible = "fsl,mpc8280-scc-uart",
+                                          "fsl,cpm2-scc-uart";
+                             reg = <11a20 20 8100 100>;
+                             interrupts = <29 8>;
+                             interrupt-parent = <&PIC>;
+                             fsl,cpm-brg = <2>;
+                             fsl,cpm-command = <04a00000>;
+                     };
+
+                     ethernet@11320 {
+                             device_type = "network";
+                             compatible = "fsl,mpc8280-fcc-enet",
+                                          "fsl,cpm2-fcc-enet";
+                             reg = <11320 20 8500 100 113b0 1>;
+                             interrupts = <21 8>;
+                             interrupt-parent = <&PIC>;
+                             phy-handle = <&PHY0>;
+                             linux,network-index = <0>;
+                             fsl,cpm-command = <16200300>;
+                     };
+
+                     ethernet@11340 {
+                             device_type = "network";
+                             compatible = "fsl,mpc8280-fcc-enet",
+                                          "fsl,cpm2-fcc-enet";
+                             reg = <11340 20 8600 100 113d0 1>;
+                             interrupts = <22 8>;
+                             interrupt-parent = <&PIC>;
+                             phy-handle = <&PHY1>;
+                             linux,network-index = <1>;
+                             fsl,cpm-command = <1a400300>;
+                             local-mac-address = [00 e0 0c 00 79 01];
+                     };
+
+                     mdio@10d40 {
+                             device_type = "mdio";
+                             compatible = "fsl,pq2fads-mdio-bitbang",
+                                          "fsl,mpc8280-mdio-bitbang",
+                                          "fsl,cpm2-mdio-bitbang";
+                             #address-cells = <1>;
+                             #size-cells = <0>;
+                             reg = <10d40 14>;
+                             fsl,mdio-pin = <9>;
+                             fsl,mdc-pin = <a>;
+
+                             PHY0: ethernet-phy@0 {
+                                     interrupt-parent = <&PIC>;
+                                     interrupts = <19 2>;
+                                     reg = <0>;
+                                     device_type = "ethernet-phy";
+                             };
+
+                             PHY1: ethernet-phy@1 {
+                                     interrupt-parent = <&PIC>;
+                                     interrupts = <19 2>;
+                                     reg = <3>;
+                                     device_type = "ethernet-phy";
+                             };
+                     };
+
+                     usb@11b60 {
+                             #address-cells = <1>;
+                             #size-cells = <0>;
+                             compatible = "fsl,mpc8280-usb",
+                                          "fsl,cpm2-usb";
+                             reg = <11b60 18 8b00 100>;
+                             interrupt-parent = <&PIC>;

arch/powerpc/boot/dts/pq2fads.dts

Quoted 10 lines
arch/powerpc/boot/dts/pq2fads.dts new file +10 -0
+                             interrupts = <b 8>;
+                             fsl,cpm-command = <2e600000>;
+                     };
+             };
+
+             PIC: interrupt-controller@10c00 {
+                     #interrupt-cells = <2>;
+                     interrupt-controller;
+                     reg = <10c00 80>;
+                     compatible = "fsl,mpc8280-pic", "fsl,pq2-pic";

this should also have a "fsl,cpm2-pic" or something of that form. (exact same pic exists on 8560, 85xx+CPM)

Quoted 25 lines
arch/powerpc/boot/dts/pq2fads.dts new file +25 -0
+             };
+
+             pci@10800 {
+                     device_type = "pci";
+                     reg = <10800 10c 101ac 8 101c4 8>;
+                     compatible = "fsl,mpc8280-pci", "fsl,pq2-pci";
+                     #interrupt-cells = <1>;
+                     #size-cells = <2>;
+                     #address-cells = <3>;
+                     clock-frequency = <d#66000000>;
+                     interrupt-map-mask = <f800 0 0 7>;
+                     interrupt-map = <
+                                     /* IDSEL 0x16 */
+                                      b000 0 0 1 &PCI_PIC 0
+                                      b000 0 0 2 &PCI_PIC 1
+                                      b000 0 0 3 &PCI_PIC 2
+                                      b000 0 0 4 &PCI_PIC 3
+
+                                     /* IDSEL 0x17 */
+                                      b800 0 0 1 &PCI_PIC 4
+                                      b800 0 0 2 &PCI_PIC 5
+                                      b800 0 0 3 &PCI_PIC 6
+                                      b800 0 0 4 &PCI_PIC 7
+
+                                     /* IDSEL 0x18 */

arch/powerpc/boot/dts/pq2fads.dts

Quoted 10 lines
arch/powerpc/boot/dts/pq2fads.dts new file +10 -0
+                                      c000 0 0 1 &PCI_PIC 8
+                                      c000 0 0 2 &PCI_PIC 9
+                                      c000 0 0 3 &PCI_PIC a
+                                      c000 0 0 4 &PCI_PIC b>;
+
+                     interrupt-parent = <&PIC>;
+                     interrupts = <12 8>;
+                     ranges = <42000000 0 80000000 80000000 0 20000000
+                               02000000 0 a0000000 a0000000 0 20000000
+                               01000000 0 00000000 f6000000 0

02000000>;

arch/powerpc/boot/dts/pq2fads.dts

Quoted 7 lines
arch/powerpc/boot/dts/pq2fads.dts new file +7 -0
+             };
+     };
+
+     chosen {
+             linux,stdout-path = "/soc/cpm/serial@11a00";
+     };
+};

- k

------------------------------

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev

End of Linuxppc-dev Digest, Vol 37, Issue 87
********************************************