GPMC does not show up in /proc/iomem

Hi,

I’m trying to interface a FIFO with my BBB. I want to use the GPMC to read the data out.

I did the following:

  • Disabled the onboard eMMC
  • compiled the appended devicetree overlay[2] and copied it to /lib/firmware/GPMCMY-ITER-00A0.dtbo
  • enabled the overlay: echo “GPMCMY-ITER:00A0” > /sys/devices/platform/bone_capemgr/slots (dmesg: [3])

After enabling, /proc/iomem shows one additional line:

`
50000000-50001fff : /ocp/gpmc@50000000

`

As far as I understand, this is only the configuration registers of the GPMC and not the actual memory. Other posts here and at e2e mention “the memory showing up in /proc/iomem”, but I found no actual example of what would be expected there.

However, reading from 0x 01 00 00 00 with devmem2 reads 255 after enabling and results in kernel errors when the module is not loaded [4], so “something” got enabled there.

  1. What kind of line would be expected in /proc/iomem for a working configuration?
  2. Can anyone provide me with a minimal example overlay that will work on the current IoT image[1] (don’t care about actual memory type, I can iteratively get to what I need, I guess)? So far I found no overlay code for gpmc that worked right out of the box.
  3. May this be caused by the relatively new kernel (4.x)?
  4. Are there any ideas for further troubleshooting?

[1]
$ uname -a

`
Linux rammsbone_debian 4.4.36-ti-r72 #1 SMP Wed Dec 7 22:29:53 UTC 2016 armv7l GNU/Linux

`

[2] GPMCMY-ITER-00A0.dts

