Thank You for your continued support and contributions!
Can you report back with the following:1) enable the radio, go to the debug/radio menu and note the first two numbers (1st will be 1242)2) go to the debug/hw info menu and note the CGU_PERI value
I see we leave ROM clock enabled unlike the OF, I'll run a battery bench to see if it changes anything to disable it
and how long was it before change?
No significant difference
I think saratoga suggested to plug the Clip to soundcard input, record it and then analyse the wav file. Would it change current consumption if something is plugged on the jack or not ?(If it's the case I need to benchmark rockbox with the jack plugged as well)
/* Clipv2 1GB */ 0x00260032, 0x5F5983D3, 0xBEFBCFFF, 0x92404019, /* Clipv2 2GB */ 0x00260032, 0x5F5A83D3, 0xBEFBCFFF, 0x9280401B, /* Clip+ 4GB */ 0x400E0032, //127:96 0x5B590000, //95:64 0x1D8A7F80, //63:32 0x0A4040B9, //31:0 /* Clip+ 8GB */ 0x400e0032, 0x5b590000, 0x3b377f80, 0x0a4040af, /* Clip+ 2GB */ 0x00260032, 0x5F5A83AE, 0xFEFBCFFF, 0x928040DF,
I noticed that the disk info debug menu gave weird information (ridiculously small number of blocks), so I printed the CSD in rockbox.sansa and it gives:card_info.csd[3] = 0x03534453card_info.csd[2] = 0x44303447card_info.csd[1] = 0x80234829card_info.csd[0] = 0xD5554520
Index: Makefile===================================================================--- Makefile (revision 24914)+++ Makefile (working copy)@@ -47,6 +47,9 @@ LIBOBJS := $(patsubst %.c,%.o,$(addprefix $(OBJDIR),$(LIBSOURCES))) EXTRADEPS := $(LIBUCL) +dualboot.o: dualboot.h+mkamsboot.o: dualboot.h+ $(OBJDIR)%.o: %.c @echo CC $< $ $(SILENT)mkdir -p $(dir $@)
Index: rbutil/mkamsboot/dualboot/dualboot.S===================================================================--- rbutil/mkamsboot/dualboot/dualboot.S (revision 24980)+++ rbutil/mkamsboot/dualboot/dualboot.S (working copy)@@ -22,24 +22,27 @@ .text /* AS3525 hardware registers */-.set GPIOA, 0xC80B0000-.set GPIOB, 0xC80C0000-.set GPIOC, 0xC80D0000-.set GPIOD, 0xC80E0000-.set CGU_PERI, 0xC80F0014+.set GPIOA, 0xC80B0000+.set GPIOB, 0xC80C0000+.set GPIOC, 0xC80D0000+.set GPIOD, 0xC80E0000+.set CGU_PERI, 0xC80F0014+.set CGU_DBOP, 0xC80F0038+.set DBOP, 0xC8120000+.set I2C_AUDIO_BASE, 0xC8070000 /* Vectors */ ldr pc, =start /* reset vector */- /* next vectors are unused */- .word 0- .word 0- .word 0- .word 0- .word 0- .word 0- .word 0+ /* next vectors are unused, halt cpu */+1: b 1b+1: b 1b+1: b 1b+1: b 1b+1: b 1b+1: b 1b+1: b 1b /* These values are filled in by mkamsboot - don't move them from offset 0x20 */ @@ -88,12 +91,14 @@ #endif #ifdef USB_PIN /* TODO : remove this check when we'll have an USB driver */+/* ldr r0, =GPIOA mov r1, #0 str r1, [r0, #0x400] ldr r1, [r0, #(4*(1<<USB_PIN))] cmp r1, #0 bne boot_of+*/ #endif /* Here are model specific tests, for dual boot without a computer */@@ -170,14 +175,63 @@ cmp r2, #0 @ test input from pins bne boot_of @ branch directly to OF if either pin high #elif defined(SANSA_C200V2)- /* check for RIGHT on C6, should changed to LEFT as soon as it- * known in which pin that is in order for consistency */+ ldr r0, =CGU_DBOP+ mov r1, #(1<<3) @ DBOP freq = PCLK, clock enabled+ str r1, [r0]++ @ only for LCD ?+ ldr r2, =GPIOB+ mov r1, #0xc+ str r1, [r2, #0x420] @ GPIOB_AFSEL+ ldr r2, =GPIOC+ mov r1, #0xff+ str r1, [r2, #0x420] @ GPIOC_AFSEL++ ldr r0, =DBOP+ ldr r1, =0x6e167+ str r1, [r0] @ DBOP_TIMPOL_01+ ldr r1, =0xe007e007+ str r1, [r0, #4] @ DBOP_TIMPOL_23++ mov r1, #10+1: nop+ subs r1, r1, #1+ bne 1b++ mov r1, #(1<<12) @ 16 bit data width+ orr r1, r1, #(1<<16) @ enable write+ orr r1, r1, #(1<<19) @ tri-state output+ str r1, [r0, #8] @ DBOP_CTRL++ ldr r1, =0xf0ff @ precharge+ str r1, [r0, #0x10] @ DBOP_DOUT++2: ldr r1, [r0, #0xc] @ DOBP_STAT+ ands r1, r1, #(1<<10)+ beq 2b @ make sure fifo is empty++ mov r1, #31+ orr r1, r1, #(1<<12) @ 16 bit data width+ orr r1, r1, #(1<<15) @ start read+ orr r1, r1, #(1<<19) @ tri-state output+ str r1, [r0, #8] @ DBOP_CTRL++3: ldr r1, [r0, #0xc] @ DOBP_STAT+ ands r1, r1, #(1<<16)+ beq 3b @ wait for valid data++ ldrh r1, [r0, #0x14] @ DBOP_DIN++ ands r1, r1, #(1<<2) @ bit 2 unset = button left pressed+ beq boot_of++ /* check for LEFT or RIGHT on C6 */ ldr r0, =GPIOC mov r1, #0- str r1, [r0, #0x400] /* set pin to output */+ str r1, [r0, #0x400] /* set all GPIOC to input */ ldr r1, [r0, #256] /* 1<<(6+2) */- cmp r1, #0 /* C6 low means button pressed */+ cmp r1, #0 /* C6 low means r-button pressed */ beq boot_of #elif defined(SANSA_M200V4) .set row, (1<<5) /* enable output on A5 */@@ -197,7 +251,63 @@ #error No target-specific key check defined! #endif + /* enable i2c audio master clock */+ ldr r0, =CGU_PERI+ ldr r1, [r0]+ orr r1, r1, #(1<<17)+ str r1, [r0] +.set pclk, 62000000+.set i2c_clk, 400000+.set i2c_prescaler, ((pclk + i2c_clk -1) / i2c_clk)+.set I2C2_DATA, 0x00+.set I2C2_SLAD0, 0x04+.set I2C2_CNTRL, 0x0c+.set I2C2_DACNT, 0x10+.set I2C2_CPSR0, 0x1c+.set I2C2_CPSR1, 0x20+.set I2C2_IMR, 0x24+.set I2C2_SR, 0x30+.set I2C2_SADDR, 0x44+.set AS3514_I2C_ADDR, 0x46+.set AS3514_IRQ_ENRD0, 0x25+ ldr r0, =I2C_AUDIO_BASE+ /* disable i2c interrupts */+ mov r1, #0+ str r1, [r0, #I2C2_IMR]+ /* setup prescaler */+ ldr r1, =i2c_prescaler+ str r1, [r0, #I2C2_CPSR0]+ mov r1, r1, lsr #8+ str r1, [r0, #I2C2_CPSR1]+ /* setup i2c slave address */+ mov r1, #(AS3514_I2C_ADDR << 1)+ str r1, [r0, #I2C2_SLAD0]+ mov r2, #0x51+ str r2, [r0, #I2C2_CNTRL]++ /* wait for not busy */+i2c_busywait:+ ldr r1, [r0, #I2C2_SR]+ tst r1, #1+ bne i2c_busywait++ /* read irq_enrd0 */+ mov r1, #AS3514_IRQ_ENRD0+ str r1, [r0, #I2C2_SADDR]+ orr r2, r2, #(1 << 1)+ str r2, [r0, #I2C2_CNTRL]+ mov r1, #1+ str r1, [r0, #I2C2_DACNT]+i2c_wait:+ ldr r1, [r0, #I2C2_DACNT]+ cmp r1, #0+ bne i2c_wait++ ldr r1, [r0, #I2C2_DATA]+ tst r1, #(1 << 3)+ bne boot_of+ /* The dualboot button was not held, so we boot rockbox */ ldr r0, ucl_rb_end /* Address of compressed image */ ldr r1, ucl_rb_size /* Compressed size */
Below prevents that but is rather hacky, it would be better to generate dependencies for the .c-files and include those in the makefile...
funman: Your dbop patch works for meBelow is my current version of dualboot.SThis combines your dbop patch with my 'use i2c for usb status'.BTW the reason my usb status check was not working at first was thatI didn't clear the interrupt mask and the bootloader runs with interrupts enabled...So when the I2C read finished it would get an interrupt, execute the nops and data words until running into start again. Lather, rinse, repeat.
BTW, the audio master usb status bit also gets set if it's only power and not the data lines.However the OF handles this situation correctly and does not go into usb storage mode.
About the missing vectors, could we just use "bx lr" for fiq and irq? for fault handlers an infinite loop would be fine since we don't know if we can return safely.
rockbox runtime with FM : 7h 40 minutes (starting at 97% battery)
Page created in 0.079 seconds with 20 queries.