intel / FdtBusPkg

Device Tree-based Platform Device Driver Development for Tiano UEFI
https://wiki.riseproject.dev/display/HOME/EDK2_00_03+-+FdtBusDxe+support
11 stars 1 forks source link

Consider GetRegAttrs/SetRegAttrs #45

Closed andreiw closed 7 months ago

andreiw commented 7 months ago

A driver may wish to map a particular reg range with specific memory attributes. This should take into account https://github.com/intel/FdtBusPkg/issues/44.

andreiw commented 7 months ago

Also, the reg may actually be unmapped. In fact, code probably shouldn't assume it's mapped.

E.g:

FS0:> dtreg /soc/rtc@101000 0 Dumping 1 bytes at offset 0x0 of reg via CPU 0x101000(1000): !!!! RISCV64 Exception Type - 000000000000000D(EXCEPT_RISCV_LOAD_ACCESS_PAGE_FAULT) !!!!

Hiding this in FdtBusDxe without an explicit SetRegAttrs is probably not a great idea.

andreiw commented 7 months ago

GetReg issue is moved to https://github.com/intel/FdtBusPkg/issues/76 so not a high prio anymore.

andreiw commented 7 months ago

As per https://github.com/intel/FdtBusPkg/pull/78, the signature should be more along the lines of taking in a desired GCD type and memory attributes (and returning prior ones).

The obvious user here is HighMemDxe.