Configuring WEIM to work with PC-104 bus on Colibri iMX7D

A customer is trying to use the external memory bus on the Colibri iMX7D to interface with a PC-104-like bus.

He’s configured the WEIM registers according to the i.MX 7Dual reference manual:

CS0GCR1 reset = 0001_0080h
CS0GCR1 = 0x00210089
0000-0000-0010 0001-0000-0000-1000-1001
0     CSEN: CS Enable
1     SWR: Synchronous Write Data
2     SRD: Synchronous Read Data
3     MUM: Multiplexed Mode
4     WFL: Write Fix Latency
5     RFL: Read Fix Latency
6     CRE: Configuration Register Enable
7     CREP: Configuration Register Enable Polarity
10-8  BL: Burst Length
11    WC: Write Continuous
13-12 BCD: Burst Clock Divisor
15-14 BCS: Burst Clock Start
18-16 DSZ: Data Port Size
19    SP: Supervisor Protect
22-20 CSREC: CS Recovery
23    AUS: Address UnShifted
26-24 GBC: Gap Between Chip Selects
27    WP: Write Protect
31-28 PSZ: Page Size
    
CS0GCR2 reset = 0000_1000h
CS0GCR2 = 0x00001130
0000-0000-0000 0000-0001-0001-0011-0000
1-0   ADH: Address hold time
3-2   Reserved: This read-only field is reserved and always has the value 0.
7-4   DAPS: Data Acknowledge Poling Start.
8     DAE: Data Acknowledge Enable.
9     DAP: Data Acknowledge Polarity.
11-10 Reserved: This read-only field is reserved and always has the value 0.
12    MUX16_BYP_GRANT: Muxed 16 bypass grant.
31-13 Reservado: This read-only field is reserved and always has the value 0.

CS0RCR1 reset = 0000_0000h
CS0RCR1 = 0x0e291111
0000-1110-0010 1001-0001-0001-0001-0001
2-0   RCSN:
3     Reservado: This read-only field is reserved and always has the value 0.
6-4   RCSA:
7     Reservado: This read-only field is reserved and always has the value 0.
10-8  OEN:
11    Reservado: This read-only field is reserved and always has the value 0.
14-12 OEA:
15    Reservado: This read-only field is reserved and always has the value 0.
18-16 RADVN:
19    RAL:
22-20 RADVA:
15    Reservado: This read-only field is reserved and always has the value 0.
29-24 RWSC:
31-30 Reservado: This read-only field is reserved and always has the value 0.


CS0RCR2 reset = 0000_0000h
CS0RCR2 = 0x00000000 
0000-0000-0000 0000-0000-0000-0000-0000
2-0   RBEN:
3     RBE:
6-4   RBEA:
7     Reservado: This read-only field is reserved and always has the value 0.
9-8   RL:
11-10 Reservado: This read-only field is reserved and always has the value 0.
14-12 PAT:
15    APR:
31-16 Reservado: This read-only field is reserved and always has the value 0.


CS0WCR1 reset = 0000_0000h
CS0WCR1 = 0xc7249249
1100-0111-0010 0100-1001-0010-0100-1001
2-0   WCSN:
5-3   WCSA:
8-6   WEN:
11-9  WEA:
14-12 WBEN:
17-15 WBEA:
20-18 WADVN:
23-21 WADVA:
29-24 WWSC:
30    WBED:
31    WAL:


CS0WCR2 reset = 0000_0000h
CS0WCR2 = 0x00000000
0000-0000-0000 0000-0000-0000-0000-0000
0     WBCDD: Write Burst Clock Divisor Decremen
31-1  Reservado: This read-only field is reserved and always has the value 0.

Customer says that after applying these settings to the device tree, the WE# signal doesn’t show up on the write cycle.

He mentions table 9-31, which suggest some settings to configure WEIM on Intel mode:
Table 9-31. Intel Mode pin connections
Arm platform Pin EIM Pin Notes
ADS# IPP_DO_ADV_B WAL = 1,RAL = 1
W/R IPP_DO_BE_B WBED = 1
WR# WE#
RD# OE#

Any clue on how to get this bus working with a PC-ISA or PC-104-like bus with OE, WR and CS signals?

