Robert,

The issue seems to be here: 1048577 = 0x100001
./readwritegpp readwrite.out 2409627648 1048577 1

The readwrite sample internally does the following:
Passed address is used for write (ARM->DSP): 2409627648 = 0x8FA00000
For read (DSP->ARM), the address used is: (Write address + buffer size)
= 0x8FA00000 + 0x100001

This means that the address range used for read is: 0x8FB00001 ->
0x8FC00001 (inclusive).
The address range used for write is: 0x8FA00000 -> 0x8FB00000
(inclusive)

Now, what this means, is that it expects that the two regions configured
in physical memory (WRITEMEM & READMEM) are also contiguous in user &
kernel memory, since 0x8FC00001 falls into the second region (and
addresses are used as ptr++). However, the mappings are likely not
actually contiguous in user & kernel memory, since they are separately
made.

To see actual behavior, you can use the following command to use 2MB
buffer. This will ensure that the readmem falls completely into the
second mapped region:
./readwritegpp readwrite.out 2409627648 2097152 1

OR

You can modify readwrite example implementation to actually use the two
separate regions of memory for write & read. Instead of using dspAddr2 =
(dspAddress + bufferSize), use separate readmem address also passed in
to the application as a second command line parameter.

Regards,
Mugdha 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Robert Kuhn
Sent: Wednesday, February 13, 2008 2:23 PM
To: [email protected]
Subject: Re: dsp-link - readwrite-example: DSP address>

[resend - first and second posting does not came through gmane?] [Sorry
if multiple posts!]

I wrote:

> [EMAIL PROTECTED]:/mnt/home# ./readwritegpp

> readwrite.out 2411724800 1048576 1

I just tried to reserve 2M for READMEM and 2M for WRITEMEM

CFG_Davinci_DM6446.c:
   {
      6,                     /* ENTRY          : Entry number */
      "WRITEMEM",            /* NAME           : Name of the memory
      region */
      0x8FA00000,            /* ADDRPHYS       : Physical address */
      0x8FA00000,            /* ADDRDSPVIRT    : DSP virtual address*/
      (Uint32) -1,           /* ADDRGPPVIRT    : GPP virtual address(if
      known) */
      0x200000,              /* SIZE           : Size of the
      memoryregion */
      FALSE                  /* SHARED         : Shared access memory?*/
   },
   {
      7,                     /* ENTRY          : Entry number */
      "READMEM",             /* NAME           : Name of the memory
      region */
      0x8FC00000,            /* ADDRPHYS       : Physical address */
      0x8FC00000,            /* ADDRDSPVIRT    : DSP virtual address*/
      (Uint32) -1,           /* ADDRGPPVIRT    : GPP virtual address (if
      known) */
      0x200000,              /* SIZE           : Size of the
      memoryregion */
      FALSE                  /* SHARED         : Shared access memory?
      */
   }
   

dsplink-davinci-base.tci:
        var WRITEMEM= prog.module("MEM").create("WRITEMEM");
        WRITEMEM.base             = 0x8FA00000;
        WRITEMEM.len              = 0x200000;
        WRITEMEM.createHeap       = false;
        WRITEMEM.comment          = "WRITEMEM";ADMEM

        var READMEM= prog.module("MEM").create("READMEM");
        READMEM.base             = 0x8FC00000;
        READMEM.len              = 0x200000;
        READMEM.createHeap       = false;
        READMEM.comment          = "READMEM";   


bootargs: mem=116M

