diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2020-08-28 21:45:58 -0400 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2020-09-03 15:34:28 -0400 |
commit | 0cb162a76b16d58250a33e817af6a763e89a770a (patch) | |
tree | af5ac50c1ec59f665e0a4845672a16d758b44953 /firmware/target/mips/ingenic_jz47xx/system-jz4740.c | |
parent | 1ae8213a64c23ac86173b8139e01c7cad350ec6b (diff) | |
download | rockbox-0cb162a76b16d58250a33e817af6a763e89a770a.tar.gz rockbox-0cb162a76b16d58250a33e817af6a763e89a770a.zip |
mips: Heavily rework DMA & caching code
Based on code originally written by Amaury Pouly (g#1789, g#1791, g#1527)
but rebased and heavily updated.
Change-Id: Ic794abb5e8d89feb4b88fc3abe854270fb28db70
Diffstat (limited to 'firmware/target/mips/ingenic_jz47xx/system-jz4740.c')
-rw-r--r-- | firmware/target/mips/ingenic_jz47xx/system-jz4740.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/system-jz4740.c b/firmware/target/mips/ingenic_jz47xx/system-jz4740.c index 87094dd7ae..d3a753a58e 100644 --- a/firmware/target/mips/ingenic_jz47xx/system-jz4740.c +++ b/firmware/target/mips/ingenic_jz47xx/system-jz4740.c | |||
@@ -511,24 +511,23 @@ static void sdram_init(void) | |||
511 | void ICODE_ATTR system_main(void) | 511 | void ICODE_ATTR system_main(void) |
512 | { | 512 | { |
513 | int i; | 513 | int i; |
514 | 514 | ||
515 | __dcache_writeback_all(); | 515 | commit_discard_idcache(); |
516 | __icache_invalidate_all(); | 516 | |
517 | |||
518 | write_c0_status(1 << 28 | 1 << 10 ); /* Enable CP | Mask interrupt 2 */ | 517 | write_c0_status(1 << 28 | 1 << 10 ); /* Enable CP | Mask interrupt 2 */ |
519 | 518 | ||
520 | /* Disable all interrupts */ | 519 | /* Disable all interrupts */ |
521 | for(i=0; i<IRQ_MAX; i++) | 520 | for(i=0; i<IRQ_MAX; i++) |
522 | dis_irq(i); | 521 | dis_irq(i); |
523 | 522 | ||
524 | mmu_init(); | 523 | mmu_init(); |
525 | pll_init(); | 524 | pll_init(); |
526 | sdram_init(); | 525 | sdram_init(); |
527 | 526 | ||
528 | /* Disable unneeded clocks, clocks are enabled when needed */ | 527 | /* Disable unneeded clocks, clocks are enabled when needed */ |
529 | __cpm_stop_all(); | 528 | __cpm_stop_all(); |
530 | __cpm_suspend_usbhost(); | 529 | __cpm_suspend_usbhost(); |
531 | 530 | ||
532 | /* Enable interrupts at core level */ | 531 | /* Enable interrupts at core level */ |
533 | enable_interrupt(); | 532 | enable_interrupt(); |
534 | } | 533 | } |