Tool/software:
Hello,
I'm trying to make use of the default GPMC driver (omap-gpmc.c) in order to interface some hardware to the GPMC. As far as I understood, the omap-gpmc driver is somewhat dedicated to interfacing things like NAND- or NOR-Flashes, which is not what I intend to do. However, the omap-gpmc driver seems as a very good starting point and I'd try to exploit most of the default function here.
Right now I'm struggling to assign address windows to individual ChipSelects.
My entry within the device tree file is looking like that right now:
&gpmc0 {
pinctrl-names = "default";
pinctrl-0 = <&gpmc0_pins_default>;
assigned-clocks = <&k3_clks 80 0>;
assigned-clock-parents = <&k3_clks 80 1>;
assigned-clock-rates = <66666667>;
//assigned-clock-rates = <100000000>;
gpmc,num-cs = <4>;
ranges = <0 0 0x00 0x50000000 0x01000000>, /* CS0 space. Min partition = 16MB */
<1 0 0x00 0x51000000 0x01000000>, /* CS1 space. Min partition = 16MB */
<2 0 0x00 0x52000000 0x01000000>, /* CS2 space. Min partition = 16MB */
<3 0 0x00 0x53000000 0x01000000>; /* CS3 space. Min partition = 16MB */
status = "okay";
};
So there are 4 windows, each 16MiB in size, assigned to ChipSelects 0, 1, 2, and 3 starting at the given adresses (which are within the GPMC data window, of course).
I'm not sure whether this is needed, but I did also add that line gpmc,num-cs = <4>; in order to signal that there are four ChipSelects available.
When I'm building the device tree (make linux-dtbs) and boot with it, dmesg | grep gpmc is showing me the following:
[ 1.154690] omap-gpmc 3b000000.memory-controller: GPMC revision 6.0
[ 1.161173] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000
The first line is ok and is indicating that the omap-gpmc is running, while the second line is highly questionable to me.
Firstly, why it is writing disabling cs 0? Secondly, what does that 0x0-0x1000000 mean - it should report 0x51000000-0x51000000? And thirdly what about the remaining three ChipSelects?
There is also some question about what that third entry within each range-entry does mean, actually. I checked the Linux documentation regarding the device tree settings for omap-gpmc, which is also available here:
www.kernel.org/.../omap-gpmc.txt
According to that documentation, a range tuple has to have the form:
<cs-number> 0 <physical address of mapping> <size>
When I try that format, I receive a warning during device tree compilation.
The format I did use above with that additional 0x00 parameter I did actually copy from the default device tree file where there is a single ChipSelect assignment present that is looking like:
ranges = <0 0 0x00 0x51000000 0x01000000>; /* CS0 space. Min partition = 16MB */
Btw., this default setting is also showing me disabling cs 0...
I did not yet dig deeper into omap-gpmc.c in order to possibly find out what is going on there. Perhaps there are some simple solutions here. In general, it seems rather difficult to find some exemplary documentations about the GPMC module.
Thanks for any insights,
Mario