`
/dts-v1/;
/plugin/;

/ {
compatible = “ti,beaglebone”, “ti,beaglebone-black”, “ti,beaglebone-green”;

/* identification */
part-number = “GPMCMY-ITER”;
version = “00A0”;

/* state the resources this cape uses /
exclusive-use =
/
the pin header uses /
“P8.25”, /
gpmc: gpmc_ad0 /
“P8.24”, /
gpmc: gpmc_ad1 /
“P8.5”, /
gpmc: gpmc_ad2 /
“P8.6”, /
gpmc: gpmc_ad3 /
“P8.23”, /
gpmc: gpmc_ad4 /
“P8.22”, /
gpmc: gpmc_ad5 /
“P8.3”, /
gpmc: gpmc_ad6 /
“P8.4”, /
gpmc: gpmc_ad7 /
“P8.19”, /
gpmc: gpmc_ad8 /
“P8.13”, /
gpmc: gpmc_ad9 /
“P8.14”, /
gpmc: gpmc_ad10 /
“P8.17”, /
gpmc: gpmc_ad11 /
“P8.12”, /
gpmc: gpmc_ad12 /
“P8.11”, /
gpmc: gpmc_ad13 /
“P8.16”, /
gpmc: gpmc_ad14 /
“P8.15”, /
gpmc: gpmc_ad15 /
“P9.12”, /
gpmc: gpmc_ben1 /
“P8.21”, /
gpmc: gpmc_csn1 /
“P8.18”, /
gpmc: gpmc_clk /
“P8.7”, /
gpmc: gpmc_advn_ale /
“P8.8”, /
gpmc: gpmc_oen_ren /
“P8.10”, /
gpmc: gpmc_wen /
“P8.9”, /
gpmc: gpmc_ben0_cle /
“P9.28”, /
BB_SPI_SS /
“P9.29”, /
BB_SPI_MISO /
“P9.30”, /
BB_SPI_MOSI /
“P9.31”, /
BB_SPI_SCK /
“gpmc”;
/
“eMMC_RSTn”;// the reset pin / / uncomment for use under Kernel 3.8.13 */

#address-cells = <1>;
#size-cells = <1>;

fragment@0 {
target = <&am33xx_pinmux>;
overlay {

gpmc_pins: pinmux_gpmc_pins {
pinctrl-single,pins = <
0x000 0x30 /* gpmc_ad0.gpmc_ad0 MODE0 | INPUT | PULLUP /
0x004 0x30 /
gpmc_ad1.gpmc_ad1 MODE0 | INPUT | PULLUP /
0x008 0x30 /
gpmc_ad2.gpmc_ad2 MODE0 | INPUT | PULLUP /
0x00C 0x30 /
gpmc_ad3.gpmc_ad3 MODE0 | INPUT | PULLUP /
0x010 0x30 /
gpmc_ad4.gpmc_ad4 MODE0 | INPUT | PULLUP /
0x014 0x30 /
gpmc_ad5.gpmc_ad5 MODE0 | INPUT | PULLUP /
0x018 0x30 /
gpmc_ad6.gpmc_ad6 MODE0 | INPUT | PULLUP /
0x01C 0x30 /
gpmc_ad7.gpmc_ad7 MODE0 | INPUT | PULLUP /
0x020 0x30 /
gpmc_ad8.gpmc_ad8 MODE0 | INPUT | PULLUP /
0x024 0x30 /
gpmc_ad9.gpmc_ad9 MODE0 | INPUT | PULLUP /
0x028 0x30 /
gpmc_ad10.gpmc_ad10 MODE0 | INPUT | PULLUP /
0x02C 0x30 /
gpmc_ad11.gpmc_ad11 MODE0 | INPUT | PULLUP /
0x030 0x30 /
gpmc_ad12.gpmc_ad12 MODE0 | INPUT | PULLUP /
0x034 0x30 /
gpmc_ad13.gpmc_ad13 MODE0 | INPUT | PULLUP /
0x038 0x30 /
gpmc_ad14.gpmc_ad14 MODE0 | INPUT | PULLUP /
0x03C 0x30 /
gpmc_ad15.gpmc_ad15 MODE0 | INPUT | PULLUP /
0x080 0x08 /
gpmc_cscn1.gpmc_cscn1 MODE0 | OUTPUT /
0x08C 0x28 /
gpmc_clk.gpmc_clk MODE0 | INPUT - this is the fed back clk, so it has to be input!/
0x090 0x08 /
gpmc_advn_ale.gpmc_advn_ale MODE0 | OUTPUT /
0x094 0x08 /
gpmc_oen_ren.gpmc_oen_ren MODE0 | OUTPUT /
0x098 0x08 /
gpmc_wen.gpmc_wen MODE0 | OUTPUT /
0x09C 0x08 /
gpmc_ben0_cle.gpmc_ben0_cle MODE0 | OUTPUT /
0x078 0x08 /
gpmc_ben1_cle.gpmc_ben1_cle MODE0 | OUTPUT */

;
};
};
};

fragment@1 {
target = <&gpmc>;
/depth = <1>;/ /* only create devices on depth 1 */

/* stupid warnings */
#address-cells = <1>;
#size-cells = <1>;

overlay {

status = “okay”;

#address-cells = <2>;
#size-cells = <1>;

pinctrl-names = “default”;
pinctrl-0 = <&gpmc_pins>;

/* chip select ranges */
ranges = <1 0 0x01000000 0x01000000>; /*CS number, child offset (=0), addr, size /
/
this maps the CS1 memory to physical 0x01 00 00 00 */

nor {
compatible = “rammsbone”;
/* only nand, onenand, ethernet, nor supported https://e2e.ti.com/support/arm/sitara_arm/f/791/p/315716/1533758 */
status = “okay”;
pinctrl-names = “default”;

/reset = <&rstctl 0 0>;/ /* uncomment for use under Kernel 3.8.13 /
/reset-names = “eMMC_RSTn-LOGIBONE”;/ /
uncomment for use under Kernel 3.8.13 */

reg = <1 0 0x01000000>; /CSn1/ /* CS number, offset from base of chip select, length */

/* CONFIG1 /
bank-width = <2>; /
GPMC_CONFIG1_DEVICESIZE(1) /
/gpmc,burst-write;/
/gpmc,burst-read;/
/gpmc,burst-wrap;/
gpmc,sync-read; /
GPMC_CONFIG1_READTYPE_ASYNC /
gpmc,sync-write; /
GPMC_CONFIG1_WRITETYPE_ASYNC /
gpmc,clk-activation-ns = <0>; /TODO/ /
GPMC_CONFIG1_CLKACTIVATIONTIME(2) /
/gpmc,burst-length = <16>;/ /TODO/ /
GPMC_CONFIG1_PAGE_LEN(2) /
gpmc,mux-add-data = <0>; /
0 non-multiplexed, 1 AAD, 2 ad, 3 reserved/* GPMC_CONFIG1_MUXTYPE(2) */

/* CONFIG2 */
gpmc,sync-clk-ps = <20000>;
gpmc,cs-on-ns = <0>;
gpmc,cs-rd-off-ns = <100>;
gpmc,cs-wr-off-ns = <40>;

/* CONFIG3 */
gpmc,adv-on-ns = <0>;
gpmc,adv-rd-off-ns = <20>;
gpmc,adv-wr-off-ns = <20>;

/* CONFIG4 */
gpmc,we-on-ns = <20>;
gpmc,we-off-ns = <40>;
gpmc,oe-on-ns = <20>;
gpmc,oe-off-ns = <100>;

/* CONFIG 5 */
/gpmc,page-burst-access-ns = <20>;/
gpmc,access-ns = <80>;
gpmc,rd-cycle-ns = <120>;
gpmc,wr-cycle-ns = <60>;

/* CONFIG 6 /
gpmc,wr-access-ns = <40>;
gpmc,wr-data-mux-bus-ns = <20>;
/gpmc,bus-turnaround-ns = <40>;/ /
CONFIG6:3:0 = 4 /
/gpmc,cycle2cycle-samecsen;/ /
CONFIG6:7 = 1 /
/gpmc,cycle2cycle-delay-ns = <40>;/ /
CONFIG6:11:8 = 4 */

/* not using dma engine yet, but we can get the channel number here */
dmas = <&edma 20>;
dma-names = “logibone”;
};

};
};
};

`

[3]dmesg (snipped)

`
[ 41.941558] bone_capemgr bone_capemgr: part_number ‘GPMCMY-ITER’, version ‘00A0’
[ 41.941598] bone_capemgr bone_capemgr: slot #4: override
[ 41.941616] bone_capemgr bone_capemgr: Using override eeprom data at slot 4
[ 41.941633] bone_capemgr bone_capemgr: slot #4: ‘Override Board Name,00A0,Override Manuf,GPMCMY-ITER’
[ 41.964732] omap-gpmc 50000000.gpmc: GPMC revision 6.0
[ 41.964767] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000
[ 41.969799] bone_capemgr bone_capemgr: slot #4: dtbo ‘GPMCMY-ITER-00A0.dtbo’ loaded; overlay id #0

`

[4]dmesg (read without module)

`
[ 58.863607] Unhandled fault: external abort on non-linefetch (0x1018) at 0xb6f77000
[ 58.871366] pgd = db770000
[ 58.874103] [b6f77000] *pgd=9c548831, *pte=01000303, *ppte=01000a33

`