diff options
Diffstat (limited to 'firmware/target/mips/ingenic_x1000/spl-x1000.c')
-rw-r--r-- | firmware/target/mips/ingenic_x1000/spl-x1000.c | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/firmware/target/mips/ingenic_x1000/spl-x1000.c b/firmware/target/mips/ingenic_x1000/spl-x1000.c index ac3a17f69f..1abbdcd7a4 100644 --- a/firmware/target/mips/ingenic_x1000/spl-x1000.c +++ b/firmware/target/mips/ingenic_x1000/spl-x1000.c | |||
@@ -55,92 +55,6 @@ void* spl_alloc(size_t count) | |||
55 | return heap; | 55 | return heap; |
56 | } | 56 | } |
57 | 57 | ||
58 | /* Used by: | ||
59 | * - FiiO M3K | ||
60 | * - Shanling Q1 | ||
61 | * | ||
62 | * Amend it and add #ifdefs for other targets if needed. | ||
63 | */ | ||
64 | void spl_dualboot_init_clocktree(void) | ||
65 | { | ||
66 | /* Make sure these are gated to match the OF behavior. */ | ||
67 | jz_writef(CPM_CLKGR, PCM(1), MAC(1), LCD(1), MSC0(1), MSC1(1), OTG(1), CIM(1)); | ||
68 | |||
69 | /* Set clock sources, and make sure every clock starts out stopped */ | ||
70 | jz_writef(CPM_I2SCDR, CS_V(EXCLK)); | ||
71 | jz_writef(CPM_PCMCDR, CS_V(EXCLK)); | ||
72 | |||
73 | jz_writef(CPM_MACCDR, CLKSRC_V(MPLL), CE(1), STOP(1), CLKDIV(0xfe)); | ||
74 | while(jz_readf(CPM_MACCDR, BUSY)); | ||
75 | |||
76 | jz_writef(CPM_LPCDR, CLKSRC_V(MPLL), CE(1), STOP(1), CLKDIV(0xfe)); | ||
77 | while(jz_readf(CPM_LPCDR, BUSY)); | ||
78 | |||
79 | jz_writef(CPM_MSC0CDR, CLKSRC_V(MPLL), CE(1), STOP(1), CLKDIV(0xfe)); | ||
80 | while(jz_readf(CPM_MSC0CDR, BUSY)); | ||
81 | |||
82 | jz_writef(CPM_MSC1CDR, CE(1), STOP(1), CLKDIV(0xfe)); | ||
83 | while(jz_readf(CPM_MSC1CDR, BUSY)); | ||
84 | |||
85 | jz_writef(CPM_CIMCDR, CLKSRC_V(MPLL), CE(1), STOP(1), CLKDIV(0xfe)); | ||
86 | while(jz_readf(CPM_CIMCDR, BUSY)); | ||
87 | |||
88 | jz_writef(CPM_USBCDR, CLKSRC_V(EXCLK), CE(1), STOP(1)); | ||
89 | while(jz_readf(CPM_USBCDR, BUSY)); | ||
90 | } | ||
91 | |||
92 | void spl_dualboot_init_uart2(void) | ||
93 | { | ||
94 | /* Ungate the clock and select UART2 device function */ | ||
95 | jz_writef(CPM_CLKGR, UART2(0)); | ||
96 | gpioz_configure(GPIO_C, 3 << 30, GPIOF_DEVICE(1)); | ||
97 | |||
98 | /* Disable all interrupts */ | ||
99 | jz_write(UART_UIER(2), 0); | ||
100 | |||
101 | /* FIFO configuration */ | ||
102 | jz_overwritef(UART_UFCR(2), | ||
103 | RDTR(3), /* FIFO trigger level = 60? */ | ||
104 | UME(0), /* UART module disable */ | ||
105 | DME(1), /* DMA mode enable? */ | ||
106 | TFRT(1), /* transmit FIFO reset */ | ||
107 | RFRT(1), /* receive FIFO reset */ | ||
108 | FME(1)); /* FIFO mode enable */ | ||
109 | |||
110 | /* IR mode configuration */ | ||
111 | jz_overwritef(UART_ISR(2), | ||
112 | RDPL(1), /* Zero is negative pulse for receive */ | ||
113 | TDPL(1), /* ... and for transmit */ | ||
114 | XMODE(1), /* Pulse width 1.6us */ | ||
115 | RCVEIR(0), /* Disable IR for recieve */ | ||
116 | XMITIR(0)); /* ... and for transmit */ | ||
117 | |||
118 | /* Line configuration */ | ||
119 | jz_overwritef(UART_ULCR(2), DLAB(0), | ||
120 | WLS_V(8BITS), /* 8 bit words */ | ||
121 | SBLS_V(1_STOP_BIT), /* 1 stop bit */ | ||
122 | PARE(0), /* no parity */ | ||
123 | SBK(0)); /* don't set break */ | ||
124 | |||
125 | /* Set the baud rate... not too sure how this works. (Docs unclear!) */ | ||
126 | const unsigned divisor = 0x0004; | ||
127 | jz_writef(UART_ULCR(2), DLAB(1)); | ||
128 | jz_write(UART_UDLHR(2), (divisor >> 8) & 0xff); | ||
129 | jz_write(UART_UDLLR(2), divisor & 0xff); | ||
130 | jz_write(UART_UMR(2), 16); | ||
131 | jz_write(UART_UACR(2), 0); | ||
132 | jz_writef(UART_ULCR(2), DLAB(0)); | ||
133 | |||
134 | /* Enable UART */ | ||
135 | jz_overwritef(UART_UFCR(2), | ||
136 | RDTR(0), /* FIFO trigger level = 1 */ | ||
137 | DME(0), /* DMA mode disable */ | ||
138 | UME(1), /* UART module enable */ | ||
139 | TFRT(1), /* transmit FIFO reset */ | ||
140 | RFRT(1), /* receive FIFO reset */ | ||
141 | FME(1)); /* FIFO mode enable */ | ||
142 | } | ||
143 | |||
144 | static void init_ost(void) | 58 | static void init_ost(void) |
145 | { | 59 | { |
146 | /* NOTE: the prescaler needs to be the same as in system-x1000.c */ | 60 | /* NOTE: the prescaler needs to be the same as in system-x1000.c */ |