Part Number: PROCESSOR-SDK-AM335X
I'm trying to memory map an SRAM chip which has a 16-bit interface (CY62137FV18) in u-boot. This chip is 128K x 16bits, so it should respond to 128k addresses and stores 16-bits at each location, with a total size of 256kB or 2Mb.
However, when I write/read from certain addresses in uboot, it gives one byte per address. When I try to read from an address, I get one byte, and if I try to read a 16-bit word (for example from 0x10000000), I get the contents of that address and the next one (returns contents of 0x10000000 and 0x10000001). So when I memory map this 16-bit device, I can request only 8 bits per address, meaning I get only half the storage space. That might be fine if the memory map was double the size (stretching from 0x10000000 to 0x10040000), but that is not the case. When I write to 0x10020000, address 0x10000000 gets updated as well, meaning that it ignores bit 17, and that the usable size of the memory is only 0x20000 bytes, or 128kB.
I think that my GPMC registers & hardware are probably fine, but I pasted them below anyway.
#define STATIC_RAM_GPMC_CONFIG1 0x00001200 // 16 bit, address and data multiplexed
#define STATIC_RAM_GPMC_CONFIG2 0x000A0900 // cswroff = A*fclk, csrdoff = 9*fclk
#define STATIC_RAM_GPMC_CONFIG3 0x0020200 //advrdoff = 2*fclk, advwroff = 2*fclk
#define STATIC_RAM_GPMC_CONFIG4 0x0A030903 //oeontime =3*fclk,oeofftime = 9*fclk,weontime = 3*fclk, weofftime = A*fclk
#define STATIC_RAM_GPMC_CONFIG5 0x000D0E0E //rdcycletime = E*fclk, wrcycletime = e*fclk, rdaccesstime = D*fclk
#define STATIC_RAM_GPMC_CONFIG6 0x0D040000 //wrdataonadmuxbus = 4*fclk, wraccesstime = d*fclk
#define STATIC_RAM_GPMC_CONFIG7 0x0000F50
My uboot device tree is this:
&gpmc {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&nandflash_pins_s0>;
ranges = <0 0 0x08000000 0x1000000
1 0 0x10000000 0x1000000>;
nand@0,0 {
/*omitted this stuff, since it's irrelevant*/
};
sram@1,0{
reg = <1 0 0x40000>;
};
};
With these settings, I can see the mapped memory in CCS and edit the values, but (in the memory viewer) all values repeat after 0x10020000.
What am I missing/doing wrong?
