diff --git a/Makefile b/Makefile index 68acf1096a56ffdbd58200c6ba5b27053c061a3d..497a13d29ae1089805611e31a27aa1f3f4d51c8c 100644 --- a/Makefile +++ b/Makefile @@ -848,7 +848,8 @@ endif DDR_CHIP=DEFAULT_DDR3_2048M CFG_ENV_IS=IN_NAND -PHONY += mt7621_ram_init +PHONY += mt7621_ram_init inteno_led_hack + mt7621_ram_init: u-boot.bin cp mt7621_stage_L2.bin nand.bin @@ -864,7 +865,16 @@ mt7621_ram_init: u-boot.bin seek=$(shell echo "(($(shell stat -c %s mt7621_stage_L2.bin)+4095)/4096)*4096-64" | bc) \ conv=notrunc -uboot.img: mt7621_ram_init +inteno_led_hack: mt7621_ram_init + $(CC) $(c_flags) -c inteno_led.S -o inteno_led-elf.o + $(LD) -EL -static -n -nostdlib -e_start -pie -Bstatic --gc-sections -Texamples/standalone/mips.lds -Ttext=0x89004ec0 inteno_led-elf.o -o inteno_led.o + $(OBJCOPY) -O binary -j .text inteno_led.o inteno_led.bin + dd if=inteno_led.bin of=nand.bin bs=1 count=$(shell stat -c %s u-boot.bin) \ + seek=$(shell echo "(($(shell stat -c %s mt7621_stage_L2.bin)+4095)/4096)*4096-64-256" | bc) \ + conv=notrunc + + +uboot.img: inteno_led_hack ./tools/mkimage_mediatek -A mips -T standalone -C none \ -a 0xA0200000 -e 0xa0200000 \ -n "NAND Flash Image" \ diff --git a/board/inteno/ex400/jtag/ex400_led.cmm b/board/inteno/ex400/jtag/ex400_led.cmm new file mode 100644 index 0000000000000000000000000000000000000000..0d9315c8b21cebb1786413c04580d5ca7c81bf4c --- /dev/null +++ b/board/inteno/ex400/jtag/ex400_led.cmm @@ -0,0 +1,15 @@ +/////////////////////////////////////////////////////////////////////////////// +// basic cpu config for lauterbach +// +B::RES +B::SYS.CPU MIPS1004KMT +B::sys.jc 25.mhz +//B::sys.jc 75.mhz +//enddo +B::SYS.M UP +go +wait 500.ms +break +//B::B::R.S PC 0x89000148 + +enddo diff --git a/board/inteno/ex400/led.c b/board/inteno/ex400/led.c index 3ced143f086e5374ecc08aabe12ebd69bb6fa174..358ac29dddd9471f00a2e926f4bf89a1350913a2 100644 --- a/board/inteno/ex400/led.c +++ b/board/inteno/ex400/led.c @@ -16,7 +16,7 @@ void ex400_init_leds( void ) /* set led status_g on and rest to off */ set_led(LED_STATUS_G, LED_STATE_ON); - set_led(LED_STATUS_R, LED_STATE_OFF); + set_led(LED_STATUS_R, LED_STATE_ON); set_led(LED_WPS, LED_STATE_OFF); } diff --git a/inteno_led.S b/inteno_led.S new file mode 100644 index 0000000000000000000000000000000000000000..90097e1edb4ddec138c60046dd2c9738a33cc86a --- /dev/null +++ b/inteno_led.S @@ -0,0 +1,50 @@ + .set noreorder + .globl _start + .section .text + +_start: + nop +1: + // uncomment this to be able to attach jtag debugger. +// b 1b + nop + + /* setup gpio pinmux + + led status green, gpio 8 as gpio function + + RALINK_REG(0xbe000060) &= ~(3 << 3); //clear bit 3 & 4 + RALINK_REG(0xbe000060) |= (1 << 3); //set bit 3 + + led status red, gpio 11 as gpio function + led wps (green), gpio 12 as gpio function + + RALINK_REG(0xbe000060) &= ~(3 << 5); //clear bit 5 & 6 + RALINK_REG(0xbe000060) |= (1 << 5); //set bit 5 + + */ + + li $11, 0xbe000060 + lw $12, 0($11) + and $12, 0xffffff87 /* (3 << 3) | (3 << 5) */ + or $12, 0x00000028 /* (1 << 3) | (1 << 5) */ + sw $12, 0($11) + + + /* set gpio 8,11,12 to output */ + li $11, 0xbe000600 + lw $12, 0($11) + or $12, 0x00001900 /* 1<<8 | 1<<11 | 1<<12 */ + sw $12, 0($11) + + /* set status to red, bit 11 -> 1(on) 12&8 -> 1(off)*/ + li $11, 0xbe000620 + lw $12, 0($11) + or $12, 0x1900 /* 1<<11 1<<8 1<<12 */ + sw $12, 0($11) + +/* jump back to 0x89000140 */ + li $11, 0x89000140 + j $11 + nop + diff --git a/mt7621_stage_L2.bin b/mt7621_stage_L2.bin index 71a616d92f61004e8b31906286c28af182a232ec..fdbd4e64b75abaa8c97e61c80cbc37334f68b3b0 100755 Binary files a/mt7621_stage_L2.bin and b/mt7621_stage_L2.bin differ