This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM5728: GPMC access to FPGA

Part Number: AM5728


Tool/software: Linux

Hi,

I know the step was to build uboot and kernel, install uboot kernel and filesystem on microsdcard, cross compile c program (ex: uart).

But I don't know how to get access to hardware GPMC.

I config the FPGA as nor-flash like.

I need to read and write to special address (ex. 0x0100).

I'm starting to develop on AM5728, and I'm new to AM5728 platform.

In my imagination, in linux programming maybe like this:

#include <stdio.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <mtd/mtd-user.h>
#include <errno.h>

int main(void) {
  int fpga;
  fpga = open("/dev/gpmc", O_SYNC);

  uint16_t *buff = (uint16_t *) malloc(1024);
  lseek(fd, 1, SEEK_SET);
  read(fd, &buff, length);

  return 0;
}

1. Do I need to build driver? Or just use the official gpmc driver?

2. The boot set pin SYSBOOT[4:0] as same as GPMC_AD[4:0],

    I set boot from micro SDcard, so pull up pin SYSBOOT1,

    Do I do anything on this?

3. What steps should I do?

    I've found some code, but I don't  understand how to build it (make menu config with kernel or cross compile).
    Edit the driver code in the SDK and make menuconfig first?

4. Do you have any recommended book?

Sorry for questions, any help will be appreciated!

Thanks,

Leo