Setting up the GPMC controller

I'm looking at setting up the gpmc controller (in Linux) so I can
adjust clock rates and timings. Does anyone know of a code example
that I can start from? I already have setup the chip select and can
access the memory.

Philip

Are you looking to modify the kernel for gpmc timing? ideally, you'd
need to set it up one time in u-boot and you are done with it..

u-boot: in your board file, add:
static const u32 gpmc_blahblah[] = {
    0x00001200, /*CONF1 */
    0x001F1F00, /*CONF2 */
    0x00080802, /*CONF3 */
    0x1C091C09, /*CONF4 */
    0x01131F1F, /*CONF5 */
    0x1F0F03C2, /*CONF6 */
    /*CONF7- computed as params */
};

int board_init(void)
{
       DECLARE_GLOBAL_DATA_PTR;

       gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
       enable_gpmc_cs_config(gpmc_blahblah, &gpmc_cfg->cs[0],
                       CONFIG_SYS_FLASH_BASE, GPMC_SIZE_128M);
as an example..
Regards,
NM

I'm looking at setting up the gpmc controller (in Linux) so I can
adjust clock rates and timings. Does anyone know of a code example
that I can start from? I already have setup the chip select and can
access the memory.

Are you looking to modify the kernel for gpmc timing? ideally, you'd
need to set it up one time in u-boot and you are done with it..

u-boot: in your board file, add:
static const u32 gpmc_blahblah[] = {
0x00001200, /*CONF1 */
0x001F1F00, /*CONF2 */
0x00080802, /*CONF3 */
0x1C091C09, /*CONF4 */
0x01131F1F, /*CONF5 */
0x1F0F03C2, /*CONF6 */
/*CONF7- computed as params */
};

the header file gpmc.h has some functions to do some of this.

I am doing this as part of a device driver. Long term, the code runs
on an overo, and I do not want to use a custom u-boot. So I am
interested in setting up the gpmc controller for the chip select from
Linux. Short term, hacking u-boot is OK :slight_smile:

Thanks!

Philip