Tool/software: Linux
Hello,
I would like to report some issues with the icss-emac-lld-test application at first, but I still have some questions about the dts I cloned from am335x-pru-uio.dtsi.
I am on a yocto-sumo setup using the meta-ti repository on the thud branch.
I tried to get icss-emac-lld-test up and running on my custom board. At first the application consistently crashed with a segmentation fault. I checked with valgrind and found an issue in the icss-emac-lld driver itself (src/icss_emacDrv.c) and another one in the test program (test/src/test_common_utils.c). There have been used some memory cells without initialization (random content). I would supply patches suitable for "git am" but I don't know how to append these to this forum post. After applying these patches my self-built icss_emacMainTest_am335x.out doesn't crash any more.
But I still have a problem to understand the dts file I needed to create for my custom board. I'm using the uio-module-drv to access the PRU from user space. I derived my custom dts from the am335x-pru-uio.dtsi of the yocto meta-ti layer here: 
The part of the file (quoted below) which I don't understand is the base address and size allocation for the OCMC RAM of the am335x device:
uio_pruss_mem2: uio_pruss_mem2 {
compatible = "ti,uio-module-drv";
mem = <0x4a328000 0xd4>,
<0x4a330000 0x174>,
<0x4a332400 0x90>,
<0x40302000 0x0e000>;
mem-names = "uart", "ecap", "mdio", "ocmc";
status = "okay";
};
This assigns a base address for the OCMC of 0x2000 bytes above the real hardware address and cuts the size down from the real 0x10000 to 0xE000. I would suspect that this a bug. Especially when I'm looking at the line below in firmware/icss_dualemac/config/icss_emacFwConfig.h of the icss-emac driver package, which is beyond the size of 0xe000:
#define ICSS_EMAC_FW_P0_COL_BUFFER_OFFSET (0xEE00U) /* 1536 byte collision buffer for port 0 send queue */
And the icss_emacFwDynamicCfg structure from icss_emacFwConfig.c is used unchanged in the icss-emac-lld-test application. Therefore I think the line for the memory configuration for OCMC should supply a base address of 0x40300000 and a size of 0x10000. This configuration I used successfully.
Please advise which version I should use and why.
Best regards,
Stefan Mätje