LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   PCIE access problem in sh 7786 board. (https://www.linuxquestions.org/questions/linux-kernel-70/pcie-access-problem-in-sh-7786-board-878319/)

SKSnair 05-02-2011 07:42 AM

PCIE access problem in sh 7786 board.
 
Hi,

I am a beginner to linux. Recently i have got the chance to work with linux kernel and its not pretty much easy for me to get through. Hope
i would have your support. I am trying to boot up linux kernel to a alpha sh board(sh-7786) and have my device plugged to the pcie slot of
sh board. I built an image with kernel 2.6.34 and I successfully booted the linux kernel in the sh board. I wrote a simple driver to read the BAR register value. But when i tried to access my plugged device, I see a problem. Through lspci i can find the device attached. I went through the device capabilities too. But when I tried to read
the device BAR register I get some junk data which is incorrect. I plugged the same in the i386 pcie board and was able to read through the
BAR register successfully with the same sample driver program. Please
help me If I have missed something or done something wrong.

I am confused as I can read the pid and vid of the device but not its
register properly?

Do i have to worry about "bridge window [io disabled]" in the boot
message.

The boot log is as follows:

=> boot
## Booting kernel from Legacy Image at a0100000 ...
Image Name: Linux-2.6.34
Image Type: SuperH Linux Kernel Image (gzip compressed)
Data Size: 6451292 Bytes = 6.2 MiB
Load Address: 88001000
Entry Point: 88002000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
Linux version 2.6.34 (root@sunil-vmware1) (gcc version 4.3.4
(Buildroot 2010.05) ) #37 PREEMPT Sun May 1 23:45:21 PDT 2011
Boot params:
... MOUNT_ROOT_RDONLY - 00000000
... RAMDISK_FLAGS - 00000000
... ORIG_ROOT_DEV - 00000000
... LOADER_TYPE 000
... INITRD_START - 00000000
... INITRD_SIZE - 00000000
Booting machvec: AP-SH4AD-0A
Node 0: start_pfn = 0x8000, low = 0x18000
Zone PFN ranges:
Normal 0x00008000 -> 0x00018000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
0: 0x00008000 -> 0x00018000
Alpha Project AP-SH4AD-0A support:
Builtists in Zone order, mobility grouping on. Total pages: 65024
Kernel command line: console=ttySC0,115200
PID hash table entries: 1024 (order: 0, 4096 bytes)
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
PVR=10400500 CVR=77440210 PRR=00000410
I-cache : n_ways=4 n_sway_incr=8192
I-cache : entry_mask=0x00001fe0 alias_mask=0x00001000 n_aliases=2
D-cache : n_ways=4 n_sets=256 way_incr=8192
D-cache : entry_mask=0x00001fe0 alias_mask=0x00001000 n_aliases=2
Memory: 250904k/262144k available (2798k kernel code, 1284k data,
3912k init)
virtual kernel memory layout:
fixmap : 0xdffd6000 - 0xdffff000 ( 164 vmalloc : 0xc0000000 -
0xdffd4000 ( 511 MB)
lowmem : 0x88000000 - 0x98000000 ( 256 MB) (cached)
: 0xa0000000 - 0xc0000000 ( 512 MB) (uncached)
.init : 0x884a0000 - 0x88872000 (3912 kB)
.data : 0x882bc8f0 - 0x883fdc70 (1284 kB)
.text : 0x88001000 - 0x882bc8f0 (2798 kB)
Hierarchical RCU implementaR_IRQS:256 nr_irqs:256
Console: colour dummy device 80x25
allocated 1310720 bytes of page_cgroup
please try 'cgroup_disable=memory' option if you don't want memory
cgroups
sh_tmu: TMU0 used for clock events
sh_tmu: TMU0 used for periodic clock events
sh_tmu: TMU1 used as clock source
Calibrating delay loop (skipped)... 533.32 BogoMIPS PRESE066656)
Mount-cache hash table entries: 512
Initializing cgroup subsys ns
Initializing cgroup subsys cpuacct
Initializing cgroup subsys memory
Initializing cgroup subsys devices
Initializing cgroup subsys freezer
Initializing cgroup subsys blkio
CPU: SH7786
DWARF unwinder initialised: read 2 CIEs, 14368 FDEs
NET: Registered protocol familup done
Performance Events: SH-4A support registered
HW Breakpoints: SH-4A UBC support registered
PCI: Starting initialization.
PCI: probing 2 ports.
PCI: PCIe#0 x1 link detected
PCI: PCIe#1 link down
bio: create slab <bio-0> at 0
vgaarb: loaded
SCSI subsystem initialized
pci 0000:00:01.0: BAR 0: assigned [mem 0xc0000000-0xc0001t]
pci 0000:00:01.0: BAR 0: set to [mem 0xc0000000-0xc0001fff 64bit] (PCI
address [0xc0000000-0xc0001fff])
pci 0000:00:00.0: PCI bridge to [bus 01-01]
pci 0000:00:00.0: bridge window [io disabled]
pci 0000:00:00.0: bridge window [mem disabled]
pci 0000:00:00.0: bridge window [mem pref disabled]
PCI: Setting latency timer of device 000 to 64
pci 0000:02:00.0: PCI bridge to [bus 03-03]
pci 0000:02:00.0: bridge window [io disabled]
pci 0000:02:00.0: bridge window [mem disabled]
pci 0000:02:00.0: bridge window [mem pref disabled]
PCI: Setting latency timer of device 0000:02:00.0 to 64
Switching to clocksource TMU1
sh_tmu: TMU0 used for oneshot clock events
NET: Regiotocol family 2
IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
TCP established hash table entries: 8192 (order: 4, 65536 bytes)
TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hashntries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
sq: Registering store queue API.
cpufreq: SuperH CPU frequency driver.
cpufreq: CPU#0 Frequencies - Minimum 266.664 MHz, Maximum 533.328
MHzLB registered 1 MB page size, pre-allocated 0 pages
Slow work thread pool: Starting up
Slow work thread pool: Ready
NTFS driver 2.1.29 [Flags: R/W].
JFFS2 version 2.2. (NAND) �© 2001-2006 Red Hat, Inc.
msgmni has been set to 490
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq re (default)
PCI: Setting latency timer of device 0000:00:00.0 to 64
PCI: Setting latency timer of device 0000:02:00.0 to 64
sh7785fb_init: [0] b6800000 16800000
sh7785fb_init: [1] b6400000 16400000
sh7785fb_init: [2] b6000000 16000000
Console: switching to colour frame buffer device 128x48
fb0: SH7785FB frame buffer device
fb1: SH7785FB fram device
fb2: SH7785FB frame buffer device
SuperH SCI(F) driver initialized
sh-sci.0: ttySC0 at MMIO 0xffea0000 (irq = 43) is a scif
console [ttySC0] enabled
sh-sci.1: ttySC1 at MMIO 0xffeb0000 (irq = 44) is a scif
sh-sci.2: ttySC2 at MMIO 0xffec0000 (irq = 50) is a scif
sh-sci.3: ttySC3 at MMIO 0xffed0000 (irq = 51) is a scif
sh-sci.4: ttySMMIO 0xffee0000 (irq = 52) is a scif
sh-sci.5: ttySC5 at MMIO 0xffef0000 (irq = 53) is a scif
brd: module loaded
smsc911x: Driver version 2008-10-21.
smsc911x-mdio: probed
eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=ffffffff:01,
irq=-1)
net eth0: MAC Address: 00:0c:7b:2a:01:29
mice: PS/2 mouse device common for all mice: using governor ladder
cpuidle: using governor menu
sh_tmu: TMU0 kept as earlytimer
sh_tmu: TMU1 kept as earlytimer
TCP cubic registered
NET: Registered protocol family 17
NET: Registered protocol family 15
Freeing unused kernel memory: 3912k freed
Initializing random number generator... done.
Starting network...
ip: RTNETLINK answers: File exists
net eth0: SMSC911x/921x identified at 0xa4000000, IRQ: 0

Welcome to Buildroot
buildroot login: root
# lspci

ranbumca 05-03-2011 02:24 AM

Hi Nair,

I hope the following link would be little helpful to sort out your problem.

http://tldp.org/LDP/tlk/dd/pci.html

-- Anbu


All times are GMT -5. The time now is 03:36 PM.