This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DM6467T EVM can't be booted over PCI twice!!!

I am currently working with a DM6467T EVM  and dvsdk v3_10, and I want to boot dm6467T EVM over PCI bus from a PC (intel processor, running SUSE 10.1).here is the problem:

1) I boot the device successful.

2) then,  I end the saBootApp.o, 

I  rmmod  dm646x_pci_boot.ko

insmod dm646x_pci_boot.ko

3) I want to boot the device again, but I failed, here is where saBootApp stopped:

 

argc:5

3----------------------------------

mapped_buffer:b7f1c000

ublDaVinci.bin file opened

Size of ublDaVinci.bin file = 14336

14336 bytes read from file ublDaVinci.bin

4----------------------------------

And my SUSE linux has no  response

After rebooting  the PC(SUSE linux ),  come the the same phenomenon.

 

  • Hi,

    At step 2, after you do "rmmod  dm646x_pci_boot.ko", the DM6467T also needs to be reset (and probably re-trigger enumeration) before you load the boot driver again.

    This is required to ensure that the DM6467T is in PCI boot mode waiting for the PC to carry out boot procedure.

       Hemant

  • Hi Hemant,

    Thanks a lot!

    I wanna know how to reset the DM6467, I mean if there is a register or method to call.

    or which doc I should refer to?

    Thanks again!

    Jack

  • Jack,

    I see two possible methods:

    1) Tie up POR# (or even RESET#) of DM6467T to PCI slot RST# pin and toggle it from the Host. Of course the host should be capable of controlling this pin and the board may need modification.

    2) Trigger Watchdog timer (Timer2) on DM6467T by configuring the respective registers from Host. You will need to ensure that one of the BAR of DM6467T is configured to provide access to watchdog registers by corresponding inbound configuration. You may also need to have access to PSC to enable the watchdog module before setting it.

       Hemant

  •  Hemant,

    on method 2,  I think the watchdog timer reset is triggered by using "reboot" command, the command call "davinci_watchdog_reset()" at last, Is that right?

    at DM6467T side, after the linux is booted through PCI, I use "reboot", the output is:

    Broadcast message from root (ttyS0) (Tue Apr 13 16:57:05 2010):

     

    The system is going down for reboot NOW!

    INIT: Switching to runlevel: 6

    INIT: Sending processes the TERM signal

    INIT: SendiStopping telnet daemon.

    /etc/rc6.d/K31alsa-state: line 15: syntax error: "fi" unexpected

    S40networking

    NOT deconfiguring network interfaces: / is an NFS mount

    Sending all processes the TERM signal...

    Sending all processes the KILL signal...

    Unmounting remote filesystems...

    Deactivating swap...

    Unmounting local filesystems...

    mount: can't find /mnt/ram in /proc/mounts

    umount: none busy - remounted read-only

    mount: cannot read /proc/mounts: No such file or directory

    Rebooting... musb_platform_disable 161: dma still active

    (the cursor stop here with no response )

    then I run "saBootApp.o" again, failed also!

    the message "Booting PSP Boot Loader" from UBL isn't output

     

  • Jack,

    Since the DM6467T is in PCI boot mode, the UBL has to be reloaded from host.

    In the sequence you mentioned above, are you doing re-enumeration and loading the boot driver again (as mentioned in my earlier post) after rebooting DM6467T?

       Hemant

     

  • Hemant,

    I do reload the boot driver again, but I don't know what exactly  does "re-enumeration" mean.

    Thank you for your posts!

       Jack

  • Jack,

    Can you try following?

    echo 1 > /sys/bus/pci/rescan

       Hemant

  • Hemant,

    I can't.

    because there isn't "rescan" in /sys/bus/pci/

    here is my output from "ls -al"

    lastshadow:~ # ls -al /sys/bus/pci/
    total 0
    drwxr-xr-x  5 root root 0 Oct 19 08:27 .
    drwxr-xr-x 14 root root 0 Oct 19 08:27 ..
    drwxr-xr-x  2 root root 0 Oct 19 08:27 devices
    drwxr-xr-x 17 root root 0 Oct 19 08:27 drivers
    drwxr-xr-x 66 root root 0 Oct 19 08:28 slots

    Jack

  • Jack,

    Perhaps because the PC you have is running older kernel? Is it possible to move to recent kernel (I am not sure which kernel version actually added this support)?

    If not, then you will need to save PCI resources those were allocated to the DM6467T device before rebooting it (you can look for sysfs entries inside /sys./bus/pci/devices/*) and rewrite it to the device on reboot (e.g., write BARs on DM6467T using lspci) before loading the driver.

       Hemant

     

  • Hemant,

    My kernel version is 2.6.16, I will try to update it.

        Jack

  • Hi all,
    the problem is solved:

    Install suse11.4(kernel version 2.6.37) on my host.

    Modify the pci host driver to be compiled on 2.6.37

    Modify the pci host driver file "pcidrv.c"
    in function dm646x_pci_cleanup();

    change
    class_destroy(dm646x_pci_class);
    to
    device_destroy(dm646x_pci_class, dm646x_dev_id);
    // called after device_destroy() !!!
    class_destroy(dm646x_pci_class);

    Then execute the following in turn:
    rmmod dm646x_pci_boot.ko
    echo 1 > /sys/bus/pci/devices/0000\:00\:01.0/0000\:01\:00.0/0000\:02\:04.0/reset
    insmod dm646x_pci_boot.ko
    ./saBootApp.o u-boot.bin uImage initrd_psp.image bootscript.img

    (PS: linux-mw6k:/opt/pci_host # lspci -tv
    -[0000:00]-+-00.0 Intel Corporation 82945G/GZ/P/PL Memory Controller Hub
    +-01.0-[01-02]----00.0-[02]----04.0 Texas Instruments Device b002
    Texas Instruments Device b002 is dm6467T EVM on pci bus)
    
    
    Thanks 
  • Hi Hemant,

    The problem is not solved completely!

    I just only can reload those files three times,

    At the fourth time, I insmod failed after echo 1 > /sys/bus/pci/devices/0000\:00\:01.0/0000\:01
    \:00.0/0000\:02\:04.0/reset

    [dmesg:]
    [ 609.994622] Linux area mapped to 0xf9000000

    [ 609.996064] vmap allocation for size 7868416 failed: use vmalloc=<size> to increase size.
    [ 609.996783] Error: DDR2 memory could not be remapped
    [ 609.996909] ------------[ cut here ]------------
    [ 609.996922] WARNING: at /usr/src/packages/BUILD/kernel-desktop-2.6.37.1/linux-
    2.6.37/kernel/irq/manage.c:904 __free_irq+0x92/0x1c0()
    [ 609.996927] Hardware name: 945GCM-S2C
    [ 609.996929] Trying to free already-free IRQ 16
    [ 609.996932] Modules linked in: dm646x_pci_boot(+) edd cpufreq_conservative cpufreq_userspace
    cpufreq_powersave acpi_cpufreq mperf snd_pcm_oss snd_mixer_oss snd_seq snd_seq_device fuse dm_mod
    snd_hda_codec_realtek snd_hda_intel snd_hda_codec snd_hwdep snd_pcm snd_timer snd soundcore sr_mod cdrom
    ppdev parport_pc snd_page_alloc i2c_i801 iTCO_wdt iTCO_vendor_support r8101 shpchp pci_hotplug sg pcspkr
    parport i915 drm_kms_helper drm i2c_algo_bit button video fan processor thermal thermal_sys ata_generic
    [last unloaded: dm646x_pci_boot]
    [ 609.997002] Pid: 3966, comm: insmod Not tainted 2.6.37.1-1.2-desktop #1
    [ 609.997002] Call Trace:
    [ 609.997002] [<c02062a3>] try_stack_unwind+0x173/0x190
    [ 609.997002] [<c0204ebf>] dump_trace+0x3f/0xe0
    [ 609.997002] [<c020630b>] show_trace_log_lvl+0x4b/0x60
    [ 609.997002] [<c0206338>] show_trace+0x18/0x20
    [ 609.997002] [<c068d44a>] dump_stack+0x6d/0x72
    [ 609.997002] [<c02485a8>] warn_slowpath_common+0x78/0xb0
    [ 609.997002] [<c0248673>] warn_slowpath_fmt+0x33/0x40
    [ 609.997002] [<c02ac7b2>] __free_irq+0x92/0x1c0
    [ 609.997002] [<c02ac910>] free_irq+0x30/0x70
    [ 609.997002] [<f7a27cf6>] cleanup_module+0x62/0x259 [dm646x_pci_boot]
    [ 609.997002] [<f7a01711>] init_module+0x711/0x909 [dm646x_pci_boot]
    [ 609.997002] [<c0201203>] do_one_initcall+0x33/0x170
    [ 609.997002] [<c028127b>] sys_init_module+0x9b/0x1f0
    [ 609.997002] [<c0202f0c>] sysenter_do_call+0x12/0x22
    [ 609.997002] [<ffffe424>] 0xffffe424
    [ 609.997002] ---[ end trace cc2caf01195bae26 ]---
    [ 609.998534] Trying to free nonexistent resource <00000000d2800000-00000000d27fffff>
    [ 609.998966] Host device could not read the DM646x BAR registers

    I also find out a strange phenomena:

    there are three "dm646xpci"s in the character devices under /proc/devices

    That means the rmmod of driver doesn't remove the device in the /proc/devices

    I'm not sure this has relationship with the failure of the operation insmod.
     Jack
  • Jack,

    Can you have a look at the boot driver which was ported on recent kernels, see below:

    http://arago-project.org/git/people/?p=sneha/linux-davinci-staging.git;a=blob;f=drivers/char/dm646x_pci_targetdrv.c;h=09b7a021846443caeb8b989203c8738d06063629;hb=HEAD

    This code should already have some changes you made and more.

       Hemant

  • Hi Hemant,
     I get the code you mentioned.
     This time I can reload those files many times.
     But the strange phenomena still exists. There will be more and more "dm646xpci" in the /proc/devices.
    Jack
  • Hi Hemant,
     The reason for the strange phenomena is found:
    change  
     if(0 != (ret_val = alloc_chrdev_region(&dm646x_dev_id , 1, 0, DM646X_PCI_MODFILE)))
    to 
     if(0 != (ret_val = alloc_chrdev_region(&dm646x_dev_id , 0, 1, DM646X_PCI_MODFILE)))
     The key point is the second and third parameter.
     
     Jack
  • Jack,

    Thanks for the update. That indeed was incorrect order.

    We will update on Arago.

       Hemant

  •  Hemant,

    You'r welcome! 

    I acquired a lot from you and this forums.

    Jack