Tool/software: Linux
Hi
I'm using AM572x custom board
and, I use GPMC MRAM (Multiplex mode)
MRAM: MR4A16BCMA35
U-Boot Command(md, mw) is working.
But, Linux Application can not use it.
Test MRAM memory
[main] 99 Dev Open!
[main] 105 Mem Mapping for Phy -> Vir!Unhandled fault: asynchronous external abort (0x1211) at 0x00000000
content:
pgd = ece78680
[00000000] *pgd=ace38003, *pmd=fbbc5003
------------[ cut here ]------------
WARNING: CPU: 1 PID: 28 at drivers/bus/omap_l3_noc.c:147 l3_interrupt_handler+0x25c/0x368()
44000000.ocp:L3 Custom Error: MASTER MPU TARGET GPMC (Read): Data Access in User mode during Functional access
Bus error (core dumped)Modules linked in: cbc jitterentropy_rng drbg virtio_rpmsg_bus xfrm_user xfrm4_tunnel prueth ipcomp xfrm_ipcomp esp4 bluetooth ah4 pru_rproc af_key xfrm_algo ecb pruss_intc sha512_generic extcon_usb_gpio sha512_arm sha256_generic hmac md5 sha1_generic sha1_arm_neon pvrsrvkm(O) sha1_arm omap_aes_driver omap_sham pruss omap_wdt extcon gpio_pisosr rtc_ds1307 omap_des omap_rng rng_core debugss_kmodule(O) omap_remoteproc remoteproc virtio virtio_ring sch_fq_codel uio_module_drv(O) uio gdbserverproxy(O) cryptodev(O) cmemk(O)
CPU: 1 PID: 28 Comm: irq/23-l3-app-i Tainted: G O 4.4.19-rt25-gf572d285f0 #95
Hardware name: Generic DRA74X (Flattened Device Tree)
Backtrace:
[<c0013b44>] (dump_backtrace) from [<c0013d40>] (show_stack+0x18/0x1c)
r7:c03009c4 r6:20010113 r5:00000000 r4:c095fcc4
[<c0013d28>] (show_stack) from [<c02d2c84>] (dump_stack+0x8c/0xa0)
[<c02d2bf8>] (dump_stack) from [<c0035fd4>] (warn_slowpath_common+0x88/0xb8)
r7:c03009c4 r6:00000093 r5:00000009 r4:ee651e28
[<c0035f4c>] (warn_slowpath_common) from [<c003603c>] (warn_slowpath_fmt+0x38/0x40)
r8:00000017 r7:c0842cdc r6:00000002 r5:c0842d9c r4:c0842e40
[<c0036008>] (warn_slowpath_fmt) from [<c03009c4>] (l3_interrupt_handler+0x25c/0x368)
r3:ee61f680 r2:c0842e40
r4:80080003
[<c0300768>] (l3_interrupt_handler) from [<c00839ac>] (irq_forced_thread_fn+0x28/0x7c)
r10:c0083984 r9:ee61fbc0 r8:ee60c900 r7:00000001 r6:00000000 r5:ee60c900
r4:ee61fbc0
[<c0083984>] (irq_forced_thread_fn) from [<c0083d14>] (irq_thread+0x124/0x1f8)
r7:00000001 r6:00000000 r5:ee650000 r4:ee61fbe4
[<c0083bf0>] (irq_thread) from [<c0050c64>] (kthread+0xe4/0xfc)
r10:00000000 r9:00000000 r8:00000000 r7:c0083bf0 r6:ee61fbc0 r5:ee61fc00
r4:00000000
[<c0050b80>] (kthread) from [<c0010710>] (ret_from_fork+0x14/0x24)
r7:00000000 r6:00000000 r5:c0050b80 r4:ee61fc00
---[ end trace 0000000000000002 ]---
const unsigned int mem_address = 0x01000000;
const unsigned int mem_size = 0x01000000;
mem_dev = open("/dev/mem", O_RDWR | O_SYNC);
printf("[%s] %d Dev Open!\n", __FUNCTION__, __LINE__);
virt_addr = mmap(NULL, mem_size, PROT_READ | PROT_WRITE, MAP_SHARED, mem_dev, mem_address);
if(virt_addr == MAP_FAILED)
printf("[%s] %d Error mmap", __FUNCTION__, __LINE__);
else
printf("[%s] %d Mem Mapping for Phy -> Vir!\n", __FUNCTION__, __LINE__);
printf("content: \n");
for (i=0; i<100; i++)
{
printf("[%03d]0x%02x ",i,*(char *)(virt_addr+i));
*((char *)virt_addr+i) = i;
if(i%10 == 0)
printf("\n");
}
printf("\n");
Pinmux
//GPMC MRAM
{GPMC_A1, (M0 | PIN_OUTPUT | MANUAL_MODE)}, /* gpmc_a1.vin4b_d1 */
{GPMC_A2, (M0 | PIN_OUTPUT | MANUAL_MODE)}, /* gpmc_a2.vin4b_d2 */
{GPMC_A3, (M0 | PIN_OUTPUT | MANUAL_MODE)}, /* gpmc_a3.vin4b_d3 */
{GPMC_A4, (M0 | PIN_OUTPUT | MANUAL_MODE)}, /* gpmc_a4.vin4b_d4 */
{GPMC_OEN_REN, (M0 | PIN_INPUT_PULLUP)}, /* gpmc_oen_ren.gpio2_24 */
{GPMC_WEN, (M0 | PIN_INPUT_PULLUP)}, /* gpmc_wen.gpio2_25 */
{GPMC_BEN0, (M0 | PIN_INPUT_PULLDOWN)}, /* gpmc_ben0.gpio2_26 */
{GPMC_BEN1, (M0 | PIN_INPUT_PULLDOWN)}, /* gpmc_ben1.gpio2_27 */
{GPMC_WAIT0, (M0 | PIN_INPUT_PULLUP)}, /* gpmc_wait0.gpio2_28 */
{GPMC_CS3, (M0 | PIN_INPUT_PULLDOWN)}, /* gpmc_cs3.vin3a_clk0 */
{GPMC_ADVN_ALE, (M0 | PIN_INPUT_PULLUP)}, /* gpmc_advn_ale.gpio2_23 */
{GPMC_AD0, (M0 | PIN_INPUT_PULLUP | MANUAL_MODE)}, /* gpmc_ad0.vin3a_d0 */
{GPMC_AD1, (M0 | PIN_INPUT_PULLUP | MANUAL_MODE)}, /* gpmc_ad1.vin3a_d1 */
{GPMC_AD2, (M0 | PIN_INPUT_PULLUP | MANUAL_MODE)}, /* gpmc_ad2.vin3a_d2 */
{GPMC_AD3, (M0 | PIN_INPUT_PULLUP | MANUAL_MODE)}, /* gpmc_ad3.vin3a_d3 */
{GPMC_AD4, (M0 | PIN_INPUT_PULLUP | MANUAL_MODE)}, /* gpmc_ad4.vin3a_d4 */
{GPMC_AD5, (M0 | PIN_INPUT_PULLUP | MANUAL_MODE)}, /* gpmc_ad5.vin3a_d5 */
{GPMC_AD6, (M0 | PIN_INPUT_PULLUP | MANUAL_MODE)}, /* gpmc_ad6.vin3a_d6 */
{GPMC_AD7, (M0 | PIN_INPUT_PULLUP | MANUAL_MODE)}, /* gpmc_ad7.vin3a_d7 */
{GPMC_AD8, (M0 | PIN_INPUT_PULLUP | MANUAL_MODE)}, /* gpmc_ad8.vin3a_d8 */
{GPMC_AD9, (M0 | PIN_INPUT_PULLUP | MANUAL_MODE)}, /* gpmc_ad9.vin3a_d9 */
{GPMC_AD10, (M0 | PIN_INPUT_PULLUP | MANUAL_MODE)}, /* gpmc_ad10.vin3a_d10 */
{GPMC_AD11, (M0 | PIN_INPUT_PULLUP | MANUAL_MODE)}, /* gpmc_ad11.vin3a_d11 */
{GPMC_AD12, (M0 | PIN_INPUT_PULLUP | MANUAL_MODE)}, /* gpmc_ad12.vin3a_d12 */
{GPMC_AD13, (M0 | PIN_INPUT_PULLUP | MANUAL_MODE)}, /* gpmc_ad13.vin3a_d13 */
{GPMC_AD14, (M0 | PIN_INPUT_PULLUP | MANUAL_MODE)}, /* gpmc_ad14.vin3a_d14 */
{GPMC_AD15, (M0 | PIN_INPUT_PULLUP | MANUAL_MODE)}, /* gpmc_ad15.vin3a_d15 */
U-Boot GPMC Reg Define mem.h
#define STNOR_GPMC_CONFIG1 0x01801203
#define STNOR_GPMC_CONFIG2 0x001f1f00
#define STNOR_GPMC_CONFIG3 0x001f1f01
#define STNOR_GPMC_CONFIG4 0x1f011f01
#define STNOR_GPMC_CONFIG5 0x001d1f1f
#define STNOR_GPMC_CONFIG6 0x08070280
#define STNOR_GPMC_CONFIG7 0x00000F41
My Development Environment
Host PC OS: Ubuntu 16.04 linux 64bit
AM5728 SDK: u-boot-2016.05 / linux-rt-4.4.19
AM5728 SDK Ver: ti-processor-sdk-linux-rt-am57xx-evm-03.01.00.06
IPC: ipc_3_43_02_04
XDC: xdctools_3_32_00_06_core
Thanks and best regards.
John.