[EMAIL PROTECTED]:/mnt/home# ./readwritegpp readwrite.out 2409627648
1048577 1
gives:
Unable to handle kernel paging request at virtual address c7d80000 pgd =
c5440000 [c7d80000] *pgd=85495011, *pte=00000000, *ppte=00000000
Internal error: Oops: 807 [#1] Modules linked in: dsplinkk
CPU: 0
PC is at DSP_write+0xbc/0xe4 [dsplinkk]
LR is at 0x100001
pc : [<bf005338>]    lr : [<00100001>]    Tainted: PF
sp : c5447e8c  ip : 8fa00000  fp : c5447ea8
r10: c5446000  r9 : 00000000  r8 : 8fb00001
r7 : 00008000  r6 : 40ac4008  r5 : 00100001  r4 : 00000000
r3 : 00000000  r2 : 000fffff  r1 : c7870150  r0 : c7d80000
Flags: Nzcv  IRQs on  FIQs on  Mode SVC_32  Segment kernel
Control: 5317F  Table: 85440000  DAC: 00000017 Process readwritegpp
(pid: 1066, stack limit = 0xc54461a0)
Stack: (0xc5447e8c to 0xc5448000)
7e80:                            00100001 bf01776c 00000000 00000001
c5447ed0
7ea0: c5447eac bf00b164 bf00528c 409c4008 00006c0c 00000000 c5447ef4
befffb18
7ec0: 00008000 c5447ee4 c5447ed4 bf0015c0 bf00b0fc 409c4008 c5447f34
c5447ee8
7ee0: bf000518 bf0015b0 c006e1dc c006db18 c5539b10 00008000 00000000
8fb00001
7f00: 00100001 409c4008 00000000 c6bb9080 ffffffe7 00006c0c befffb18
c002b154
7f20: c5446000 00900036 c5447f54 c5447f38 c0091fcc bf0000ac c6bb9080
befffb18
7f40: 00000003 00000000 c5447f7c c5447f58 c00922d4 c0091f60 c00448b0
00000817
7f60: c6bb9080 fffffff7 00006c0c 00000036 c5447fa4 c5447f80 c0092334
c0091ff0
7f80: c00330f4 00000001 c02215e0 4003a6d8 4001ee10 00008d14 00000000
c5447fa8
7fa0: c002a9c0 c0092304 4003a6d8 4001ee10 00000003 00006c0c befffb18
00019008
7fc0: 4003a6d8 4001ee10 00008d14 00000000 00000000 00000000 40142000
befffb14
7fe0: 00018144 befffac0 0000db70 400e3344 80000010 00000003 e3c52102
e1a02a22
Backtrace:
[<bf00527c>] (DSP_write+0x0/0xe4 [dsplinkk]) from [<bf00b164>]
(LDRV_PROC_write+ 0x78/0xbc [dsplinkk])
 r7 = 00000001  r6 = 00000000  r5 = BF01776C  r4 = 00100001 [<bf00b0ec>]
(LDRV_PROC_write+0x0/0xbc [dsplinkk]) from [<bf0015c0>] (PMGR_PROC_
write+0x20/0x24 [dsplinkk])
 r8 = 00008000  r7 = BEFFFB18  r6 = C5447EF4  r5 = 00000000
 r4 = 00006C0C
[<bf0015a0>] (PMGR_PROC_write+0x0/0x24 [dsplinkk]) from [<bf000518>]
(DRV_Ioctl+
0x47c/0x768 [dsplinkk])
[<bf00009c>] (DRV_Ioctl+0x0/0x768 [dsplinkk]) from [<c0091fcc>]
(do_ioctl+0x7c/0
x90)
[<c0091f50>] (do_ioctl+0x0/0x90) from [<c00922d4>]
(vfs_ioctl+0x2f4/0x314)
 r7 = 00000000  r6 = 00000003  r5 = BEFFFB18  r4 = C6BB9080 [<c0091fe0>]
(vfs_ioctl+0x0/0x314) from [<c0092334>]
(sys_ioctl+0x40/0x64)
 r7 = 00000036  r6 = 00006C0C  r5 = FFFFFFF7  r4 = C6BB9080 [<c00922f4>]
(sys_ioctl+0x0/0x64) from [<c002a9c0>]
(ret_fast_syscall+0x0/0x2c)
 r6 = 00008D14  r5 = 4001EE10  r4 = 4003A6D8
Code: e3a02000 e1520005 2a000004 e4d63001 (e4c03001)

I do not see my error. Where it is?

Bye - Robert
--
  Robert Kuhn
  [EMAIL PROTECTED]

--
http://www.fastmail.fm - One of many happy users:
  http://www.fastmail.fm/docs/quotes.html

_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to