diff options
-rw-r--r-- | firmware/export/config-ondavx747.h | 4 | ||||
-rw-r--r-- | firmware/export/jz4740.h | 4 | ||||
-rw-r--r-- | firmware/target/mips/ingenic_jz47xx/system-jz4740.c | 23 |
3 files changed, 25 insertions, 6 deletions
diff --git a/firmware/export/config-ondavx747.h b/firmware/export/config-ondavx747.h index 9506b6887f..22108fff49 100644 --- a/firmware/export/config-ondavx747.h +++ b/firmware/export/config-ondavx747.h | |||
@@ -187,9 +187,7 @@ | |||
187 | #define FIRMWARE_OFFSET_FILE_DATA 8 | 187 | #define FIRMWARE_OFFSET_FILE_DATA 8 |
188 | 188 | ||
189 | /* Define this if you have adjustable CPU frequency */ | 189 | /* Define this if you have adjustable CPU frequency */ |
190 | /* #define HAVE_ADJUSTABLE_CPU_FREQ */ | 190 | #define HAVE_ADJUSTABLE_CPU_FREQ |
191 | #define CPUFREQ_NORMAL 336000000 /* CPU clock: 336 MHz */ | ||
192 | #define CPUFREQ_MAX 336000000 /* CPU clock: 336 MHz */ | ||
193 | 191 | ||
194 | #ifdef ONDA_VX747P | 192 | #ifdef ONDA_VX747P |
195 | #define BOOTFILE_EXT "vx747p" | 193 | #define BOOTFILE_EXT "vx747p" |
diff --git a/firmware/export/jz4740.h b/firmware/export/jz4740.h index a29266ab90..820b43f880 100644 --- a/firmware/export/jz4740.h +++ b/firmware/export/jz4740.h | |||
@@ -5212,4 +5212,8 @@ struct Ration2m | |||
5212 | /* Timer frequency */ | 5212 | /* Timer frequency */ |
5213 | #define TIMER_FREQ (CFG_EXTAL) /* For full precision! */ | 5213 | #define TIMER_FREQ (CFG_EXTAL) /* For full precision! */ |
5214 | 5214 | ||
5215 | #define CPUFREQ_NORMAL 112000000 /* CPU clock: 112 MHz */ | ||
5216 | #define CPUFREQ_DEFAULT 112000000 /* CPU clock: 112 MHz */ | ||
5217 | #define CPUFREQ_MAX 336000000 /* CPU clock: 336 MHz */ | ||
5218 | |||
5215 | #endif /* __JZ4740_H__ */ | 5219 | #endif /* __JZ4740_H__ */ |
diff --git a/firmware/target/mips/ingenic_jz47xx/system-jz4740.c b/firmware/target/mips/ingenic_jz47xx/system-jz4740.c index c0a9bf19aa..978675825c 100644 --- a/firmware/target/mips/ingenic_jz47xx/system-jz4740.c +++ b/firmware/target/mips/ingenic_jz47xx/system-jz4740.c | |||
@@ -541,10 +541,11 @@ void system_reboot(void) | |||
541 | void system_exception_wait(void) | 541 | void system_exception_wait(void) |
542 | { | 542 | { |
543 | /* check for power button without including any .h file */ | 543 | /* check for power button without including any .h file */ |
544 | while (1) | 544 | while(1) |
545 | { | 545 | { |
546 | if( ~REG_GPIO_PXPIN(3) & (1 << 29) ) | 546 | if( (~REG_GPIO_PXPIN(3)) & (1 << 29) ) |
547 | break; | 547 | return; |
548 | asm volatile("nop"); | ||
548 | } | 549 | } |
549 | } | 550 | } |
550 | 551 | ||
@@ -574,3 +575,19 @@ int system_memory_guard(int newmode) | |||
574 | (void)newmode; | 575 | (void)newmode; |
575 | return 0; | 576 | return 0; |
576 | } | 577 | } |
578 | |||
579 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | ||
580 | void set_cpu_frequency(long frequency) | ||
581 | { | ||
582 | unsigned long cfcr = REG_CPM_CPCCR; | ||
583 | cfcr &= ~CPM_CPCCR_CDIV_MASK; | ||
584 | |||
585 | if(frequency == CPUFREQ_NORMAL) | ||
586 | cfcr |= (0 << CPM_CPCCR_CDIV_BIT); | ||
587 | else | ||
588 | cfcr |= (2 << CPM_CPCCR_CDIV_BIT); | ||
589 | |||
590 | REG_CPM_CPCCR = cfcr; | ||
591 | cpu_frequency = frequency; | ||
592 | } | ||
593 | #endif | ||