summaryrefslogtreecommitdiffstats
path: root/firmware/target/mips/ingenic_jz47xx/system-jz4760.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/mips/ingenic_jz47xx/system-jz4760.c')
-rw-r--r--firmware/target/mips/ingenic_jz47xx/system-jz4760.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/system-jz4760.c b/firmware/target/mips/ingenic_jz47xx/system-jz4760.c
index 4489212ccc..a8e40e4e31 100644
--- a/firmware/target/mips/ingenic_jz47xx/system-jz4760.c
+++ b/firmware/target/mips/ingenic_jz47xx/system-jz4760.c
@@ -29,6 +29,9 @@
#include "power.h"
//#define USE_HW_UDELAY // This is BROKEN.
+#ifdef BOOTLOADER
+#define WITH_SERIAL
+#endif
static int irq;
static void UIRQ(void)
@@ -535,6 +538,7 @@ void pll1_disable(void)
REG_CPM_CPPCR1 &= ~CPPCR1_PLL1EN;
}
+#ifdef WITH_SERIAL
static void serial_setbrg(void)
{
volatile u8 *uart_lcr = (volatile u8 *)(CFG_UART_BASE + OFF_LCR);
@@ -589,6 +593,7 @@ int serial_preinit(void)
return 0;
}
+#endif
#ifndef HAVE_ADJUSTABLE_CPU_FREQ
#define cpu_frequency CPU_FREQ
@@ -698,7 +703,14 @@ void ICODE_ATTR system_main(void)
pll0_init(CPUFREQ_DEFAULT); // PLL0 drives everything but audio
pll1_disable(); // Leave PLL1 disabled until audio needs it
+ /* Make sure UARTs are off */
+ __cpm_stop_uart0();
+ __cpm_stop_uart1();
+ __cpm_stop_uart2();
+#ifdef WITH_SERIAL
serial_preinit();
+#endif
+
usb_preinit();
dma_preinit();