Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

MPC8245 and Cirrus PD6729

Ports
hschocher
2005-01-15
2013-04-08
  • hschocher
    hschocher
    2005-01-15

    Hello,

    I am working with an MPC8245 and a Cirrus PD6729 PCI-to-PCMCIA Controller,
    and want to get the PD6729 running.

    I use Linux Kernel 2.4.25 from ftp.denx.de
    CardServices 3.2.8

    I think the PD6729 is detected, and with

    bash-2.05b# cardctl status 0
      5V 16-bit PC Card
      function 0: [ready]
    bash-2.05b#
    i see the right info, because i have run U-Boot an it says the same thing about the card!

    Know i think Linux should MemMap the attribute Memory and analyse the CIS Info, but
    i think the "MemMap" didn t work :-(

    here the MemMap Calls

    Starting pcmcia:  i82365: SetMemMap(0, 0, 0x00, 0 ns, 0x00000-0x00000, 0x00000)
    i82365: SetMemMap(0, 1, 0x00, 0 ns, 0x00000-0x00000, 0x00000)
    i82365: SetMemMap(0, 2, 0x00, 0 ns, 0x00000-0x00000, 0x00000)
    i82365: SetMemMap(0, 3, 0x00, 0 ns, 0x00000-0x00000, 0x00000)
    i82365: SetMemMap(0, 4, 0x00, 0 ns, 0x00000-0x00000, 0x00000)
    i82365: SetMemMap(1, 0, 0x00, 0 ns, 0x00000-0x00000, 0x00000)
    i82365: SetMemMap(1, 1, 0x00, 0 ns, 0x00000-0x00000, 0x00000)
    i82365: SetMemMap(1, 2, 0x00, 0 ns, 0x00000-0x00000, 0x00000)
    i82365: SetMemMap(1, 3, 0x00, 0 ns, 0x00000-0x00000, 0x00000)
    i82365: SetMemMap(1, 4, 0x00, 0 ns, 0x00000-0x00000, 0x00000)
    cs: unable to map card memory!
    cs: unable to map card memory!
    cs: unable to map card memory!
    cs: unable to map card memory!
    cs: unable to map card memory!
    cs: unable to map card memory!
    i82365: SetMemMap(0, 0, 0x21, 300 ns, 0xb0000-0xb0fff, 0x00000)
    i82365: SetMemMap(0, 0, 0x01, 300 ns, 0xb0000-0xb0fff, 0x00000)
    i82365: SetMemMap(0, 1, 0x02, 0 ns, 0xb1000-0xb1fff, 0x00000)
    i82365: SetMemMap(0, 1, 0x03, 0 ns, 0xb1000-0xb1fff, 0x00000)
    i82365: SetMemMap(0, 1, 0x03, 0 ns, 0xb1000-0xb1fff, 0x01000)
    i82365: SetMemMap(0, 1, 0x03, 0 ns, 0xb1000-0xb1fff, 0x00000)
    i82365: SetMemMap(0, 1, 0x03, 0 ns, 0xb1000-0xb1fff, 0x01000)
    anonymous: unknown size
    [  OK  ]

    When I see the memMap calls, i see that the window size is 0x1000

    Thats to short, or? because in the programm i82365.c is the following

        i = (mem->sys_start >> 12) & 0x0fff;
       
        i = (mem->sys_stop >> 12) & 0x0fff;

    so i have the start == end Adress!!!!!! That is not OK, or!?

    so what can i do? Or is there another problem?

    Can somebody help me?

    thanks

    Heiko

    /var/log/messages

    Jan 15 10:30:56 cpc45 netfs: Mounting other filesystems:  succeeded
    Jan 15 10:30:56 cpc45 pcmcia: Starting PCMCIA services:
    Jan 15 10:30:57 cpc45 kernel: Linux PCMCIA Card Services 3.2.8
    Jan 15 10:30:57 cpc45 kernel:   kernel build: 2.4.25 unknown
    Jan 15 10:30:57 cpc45 kernel:   options:  [pci]
    Jan 15 10:30:57 cpc45 kernel: Intel ISA/PCI/CardBus PCIC probe:
    Jan 15 10:30:57 cpc45 kernel:   Cirrus PD6729 rev 00 PCI-to-PCMCIA at slot 00:0e, port 0x3e0
    Jan 15 10:30:57 cpc45 kernel:     host opts [0]: [ring] [1/5/0] [1/20/0]
    Jan 15 10:30:57 cpc45 kernel:     host opts [1]: [ring] [1/5/0] [1/20/0]
    Jan 15 10:30:57 cpc45 kernel:     *NO* card interrupts, polling interval = 1000 ms
    Jan 15 10:30:57 cpc45 kernel: i82365: SetMemMap(0, 0, 0x00, 0 ns, 0x00000-0x00000, 0x00000)
    Jan 15 10:30:57 cpc45 kernel: i82365: SetMemMap(0, 1, 0x00, 0 ns, 0x00000-0x00000, 0x00000)
    Jan 15 10:30:57 cpc45 kernel: i82365: SetMemMap(0, 2, 0x00, 0 ns, 0x00000-0x00000, 0x00000)
    Jan 15 10:30:57 cpc45 kernel: i82365: SetMemMap(0, 3, 0x00, 0 ns, 0x00000-0x00000, 0x00000)
    Jan 15 10:30:57 cpc45 kernel: i82365: SetMemMap(0, 4, 0x00, 0 ns, 0x00000-0x00000, 0x00000)
    Jan 15 10:30:57 cpc45 kernel: i82365: SetMemMap(1, 0, 0x00, 0 ns, 0x00000-0x00000, 0x00000)
    Jan 15 10:30:57 cpc45 kernel: i82365: SetMemMap(1, 1, 0x00, 0 ns, 0x00000-0x00000, 0x00000)
    Jan 15 10:30:57 cpc45 kernel: i82365: SetMemMap(1, 2, 0x00, 0 ns, 0x00000-0x00000, 0x00000)
    Jan 15 11:30:48 cpc45 rc.sysinit: Building the cache succeeded
    Jan 15 10:30:57 cpc45 kernel: i82365: SetMemMap(1, 3, 0x00, 0 ns, 0x00000-0x00000, 0x00000)
    Jan 15 11:30:48 cpc45 rc.sysinit: Mounting proc filesystem:  succeeded
    Jan 15 10:30:57 cpc45 kernel: i82365: SetMemMap(1, 4, 0x00, 0 ns, 0x00000-0x00000, 0x00000)
    Jan 15 11:30:49 cpc45 sysctl: net.ipv4.ip_forward = 0
    Jan 15 11:30:49 cpc45 sysctl: net.ipv4.conf.default.rp_filter = 1
    Jan 15 11:30:49 cpc45 sysctl: kernel.core_uses_pid = 1
    Jan 15 11:30:49 cpc45 rc.sysinit: Configuring kernel parameters:  succeeded
    Jan 15 10:30:50 cpc45 date: Sat Jan 15 10:30:50 MET 2005
    Jan 15 10:30:50 cpc45 rc.sysinit: Setting clock : Sat Jan 15 10:30:50 MET 2005 succeeded
    Jan 15 10:30:50 cpc45 rc.sysinit: Setting hostname cpc45:  succeeded
    Jan 15 10:30:57 cpc45 kernel: cs: memory probe 0x000000-0xffffffff: clean.
    Jan 15 10:30:50 cpc45 rc.sysinit: Activating swap partitions:  succeeded
    Jan 15 10:30:58 cpc45 kernel: cs: unable to map card memory!
    Jan 15 10:30:51 cpc45 rc.sysinit: Finding module dependencies:  succeeded
    Jan 15 10:30:58 cpc45 kernel: cs: unable to map card memory!
    Jan 15 10:30:51 cpc45 rc.sysinit: Checking filesystems succeeded
    Jan 15 10:30:58 cpc45 kernel: cs: unable to map card memory!
    Jan 15 10:30:51 cpc45 rc.sysinit: Mounting local filesystems:  succeeded
    Jan 15 10:30:58 cpc45 kernel: cs: unable to map card memory!
    Jan 15 10:30:51 cpc45 rc.sysinit: Enabling swap space:  succeeded
    Jan 15 10:30:58 cpc45 kernel: cs: unable to map card memory!
    Jan 15 10:30:53 cpc45 init: Entering runlevel: 3
    Jan 15 10:30:58 cpc45 kernel: cs: unable to map card memory!
    Jan 15 10:30:54 cpc45 sysctl: net.ipv4.ip_forward = 0
    Jan 15 10:30:54 cpc45 sysctl: net.ipv4.conf.default.rp_filter = 1
    Jan 15 10:30:54 cpc45 sysctl: kernel.core_uses_pid = 1
    Jan 15 10:30:54 cpc45 network: Setting network parameters:  succeeded
    Jan 15 10:30:55 cpc45 network: Bringing up loopback interface:  succeeded
    Jan 15 10:30:58 cpc45 pcmcia: cardmgr[329]: watching 2 sockets
    Jan 15 10:30:58 cpc45 cardmgr[329]: watching 2 sockets
    Jan 15 10:30:58 cpc45 cardmgr[329]: starting, version is 3.2.8
    Jan 15 10:30:58 cpc45 cardmgr[329]: initializing socket 0
    Jan 15 10:30:58 cpc45 kernel: i82365: SetMemMap(0, 0, 0x21, 300 ns, 0xb0000-0xb0fff, 0x00000)
    Jan 15 10:30:58 cpc45 kernel: i82365: SetMemMap(0, 0, 0x01, 300 ns, 0xb0000-0xb0fff, 0x00000)
    Jan 15 10:30:58 cpc45 cardmgr[329]: socket 0: Anonymous Memory
    Jan 15 10:30:58 cpc45 modprobe: modprobe: Can't locate module char-major-4
    Jan 15 10:30:58 cpc45 cardmgr[329]: executing: 'modprobe memory_cs'
    Jan 15 10:30:59 cpc45 kernel: i82365: SetMemMap(0, 1, 0x02, 0 ns, 0xb1000-0xb1fff, 0x00000)
    Jan 15 10:30:59 cpc45 kernel: memory_cs: mem0:i82365: SetMemMap(0, 1, 0x03, 0 ns, 0xb1000-0xb1fff, 0x00000)
    Jan 15 10:30:59 cpc45 kernel: i82365: SetMemMap(0, 1, 0x03, 0 ns, 0xb1000-0xb1fff, 0x00000)
    Jan 15 10:30:59 cpc45 kernel: i82365: SetMemMap(0, 1, 0x03, 0 ns, 0xb1000-0xb1fff, 0x01000)
    Jan 15 10:30:59 cpc45 kernel: i82365: SetMemMap(0, 1, 0x03, 0 ns, 0xb1000-0xb1fff, 0x00000)
    Jan 15 10:30:59 cpc45 kernel: i82365: SetMemMap(0, 1, 0x03, 0 ns, 0xb1000-0xb1fff, 0x01000)
    Jan 15 10:30:59 cpc45 kernel:  anonymous: unknown size
    Jan 15 10:30:59 cpc45 cardmgr[329]: executing: './memory start mem0'
    Jan 15 10:30:59 cpc45 cardmgr[329]: + mknod /dev/mem0c0c c 253 0
    Jan 15 10:30:59 cpc45 cardmgr[329]: + mknod /dev/mem0c0b b 253 0
    Jan 15 10:30:59 cpc45 cardmgr[329]: + mknod /dev/mem0a0c c 253 4
    Jan 15 10:30:59 cpc45 cardmgr[329]: + mknod /dev/mem0c c 253 8
    Jan 15 10:30:59 cpc45 cardmgr[329]: + mknod /dev/mem0a c 253 12
    Jan 15 10:30:59 cpc45 modprobe: modprobe: Can't locate module char-major-4
    Jan 15 10:30:59 cpc45 pcmcia: done.

    bash-2.05b# cat /proc/interrupts
               CPU0
      2:      26893   OpenPIC   Level     eth0
      3:       3546   OpenPIC   Level     serial
    16:          0   None      Edge      I2C
    BAD:          0
    bash-2.05b# cat /proc/ioports
    00000000-00bfffff : PCI host bridge
      000003e0-000003e1 : i82365
      00bfe000-00bfefff : PCI Bus #01
      00bfff00-00bfff3f : PCI device 8086:1209
        00bfff00-00bfff3f : eepro100
      00bfff7c-00bfff7f : PCI device 1013:1100
      00bfff80-00bfffff : PCI device 10b5:9030
    fdfcc600-fdfcc607 : serial(auto)
    fdfce500-fdfce507 : serial(auto)
    bash-2.05b# cat /proc/iomem
    000b0000-000b0fff : card services
    000b1000-000b1fff : memory_cs
    80000000-fcffffff : PCI host bridge
      bf900000-bf9fffff : PCI Bus #01
      bfa00000-bfafffff : PCI Bus #01
      bfbc0000-bfbdffff : PCI device 8086:1209
      bfbfe000-bfbfefff : PCI device 8086:1209
        bfbfe000-bfbfefff : eepro100
      bfbffd00-bfbffdff : PCI device 10b5:9030
      bfbffe00-bfbffeff : PCI device 10b5:9030
      bfbfff00-bfbfffff : PCI device 10b5:9030
      bfc00000-bfdfffff : PCI device 10b5:9030
      bfffff80-bfffffff : PCI device 10b5:9030
    bash-2.05b#

    bash-2.05b# cat /proc/pci
    PCI devices found:
      Bus  0, device   0, function  0:
        Class 0600: PCI device 1057:0006 (rev 20).
          Non-prefetchable 32 bit memory at 0x0 [0xfff].
      Bus  0, device  13, function  0:
        Class 0680: PCI device 10b5:9030 (rev 10).
          IRQ 255.
          Non-prefetchable 32 bit memory at 0xbfffff80 [0xbfffffff].
          I/O at 0xbfff80 [0xbfffff].
          Non-prefetchable 32 bit memory at 0xbfc00000 [0xbfdfffff].
          Non-prefetchable 32 bit memory at 0xbfbfff00 [0xbfbfffff].
          Non-prefetchable 32 bit memory at 0xbfbffe00 [0xbfbffeff].
          Non-prefetchable 32 bit memory at 0xbfbffd00 [0xbfbffdff].
      Bus  0, device  14, function  0:
        Class 0605: PCI device 1013:1100 (rev 7).
          IRQ 1.
          I/O at 0xbfff7c [0xbfff7f].
      Bus  0, device  15, function  0:
        Class 0200: PCI device 8086:1209 (rev 9).
          IRQ 2.
          Master Capable.  Latency=128.  Min Gnt=8.Max Lat=56.
          Non-prefetchable 32 bit memory at 0xbfbfe000 [0xbfbfefff].
          I/O at 0xbfff00 [0xbfff3f].
          Non-prefetchable 32 bit memory at 0xbfbc0000 [0xbfbdffff].
      Bus  0, device  16, function  0:
        Class 0604: PCI device 104c:ac28 (rev 0).
    bash-2.05b#
    bash-2.05b# cd /proc/bus/pccard/
    bash-2.05b# ls
    00  01  drivers
    bash-2.05b# cat drivers
    memory_cs                0 1
    bash-2.05b# cd 00
    /proc/bus/pccard/00
    bash-2.05b# ls
    exca  info  pci
    bash-2.05b# cat info
    type:     Cirrus PD6729
    psock:    0
    bus:      00
    devfn:    0e.0
    bash-2.05b# cat pci
    11001013 04000083 06050007 00000000
    000003e1 00000000 00000000 00000000
    00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000101
    00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000
    00212007 00045309 00000000 00000000
    00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000
    bash-2.05b#

    ash-2.05b# cat /etc/pcmcia/config.opts
    #
    # Local PCMCIA Configuration File
    #
    #----------------------------------------------------------------------

    # System resources available for PCMCIA devices

    include port 0x100-0x4ff, port 0x800-0x8ff, port 0xc00-0xcff
    include memory 0xb0000-0xbffff
    include memory 0xc0000-0xfffff
    include memory 0xb00000-0xbfffff
    include memory 0xa0000000-0xa0ffffff, memory 0x60000000-0x60ffffff

    # High port numbers do not always work...
    # include port 0x1000-0x17ff

    # Extra port range for IBM Token Ring
    #include port 0xa00-0xaff

    # Resources we should not use, even if they appear to be available

    # First built-in serial port
    exclude irq 4
    # Second built-in serial port
    #exclude irq 3
    # First built-in parallel port
    exclude irq 7

    #----------------------------------------------------------------------

    # Examples of options for loadable modules

    # To fix sluggish network with IBM ethernet adapter...
    #module "pcnet_cs" opts "mem_speed=600"

    # Options for IBM Token Ring adapters
    #module "ibmtr_cs" opts "mmiobase=0xd0000 srambase=0xd4000"

    # Options for Raylink/WebGear driver: uncomment only one line...
    # Generic ad-hoc network
    # module "ray_cs" opts "essid=ADHOC_ESSID hop_dwell=128 beacon_period=256 translate=1"
    # Infrastructure network for older cards
    #module "ray_cs" opts "net_type=1 essid=ESSID1"
    # Infrastructure network for WebGear
    #module "ray_cs" opts "net_type=1 essid=ESSID1 translate=1 hop_dwell=128 beacon_period=256"

    # Options for WaveLAN/IEEE driver (AccessPoint mode)...
    #module "wvlan_cs" opts "station_name=MY_PC"
    # Options for WaveLAN/IEEE driver (ad-hoc mode)...
    #module "wvlan_cs" opts "port_type=3 channel=1 station_name=MY_PC"

    # Options for Xircom Netwave driver...
    #module "netwave_cs" opts "domain=0x100 scramble_key=0x0"

    bash-2.05b#

    bash-2.05b# ./dump_exca
    Socket 0:
      Identification and revision = 0x82
      Chip information = 0xe0
      Interface status = 0xef
        [bvd1/stschg] [bvd2/spkr] [detect] [ready] [poweron] [gpi]
      Power control = 0xd1
        [output] [Vcc=5v] [Vpp=5v]
      Interrupt and general control = 0x40
        [irq=0]
      Card status change interrupt control = 0x08
        [detect] [irq=0]
      Misc control 1 = 0x12
        [Vcc 5v] [spkr]
      Misc control 2 = 0x80
        [irq 15 is RI]
      memory 0: 0x103f000-0x10bffff @ 0x00000000 [on] [16bit] [time1] [reg]
      memory 1: 0x11bf000-0x113ffff @ 0x00180000 [on] [16bit] [time1] [reg]
      memory 2: 0x0000-0x0fff @ 0x00000000 [off] [8bit] [time0]
      memory 3: 0x0000-0x0fff @ 0x00000000 [off] [8bit] [time0]
      memory 4: 0x0000-0x0fff @ 0x00000000 [off] [8bit] [time0]
      io 0: 0x0000-0x0100 [off] [time0] [8bit]
      io 1: 0x0000-0x0100 [off] [time0] [8bit]
      Timing set 0: setup = 1, command = 5, recovery = 0
      Timing set 1: setup = 1, command = 20, recovery = 0
      Extension registers:    mask 0 = 0x00, mask 1 = 0xd1, DMA ctl = 0x40 [dreq is inpack]

    Socket 1:
      Identification and revision = 0x82
      Chip information = 0x20
      Interface status = 0xb3
        [bvd1/stschg] [bvd2/spkr] [wrprot] [ready] [gpi]
      Power control = 0x41
        [Vcc off] [Vpp=5v]
      Interrupt and general control = 0x40
        [irq=0]
      Card status change interrupt control = 0x08
        [detect] [irq=0]
      Misc control 1 = 0x10
        [spkr]
      Misc control 2 = 0x00

      memory 0: 0x0000-0x0fff @ 0x00000000 [off] [8bit] [time0]
      memory 1: 0x0000-0x0fff @ 0x00000000 [off] [8bit] [time0]
      memory 2: 0x0000-0x0fff @ 0x00000000 [off] [8bit] [time0]
      memory 3: 0x0000-0x0fff @ 0x00000000 [off] [8bit] [time0]
      memory 4: 0x0000-0x0fff @ 0x00000000 [off] [8bit] [time0]
      io 0: 0x0000-0x0100 [off] [time0] [8bit]
      io 1: 0x0000-0x0100 [off] [time0] [8bit]
      Timing set 0: setup = 1, command = 5, recovery = 0
      Timing set 1: setup = 1, command = 20, recovery = 0
      Extension registers:    mask 0 = 0x00, mask 1 = 0x41, DMA ctl = 0x40 [dreq is inpack]

    bash-2.05b#

    Output from U-Boot
    CPU:   MPC8245 Revision 1.4 at 297 MHz: 16 kB I-Cache 16 kB D-Cache
    CPC45  Local Bus at 99 MHz
    I2C:   ready
    DRAM:  128 MB
    FLASH:  8 MB
    In:    serial
    Out:   serial
    Err:   serial
    Net:   i82559#0
    PCMCIA: Cirrus PD672x:  5V card found:  LEXAR ATA FLASH CARD     TWISTER TRC03
                Fixed Disk Card
                IDE interface
                [silicon] [single] [sleep] [standby] [idle] [low power] [reg inhibit] [IOis16]
    Bus 0: OK
      Device 0: Model: LEXAR ATA FLASH Firm: V1.03 Ser#: 13603482209599097078
                Type: Removable Hard Disk
                Capacity: 61.5 MB = 0.0 GB (125952 x 512)
    BEDBUG:ready

    Type run flash_nfs to mount root filesystem over NFS

     
    • David Hinds
      David Hinds
      2005-01-18

      You probably need to specify a memory range in /etc/pcmcia/config.opts that makes sense for this platform (i.e. does not conflict with system RAM, etc).

      The code in i82365.c is correct.  The start and end addresses are sort of the start and end page addresses; when they are equal, they specify a window of 4 kb.

      -- Dave

       
    • hschocher
      hschocher
      2005-01-26

      Hello David,

      thanks for help.

      Now i have another problem, and i think it is in the i82365.c source.

      when i stop the pcmcia Card with
      "/etc/rc.d/init.d/pcmcia stop" i get the Error

      Trying to free nonexistent resource

      I looked in the Code an i see the following:

      In add_pcic() there was one
      request_region(s->ioaddr, 2, "i82365");
      call and the fkt() add_pcic() is only called once.

      But in exit_i82365(void):
          for (i = 0; i < sockets; i++) {
          socket_info_t *s = &socket[i];
          /* Turn off all interrupt sources! */
          i365_set(s, I365_CSCINT, 0);
      #ifdef CONFIG_PCI
          if (s->flags & IS_CARDBUS)
              cb_writel(s, CB_SOCKET_MASK, 0);
          if (s->cb_virt) {
              iounmap(s->cb_virt);
              release_mem_region(s->cb_phys, 0x1000);
          } else
      #endif
              release_region(s->ioaddr, 2);
          }

      The Cirrus PD6729 has 2 sockets -> there are two calls from release_region() -> that gives the Error Msg.
      So what can i do?

      thanks Heiko

       
      • David Hinds
        David Hinds
        2005-02-24

        The message is at most an irritant.  You can change the code to just release the region once if it bothers you, or ignore it.

        - Dave