diff --git a/src/fatfs/sdcard.c b/src/fatfs/sdcard.c index 44111eed..ee4ed5ee 100644 --- a/src/fatfs/sdcard.c +++ b/src/fatfs/sdcard.c @@ -36,6 +36,7 @@ #include "block.h" #include "../rpi-systimer.h" +#include "../rpi-base.h" #define TIMEOUT_WAIT(stop_if_true, usec) \ { int time= usec;\ @@ -137,7 +138,7 @@ static inline uint32_t byte_swap(uint32_t in) } #endif // __GNUC__ -#define EMMC_BASE 0x20300000UL +#define EMMC_BASE (PERIPHERAL_BASE + 0x300000UL) #define EMMC_ARG2 0 #define EMMC_BLKSIZECNT 4 #define EMMC_ARG1 8 diff --git a/src/rgb_to_fb.S b/src/rgb_to_fb.S index ba20e0aa..fde00730 100644 --- a/src/rgb_to_fb.S +++ b/src/rgb_to_fb.S @@ -931,9 +931,17 @@ measure_n_loop: WAIT_FOR_CSYNC_1 WAIT_FOR_CSYNC_0 cmp r1, r0 +#if defined(RPI2) || defined(RPI3) + mrceq p15, 0, r7, c9, c13, 0 +#else mrceq p15, 0, r7, c15, c12, 1 +#endif subs r1, r1, #1 +#if defined(RPI2) || defined(RPI3) + mrceq p15, 0, r6, c9, c13, 0 +#else mrceq p15, 0, r6, c15, c12, 1 +#endif bne measure_n_loop subs r0, r6, r7