8051 communication with other cores

Hello everyone! I was wondering how to communicate the 8051 core with C906B (Linux) and C906L (RTOS) via Mailbox. I’m working with SG2002, however, I suppose this could also be applicable to CV1800B. The RTC_MAILBOX interrupt source is specified in the TRM for A53, C906B, and C906L. Also, in the section on the 8051 subsystem, it says that the mailbox contains 4 information fields and 2 sets of spinlocks. According to Address Mapping, the base address of RTC_MAILBOX is 0x05024000 (belongs to the RTC domain). In the repository from milk-v for 8051, some registers are described in the mailbox.h file:

// cpu0 mbox interrupt control

reg_cpu0_mbox_en[3:0] (0x05024000[3:0])

reg_cpu0_int_msk[3:0] (0x05024018[3:0])

reg_cpu0_int_clr[3:0] (0x05024014[3:0])

reg_cpu0_int_en[3:0] (0x05024010[3:0])

//cpu1 mbox interrupt control

reg_cpu1_mbox_en[3:0] (0x05024000[19:16])

reg_cpu1_int_msk[3:0] (0x0502402c[3:0])

reg_cpu1_int_clr[3:0] (0x05024028[3:0])

reg_cpu1_int_en[3:0] (0x05024024[3:0])

// 32 bit Information field

reg_sys_mailbox_mbox0[31:0] (0x05024080)

reg_sys_mailbox_mbox1[31:0] (0x05024084)

reg_sys_mailbox_mbox2[31:0] (0x05024088)

reg_sys_mailbox_mbox3[31:0] (0x0502408c)

Unfortunately, that’s all I found. I assume cpu0 is A53, cpu1 is C906B (hence the first question: where is C906L and 8051?). It looks like reg_sys_mailbox_mbox(0-3) are those information fields. I tried to write arbitrary values in them via devmem from under the C906B and from the 8051, but their values did not change when reading after that.

By default, the registers contain the following values:

0x05024080 = 0x00000000

0x05024084 = 0x00000000

0x05024088 = 0x00020204

0x0502408C = 0x20210821

Also, it looks like registers 0x050240C0 and 0x050240C4 have some effect on reg_sys_mailbox_mbox0 (Re-writing resets them, perhaps this is spinlock?):

# devmem 0x05024080 32

0x00000000

# devmem 0x05024080 32 0x1

# devmem 0x05024080 32

0x00000000

# devmem 0x050240C0 32 0x1

# devmem 0x05024080 32

0x00000001

# devmem 0x050240C4 32 0x1

# devmem 0x05024080 32

0x00000003

# devmem 0x050240C0 32 0x1

# devmem 0x05024080 32

0x00000002

At the moment, I have not progressed beyond these experiments.

It would be nice to get more information about the purpose of RTC_MAILBOX registers and other undescribed memory locations. Perhaps someone knows more, or am I missing something altogether?