init_phy was doing phy initialization and maca reset. maca_reset was
doing nothing useful. This patch factors init_phy and rewrites maca_reset.
This commit is contained in:
parent
07e6b65182
commit
2aa76aaacd
28
lib/maca.c
28
lib/maca.c
|
@ -423,18 +423,6 @@ static uint8_t ram_values[4];
|
|||
|
||||
void init_phy(void)
|
||||
{
|
||||
volatile uint32_t cnt;
|
||||
|
||||
*MACA_RESET = (1 << maca_reset_rst);
|
||||
|
||||
for(cnt = 0; cnt < 100; cnt++) {};
|
||||
|
||||
*MACA_RESET = (1 << maca_reset_clkon);
|
||||
|
||||
*MACA_CONTROL = maca_ctrl_seq_nop;
|
||||
|
||||
for(cnt = 0; cnt < 400000; cnt++) {};
|
||||
|
||||
// *MACA_TMREN = (1 << maca_tmren_strt) | (1 << maca_tmren_cpl);
|
||||
*MACA_CLKDIV = MACA_CLOCK_DIV;
|
||||
*MACA_WARMUP = 0x00180012;
|
||||
|
@ -452,16 +440,21 @@ void init_phy(void)
|
|||
(1 << maca_irq_sftclk)
|
||||
);
|
||||
*MACA_SLOTOFFSET = 0x00350000;
|
||||
|
||||
}
|
||||
|
||||
void reset_maca(void)
|
||||
{
|
||||
uint32_t tmp;
|
||||
volatile uint32_t cnt;
|
||||
|
||||
*MACA_RESET = (1 << maca_reset_rst);
|
||||
|
||||
for(cnt = 0; cnt < 100; cnt++) {};
|
||||
|
||||
*MACA_RESET = (1 << maca_reset_clkon);
|
||||
|
||||
*MACA_CONTROL = maca_ctrl_seq_nop;
|
||||
do {
|
||||
tmp = *MACA_STATUS;
|
||||
} while ((tmp & 0xf) == maca_cc_not_completed);
|
||||
|
||||
for(cnt = 0; cnt < 400000; cnt++) {};
|
||||
|
||||
/* Clear all interrupts. */
|
||||
*MACA_CLRIRQ = 0xffff;
|
||||
|
@ -580,6 +573,7 @@ void radio_on(void) {
|
|||
/* turn the radio regulators back on */
|
||||
reg(0x80003048) = 0x00000f78;
|
||||
/* reinitialize the phy */
|
||||
reset_maca();
|
||||
init_phy();
|
||||
|
||||
enable_irq(MACA);
|
||||
|
|
Loading…
Reference in a new issue