Pi 2 Ready

TODO:
Fix "Failed to reverse map phys addr 00000000", sometime 0x5a004a20
This commit is contained in:
root 2015-06-07 21:26:12 +07:00
parent f8613175ae
commit fa11d6cc12
2 changed files with 9 additions and 8 deletions

View File

@ -4,8 +4,8 @@ STD_CFLAGS = -Wall -std=gnu99 -c -g -O3
# Enable ARM-specific options only on ARM, and compilation of the app only on ARM
UNAME := $(shell uname -m)
ifeq ($(UNAME), armv6l)
CFLAGS = $(STD_CFLAGS) -march=armv6 -mtune=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp -ffast-math
ifeq ($(UNAME), armv7l)
CFLAGS = $(STD_CFLAGS) -march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard -ffast-math
app: rds.o waveforms.o pi_fm_rds.o fm_mpx.o control_pipe.o
$(CC) -o pi_fm_rds rds.o waveforms.o pi_fm_rds.o fm_mpx.o control_pipe.o -lm -lsndfile

View File

@ -119,13 +119,13 @@
#define DMA_CONBLK_AD (0x04/4)
#define DMA_DEBUG (0x20/4)
#define DMA_BASE 0x20007000
#define DMA_BASE 0x3F007000 // Pi 2 Ready
#define DMA_LEN 0x24
#define PWM_BASE 0x2020C000
#define PWM_BASE 0x3F20C000 // Pi 2 Ready
#define PWM_LEN 0x28
#define CLK_BASE 0x20101000
#define CLK_BASE 0x3F101000 // Pi 2 Ready
#define CLK_LEN 0xA8
#define GPIO_BASE 0x20200000
#define GPIO_BASE 0x3F200000 // Pi 2 Ready
#define GPIO_LEN 0xB4
@ -245,7 +245,7 @@ mem_phys_to_virt(uint32_t phys)
}
}
fatal("Failed to reverse map phys addr %08x\n", phys);
// FIXME!!! Failed with code 0x5a004a20 and 0x00000000 sometime
return 0;
}
@ -257,7 +257,8 @@ map_peripheral(uint32_t base, uint32_t len)
if (fd < 0)
fatal("Failed to open /dev/mem: %m\n");
vaddr = mmap(NULL, len, PROT_READ|PROT_WRITE, MAP_SHARED, fd, base);
//vaddr = mmap(NULL, len, PROT_READ|PROT_WRITE, MAP_SHARED, fd, base);
vaddr = mmap(NULL, 0x002FFFFF, PROT_READ|PROT_WRITE, MAP_SHARED, fd, base);
if (vaddr == MAP_FAILED)
fatal("Failed to map peripheral at 0x%08x: %m\n", base);
close(fd);