Browse Source

Fix HT PLL configure bug and opt FAN speed control.

Change-Id: I8ccea81448034ad054d38d6883dd03290bc1f0f8
master
Chen Xinke 7 years ago
committed by zhangbaoqi
parent
commit
09f5910d06
  1. 1
      Targets/Bonito3a3000_7a/Bonito/ls7a_config.h
  2. 18
      Targets/Bonito3a3000_7a/Bonito/start.S
  3. 13
      Targets/Bonito3a3000_7a/Bonito/tgt_machdep.c
  4. 2
      pmon/arch/mips/ls7a/ht.h
  5. 4
      pmon/arch/mips/ls7a/ls3a7a_setup_ht_link.S

1
Targets/Bonito3a3000_7a/Bonito/ls7a_config.h

@ -6,6 +6,7 @@
//#define DEBUG_HT1
#ifdef DEBUG_HT1
//#define PRINT_HT1_REG
//#define DEBUG_HT1_PARAM
#endif
#define CHECK_HT_PLL_MODE

18
Targets/Bonito3a3000_7a/Bonito/start.S

@ -440,9 +440,25 @@ bsp_start:
dli t0, CONFBUS_HEADER_ADDR
li t1, CONFBUS_BASE_ADDR
sw t1, 0x10(t0)
TTYDBG("set LS7A MISC and confbus base address done.\r\n")
//set PWM output 1
dli t0, (LS7A_MISC_BASE_ADDR | PWM_BASE_ADDR_OFFSET)
li a0, 0x100
li a1, (1<<0)
sw $0, 0x4(t0)
sw a0, 0x8(t0)
sw a1, 0xc(t0)
sw $0, 0x104(t0)
sw a0, 0x108(t0)
sw a1, 0x10c(t0)
sw $0, 0x204(t0)
sw a0, 0x208(t0)
sw a1, 0x20c(t0)
sw $0, 0x304(t0)
sw a0, 0x308(t0)
sw a1, 0x30c(t0)
bal beep_off
nop

13
Targets/Bonito3a3000_7a/Bonito/tgt_machdep.c

@ -196,7 +196,7 @@ void initmips(unsigned int raw_memsz)
/*
* Probe clock frequencys so delays will work properly.
*/
ls7a_pwm(0,100);
ls7a_pwm(5000, 10000);
tgt_cpufreq();
SBD_DISPLAY("DONE",0);
/*
@ -487,18 +487,23 @@ void tgt_logo()
static void ls7a_pwm(int x,int y)
{
readl(LS7A_PWM0_CTRL) &= ~1;
outl(LS7A_PWM0_LOW,x);
outl(LS7A_PWM0_FULL,y);
readl(LS7A_PWM0_CTRL) |= 1;
readl(LS7A_PWM1_CTRL) &= ~1;
outl(LS7A_PWM1_LOW,x);
outl(LS7A_PWM1_FULL,y);
readl(LS7A_PWM1_CTRL) |= 1;
outl(LS7A_PWM2_LOW,x);
outl(LS7A_PWM2_FULL,y);
readl(LS7A_PWM2_CTRL) |= 1;
//as now, the 7A Fan control circuit(PWM2) has problem, keep it constant to avoid wearing fan.
//readl(LS7A_PWM2_CTRL) &= ~1;
//outl(LS7A_PWM2_LOW,x);
//outl(LS7A_PWM2_FULL,y);
//readl(LS7A_PWM2_CTRL) |= 1;
readl(LS7A_PWM3_CTRL) &= ~1;
outl(LS7A_PWM3_LOW,x);
outl(LS7A_PWM3_FULL,y);
readl(LS7A_PWM3_CTRL) |= 1;

2
pmon/arch/mips/ls7a/ht.h

@ -46,7 +46,7 @@
#define LS7A_HT_PLL_2400M ((1 << LS7A_HT_PLL_DIV_LO) | (1 << LS7A_HT_PLL_DIV_HI) | (3 << LS7A_HT_PLL_DIV_REFC) | (24*4 << LS7A_HT_PLL_LOOPC) | (4 << LS7A_HT_PLL_DIV_CTRL))
#define LS7A_HT_PLL_2200M ((1 << LS7A_HT_PLL_DIV_LO) | (1 << LS7A_HT_PLL_DIV_HI) | (3 << LS7A_HT_PLL_DIV_REFC) | (22*4 << LS7A_HT_PLL_LOOPC) | (4 << LS7A_HT_PLL_DIV_CTRL))
#define LS7A_HT_PLL_2000M ((1 << LS7A_HT_PLL_DIV_LO) | (1 << LS7A_HT_PLL_DIV_HI) | (3 << LS7A_HT_PLL_DIV_REFC) | (20*4 << LS7A_HT_PLL_LOOPC) | (4 << LS7A_HT_PLL_DIV_CTRL))
#define LS7A_HT_PLL_1600M ((2 << LS7A_HT_PLL_DIV_LO) | (2 << LS7A_HT_PLL_DIV_HI) | (3 << LS7A_HT_PLL_DIV_REFC) | (32*4 << LS7A_HT_PLL_LOOPC) | (8 << LS7A_HT_PLL_DIV_CTRL))
#define LS7A_HT_PLL_1600M ((2 << LS7A_HT_PLL_DIV_LO) | (2 << LS7A_HT_PLL_DIV_HI) | (2 << LS7A_HT_PLL_DIV_REFC) | (32*2 << LS7A_HT_PLL_LOOPC) | (8 << LS7A_HT_PLL_DIV_CTRL))
#define LS7A_HT_PLL_1200M ((2 << LS7A_HT_PLL_DIV_LO) | (2 << LS7A_HT_PLL_DIV_HI) | (3 << LS7A_HT_PLL_DIV_REFC) | (24*4 << LS7A_HT_PLL_LOOPC) | (4 << LS7A_HT_PLL_DIV_CTRL))
#define LS7A_HT_PLL_1000M ((2 << LS7A_HT_PLL_DIV_LO) | (2 << LS7A_HT_PLL_DIV_HI) | (3 << LS7A_HT_PLL_DIV_REFC) | (20*4 << LS7A_HT_PLL_LOOPC) | (4 << LS7A_HT_PLL_DIV_CTRL))
#define LS7A_HT_PLL_800M ((2 << LS7A_HT_PLL_DIV_LO) | (2 << LS7A_HT_PLL_DIV_HI) | (3 << LS7A_HT_PLL_DIV_REFC) | (16*4 << LS7A_HT_PLL_LOOPC) | (4 << LS7A_HT_PLL_DIV_CTRL))

4
pmon/arch/mips/ls7a/ls3a7a_setup_ht_link.S

@ -206,7 +206,7 @@ config_ht_link:
nop
TTYDBG("\r\n")
4:
#ifdef DEBUG_HT1
#ifdef DEBUG_HT1_PARAM
PRINTSTR("\r\nChange some parameters of HT:");
1:
PRINTSTR("\r\nPlease input the register address you want to change!!!(0xfff:jump out.): ");
@ -309,7 +309,7 @@ config_ht_link:
nop
TTYDBG("\r\n")
4:
#ifdef DEBUG_HT1
#ifdef DEBUG_HT1_PARAM
PRINTSTR("\r\nChange some parameters of HT:");
1:
PRINTSTR("\r\nPlease input the register address you want to change!!!(0xfff:jump out.): ");

Loading…
Cancel
Save