I’m currently trying to get more info regarding the device tree and the application itself.

Customer has managed to make it work so the bus sends the OE with CS0 as read and WE and CS0 as output:

pinctrl_weim_grp: weim-grp {
    fsl,pins = <
    MX7D_PAD_EPDC_DATA09__EIM_RW 0x14 /* SODIMM 89 */
    MX7D_PAD_EPDC_DATA08__EIM_OE 0x14 /* SODIMM 91 */
    MX7D_PAD_EPDC_DATA10__EIM_CS0_B 0x14 /* SODIMM 105 */
    MX7D_PAD_EPDC_DATA12__EIM_LBA_B 0x14 /* SODIMM 150 */
    MX7D_PAD_EPDC_DATA00__EIM_AD0 0x14 /* SODIMM 111 */
    MX7D_PAD_EPDC_DATA01__EIM_AD1 0x14 /* SODIMM 113 */
    MX7D_PAD_EPDC_DATA02__EIM_AD2 0x14 /* SODIMM 115 */
    MX7D_PAD_EPDC_DATA03__EIM_AD3 0x14 /* SODIMM 117 */
    MX7D_PAD_EPDC_DATA04__EIM_AD4 0x14 /* SODIMM 119 */
    MX7D_PAD_EPDC_DATA05__EIM_AD5 0x14 /* SODIMM 121 */
    MX7D_PAD_EPDC_DATA06__EIM_AD6 0x14 /* SODIMM 123 */
    MX7D_PAD_EPDC_DATA07__EIM_AD7 0x14 /* SODIMM 125 */
    MX7D_PAD_EPDC_BDR1__EIM_AD8 0x14 /* SODIMM 110 */
    MX7D_PAD_EPDC_PWR_COM__EIM_AD9 0x14 /* SODIMM 112 */
    MX7D_PAD_EPDC_SDOE__EIM_AD12 0x14 /* SODIMM 118 */
    MX7D_PAD_EPDC_SDSHR__EIM_AD13 0x14 /* SODIMM 120 */
    MX7D_PAD_EPDC_GDCLK__EIM_ADDR18 0x14 /* SODIMM 132 */
    MX7D_PAD_EPDC_GDOE__EIM_ADDR19 0x14 /* SODIMM 134 */
    MX7D_PAD_EPDC_GDSP__EIM_ADDR21 0x14 /* SODIMM 104 */
};

&weim {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_weim_grp>;
    #address-cells = <2>;
    #size-cells = <1>;
    /* <cs-number> 0 <physical address of mapping> <size> */
    ranges = <0 0 0x28000000 0x02000000>, /* 32MB CS0 */
    <1 0 0x2A000000 0x02000000>, /* 32MB CS1 */
    <2 0 0x2C000000 0x02000000>, /* 32MB CS2 */
    <3 0 0x2E000000 0x02000000>; /* 32MB CS3 */
    status = "okay";
    fsl,weim-cs-gpr = <&gpr>;
    assigned-clock-rates = <66000000>;

    imx-weim@0,0 {
    compatible = "fsl,imx6q-weim";
    reg = <0 0 0x02000000>;
    #address-cells = <1>;
    #size-cells = <1>;
    bank-width = <2>;

    /*                    CSxGCR1,   CSxGCR2,   CSxRCR1,   CSxRCR2,   CSxWCR1,   CSxWCR2. */
    /* Valores de Reset   0x00010080 0x00001000 0x00000000 0x00000000 0x00000000 0x00000000 */
    fsl,weim-cs-timing = <0x00e40089 0x00001130 0x3f291111 0x00000000 0xff249249 0x00000000>;
};

imx-weim@1,0 {
    compatible = "fsl,imx6q-weim";
    reg = <1 0 0x02000000>;
    #address-cells = <1>;
    #size-cells = <1>;
    bank-width = <2>;
    /* CSxGCR1, CSxGCR2, CSxRCR1, CSxRCR2, CSxWCR1, CSxWCR2. */
    fsl,weim-cs-timing = <0x00e10089 0x00001130 0x02010000 0x00000000 0x06040600 0x00000000>;
};

Hi @gustavo.tx: Thanks for your Input.