Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
220 views
in Technique[技术] by (71.8m points)

linux - Finding physical adresses of registers in memoryspace

I'm trying to the state of the PRM_RSTST register of my ARM Cortex A8 processor to find the reason of resets because WDIOC_GETBOOTSTATUS isn't implemented for my processor, a TI8148. I know for the datasheet that the offset/adress is supposed to be 0xA8. However if I try to read in in my kernel driver with __raw_readl(0xA8) I get a seg fault. The other idea I had was to use /dev/mem, however if I go in with devmem2 0xA8 I get

/dev/mem opened.Unhandled fault: Precise External Abort on non-linefetch (0x018) at 0x401270a8

Memory mapped at address 0x40127000.
Bus error (core dumped)

So I looked at the mapping of memory with cat /proc/iomem

00000000-00000000 : omap2-nand.0
08000000-08000003 : omap2-nand
20000000-2fffffff : pcie-nonprefetch
47400000-47400fff : usbss
47401000-474017ff : musb0
  47401000-474017ff : musb0
47401800-47401fff : musb1
  47401800-47401fff : musb1
48010000-480100ff : omap-iommu.1
  48010000-480100ff : omap-iommu.1
48020000-48021fff : omap_uart.0
  48020000-48021fff : omap_uart
48022000-48023fff : omap_uart.1
  48022000-48023fff : omap_uart
48024000-48025fff : omap_uart.2
  48024000-48025fff : omap_uart
48028000-48028fff : omap_i2c.1
  48028000-48028fff : omap_i2c
4802a000-4802afff : omap_i2c.2
  4802a000-4802afff : omap_i2c
48030100-480301ff : omap2_mcspi.1
  48030100-480301ff : omap2_mcspi.1
48032000-48032fff : omap_gpio.0
48038000-4803afff : mcasp
  48038000-4803afff : davinci-mcasp
4803c000-4803efff : mcasp
  4803c000-4803efff : davinci-mcasp
4804c000-4804cfff : omap_gpio.1
48080000-48081fff : omap2_elm.1
  48080000-48081fff : omap2_elm.1
480c0000-480c0fff : omap_rtc
  480c0000-480c0fff : omap_rtc
480c8000-480c8143 : omap-mailbox
48105500-481058ff : ti81xxvin
48105a00-48105dff : ti81xxvin
481a0100-481a01ff : omap2_mcspi.2
  481a0100-481a01ff : omap2_mcspi.2
481a2100-481a21ff : omap2_mcspi.3
  481a2100-481a21ff : omap2_mcspi.3
481a4100-481a41ff : omap2_mcspi.4
  481a4100-481a41ff : omap2_mcspi.4
481a6000-481a7fff : omap_uart.3
  481a6000-481a7fff : omap_uart
481a8000-481a9fff : omap_uart.4
  481a8000-481a9fff : omap_uart
481aa000-481abfff : omap_uart.5
  481aa000-481abfff : omap_uart
481ac000-481acfff : omap_gpio.2
481ae000-481aefff : omap_gpio.3
481c7000-481c7fff : omap_wdt
  481c7000-481c7fff : omap_wdt
481cc000-481cffff : d_can
  481cc000-481cffff : d_can
481d8100-481e80ff : mmci-omap-hs.0
  481d8100-481e80ff : mmci-omap-hs
49000000-49007fff : edma_cc0
  49000000-49007fff : edma
49800000-498003ff : edma_tc0
49900000-499003ff : edma_tc1
49a00000-49a003ff : edma_tc2
49b00000-49b003ff : edma_tc3
4a100000-4a1007ff : cpsw.0
  4a100000-4a1007ff : eth0
4a100800-4a1008ff : davinci_mdio.0
  4a100800-4a1008ff : davinci_mdio.0
4a100900-4a1009ff : cpsw.0
  4a100900-4a1009ff : eth0
4a140000-4a150fff : ahci.0
51000000-51003fff : pcie-regs
55082000-550820ff : omap-iommu.0
  55082000-550820ff : omap-iommu.0
80000000-bfffffff : pcie-inbound0
  80000000-917fffff : System RAM
    80044000-8058cfff : Kernel text
    8058e000-8061770f : Kernel data
  bd000000-bf7fffff : System RAM

So apparently 0x40127000, where devmem2 wants to look isn't mapped.

So where do I find the register with offset 0xA8?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...