Difference between revisions of "IMX51-Spartan6 interface description"
(→Chip Select) |
|||
(13 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | + | [[Category: APF51]] | |
+ | [[Category: FPGA]] | ||
+ | [[Category: Spartan6]] | ||
== Introduction == | == Introduction == | ||
Line 10: | Line 12: | ||
Figure 1 is a simplified view of [[Datasheet#APF51 | APF51 schematics]] (page 15), signals are : | Figure 1 is a simplified view of [[Datasheet#APF51 | APF51 schematics]] (page 15), signals are : | ||
− | * '''BCLK''': i.MX51 | + | * '''BCLK''': i.MX51 burst clock used to clock the spartan6. |
* '''DA'''[15:0] : Data/Address multiplexed bus. | * '''DA'''[15:0] : Data/Address multiplexed bus. | ||
* '''LBA''' : Noted '''ADV''' for ''AD''dress ''V''alid under the i.MX51 reference manual. | * '''LBA''' : Noted '''ADV''' for ''AD''dress ''V''alid under the i.MX51 reference manual. | ||
Line 26: | Line 28: | ||
Signals in '''bold''' are signals used in default configuration. | Signals in '''bold''' are signals used in default configuration. | ||
− | == Default configuration == | + | == Default configuration on CS1 == |
=== Clock === | === Clock === | ||
− | The clock used to clock the fpga is ''BCLK'' and is configured to ''' | + | The clock used to clock the fpga is ''BCLK'' (IO_L29P_GCLK3_2 on Spartan6) and is configured to '''95 MHz'''. |
=== Chip Select === | === Chip Select === | ||
− | By default the chip select 1 (CS1) is used for communication. The address domain corresponding to this chip select can be found in i.MX51 reference manual in chapter 2 (Memory Map page 65). | + | By default the chip select 1 (CS1) is used for communication. The address domain corresponding to this chip select can be found in [https://www.nxp.com/docs/en/reference-manual/MCIMX51RM.pdf i.MX51 reference manual] in chapter 2 (Memory Map page 65). |
{| border="1" cellpadding="5" cellspacing="0" align="center" | {| border="1" cellpadding="5" cellspacing="0" align="center" | ||
|- style="background:#efefef;" align="center" | |- style="background:#efefef;" align="center" | ||
Line 46: | Line 48: | ||
It's possible to use the second chip select (CS2) to extend memory domain or to use different timing configuration with the same Address/Data bus signals. | It's possible to use the second chip select (CS2) to extend memory domain or to use different timing configuration with the same Address/Data bus signals. | ||
+ | |||
The default bus configuration for the APF51 can be found in the file apf51.h in u-boot sources : | The default bus configuration for the APF51 can be found in the file apf51.h in u-boot sources : | ||
''buildroot/target/device/armadeus/apf51/apf51-u-boot-2010.03.h'' | ''buildroot/target/device/armadeus/apf51/apf51-u-boot-2010.03.h'' | ||
Line 59: | Line 62: | ||
#define CONFIG_FPGA_WCR1_VALUE 0x04000008 | #define CONFIG_FPGA_WCR1_VALUE 0x04000008 | ||
#define CONFIG_FPGA_WCR2_VALUE 0x00000000 | #define CONFIG_FPGA_WCR2_VALUE 0x00000000 | ||
− | |||
</source> | </source> | ||
+ | |||
{{Note| Do not forget to do : | {{Note| Do not forget to do : | ||
Line 73: | Line 76: | ||
To access these register with U-Boot or Linux, use the address given under the reference manual in WEIM register descriptions (63.4.3 Register Descriptions). | To access these register with U-Boot or Linux, use the address given under the reference manual in WEIM register descriptions (63.4.3 Register Descriptions). | ||
{{Note| The 0xBASE value is given in chapter 2 "Memory Map" (page 65) : 0xBASE -> 0x83FD8000}} | {{Note| The 0xBASE value is given in chapter 2 "Memory Map" (page 65) : 0xBASE -> 0x83FD8000}} | ||
+ | |||
+ | Configuration register can be read/write with [[devmem]] tool: | ||
+ | |||
+ | <pre class="apf"> | ||
+ | # echo "CS1GCR1" | ||
+ | # devmem 0x83fda018 32 | ||
+ | 0x019100BF | ||
+ | # echo "CS1GCR2" | ||
+ | # devmem 0x83fda01c 32 | ||
+ | 0x00000000 | ||
+ | # echo "CS1RCR1" | ||
+ | # devmem 0x83fda020 32 | ||
+ | 0x04000010 | ||
+ | # echo "CS1RCR2" | ||
+ | # devmem 0x83fda024 32 | ||
+ | 0x00000000 | ||
+ | # echo "CS1WCR1" | ||
+ | # devmem 0x83fda028 32 | ||
+ | 0x04000008 | ||
+ | # echo "CS1WCR2" | ||
+ | # devmem 0x83fda02C 32 | ||
+ | 0x00000000 | ||
+ | # echo "WCR" | ||
+ | # devmem 0x83fda090 32 | ||
+ | 0x00000021 | ||
+ | # echo "WIAR" | ||
+ | # devmem 0x83fda094 32 | ||
+ | 0x00000014 | ||
+ | |||
+ | </pre> | ||
==== Timings ==== | ==== Timings ==== | ||
Line 83: | Line 116: | ||
=== FPGA side === | === FPGA side === | ||
− | By default, the wishbone bus is used under the spartan6 fpga. Then a WEIM to Wishbone wrapper is used, this wrapper is available under [ | + | By default, the wishbone bus is used under the spartan6 fpga. Then a WEIM to Wishbone wrapper is used, this wrapper is available under [https://github.com/Martoni/pod_lib/tree/master/platforms/apf51 POD] default libraries in ''wrappers'' lib. The component is named ''imx51_wb16_wrapper''. |
== The FPGA interrupt == | == The FPGA interrupt == | ||
− | + | ||
+ | By default under [https://github.com/Martoni/periphondemand POD] the pin '''FPGA_INITB''' (gpio4_11) is used for the interrupts manager ''irq_mngr''. For simple user application the gpio can be used with the [[GPIOlib]] interface, the gpio number will then be (4-1)x32+11 = '''107'''. | ||
+ | |||
+ | == Links == | ||
+ | |||
+ | * [http://billauer.co.il/blog/2011/10/imx51-imx-weim-freescale-arm-bus/ Eli Billauer investigation]. |
Latest revision as of 16:14, 7 September 2021
Contents
Introduction
This article describe the bus interface configuration to communicate between i.MX51 processor and Spartan6 FPGA. In i.MX51, the bus used to make communication with the FPGA is named WEIM for Wireless Extension Interface Module. All description of this bus can be found under the i.MX51 reference manual in chapter 63 (page 3113).
Simplified view
Figure 1 is a simplified view of APF51 schematics (page 15), signals are :
- BCLK: i.MX51 burst clock used to clock the spartan6.
- DA[15:0] : Data/Address multiplexed bus.
- LBA : Noted ADV for ADdress Valid under the i.MX51 reference manual.
- EB0, EB1 : For Enable Byte, write signal for lower byte and upper byte on data bus.
- CS1 : Chip Select 1.
- CS2 : Chip Select 2.
- OE : For Output Enable bit, read signal. (Motorola way of bus)
- RW : Read/Write signal. (Intel way of bus)
- DTACK : Data acknoledge, for asynchronous access.
- WAIT : Wait signal used for some burst access.
Not part of WEIM bus :
- CLK0 : An i.MX51 output clock (not used ).
- FPGA_INITB : used by default for interrupts (GPIO4_11).
Signals in bold are signals used in default configuration.
Default configuration on CS1
Clock
The clock used to clock the fpga is BCLK (IO_L29P_GCLK3_2 on Spartan6) and is configured to 95 MHz.
Chip Select
By default the chip select 1 (CS1) is used for communication. The address domain corresponding to this chip select can be found in i.MX51 reference manual in chapter 2 (Memory Map page 65).
Start Address | End Address | Size | Region |
---|---|---|---|
B800_0000 | BFFF_FFFF | 128M | CS1 (Flash) 128M |
C000_0000 | C7FF_FFFF | 128M | CS2 (Flash) 128M |
It's possible to use the second chip select (CS2) to extend memory domain or to use different timing configuration with the same Address/Data bus signals.
The default bus configuration for the APF51 can be found in the file apf51.h in u-boot sources : buildroot/target/device/armadeus/apf51/apf51-u-boot-2010.03.h
Especially these lines :
#define CONFIG_FPGA_GCR1_VALUE 0x019100bf
#define CONFIG_FPGA_GCR2_VALUE 0x00000000
#define CONFIG_FPGA_RCR1_VALUE 0x04000010
#define CONFIG_FPGA_RCR2_VALUE 0x00000000
#define CONFIG_FPGA_WCR1_VALUE 0x04000008
#define CONFIG_FPGA_WCR2_VALUE 0x00000000
Note: Do not forget to do :
$ make u-boot-dirclean $ make To test your modification under the apf51-u-boot-2010.03.h file |
It is not necessary to modify apf51.h file and recompile U-Boot for WEIM timings test, register can be read/written via U-Boot or Linux.
To access these register with U-Boot or Linux, use the address given under the reference manual in WEIM register descriptions (63.4.3 Register Descriptions).
Configuration register can be read/write with devmem tool:
# echo "CS1GCR1" # devmem 0x83fda018 32 0x019100BF # echo "CS1GCR2" # devmem 0x83fda01c 32 0x00000000 # echo "CS1RCR1" # devmem 0x83fda020 32 0x04000010 # echo "CS1RCR2" # devmem 0x83fda024 32 0x00000000 # echo "CS1WCR1" # devmem 0x83fda028 32 0x04000008 # echo "CS1WCR2" # devmem 0x83fda02C 32 0x00000000 # echo "WCR" # devmem 0x83fda090 32 0x00000021 # echo "WIAR" # devmem 0x83fda094 32 0x00000014
Timings
Following chronograms represents WEIM read and write configured for APF51.
FPGA side
By default, the wishbone bus is used under the spartan6 fpga. Then a WEIM to Wishbone wrapper is used, this wrapper is available under POD default libraries in wrappers lib. The component is named imx51_wb16_wrapper.
The FPGA interrupt
By default under POD the pin FPGA_INITB (gpio4_11) is used for the interrupts manager irq_mngr. For simple user application the gpio can be used with the GPIOlib interface, the gpio number will then be (4-1)x32+11 = 107.