RG280M

Overclock


如下

#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <unistd.h>

int main(int argc, char* argv[])
{
  int fd;
  uint8_t *mem;

  fd = open("/dev/mem", O_RDWR);
  if(fd < 0){
    printf("failed to open /dev/mem\n");
    return -1;
  }
  mem = mmap(0, 4096, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0x10000000);
  printf("0x%08x 0x%08x 0x%08x\n", 
    *((uint32_t*)(mem + 0x00)), 
    *((uint32_t*)(mem + 0x10)), 
    *((uint32_t*)(mem + 0x30))); 

  //0x52~0x6c: 0x52~0x6c*12MHz
  *((uint32_t*)(mem + 0x10)) = 0x5300850f;
  *((uint32_t*)(mem + 0x10)) = 0x5300851f;
  
  printf("0x%08x 0x%08x 0x%08x\n", 
    *((uint32_t*)(mem + 0x00)), 
    *((uint32_t*)(mem + 0x10)), 
    *((uint32_t*)(mem + 0x30)));
  munmap(mem, 4096);
  close(fd);
  return 0;    
}


返回上一頁