Samsung YH925: Reset the LCD orientation to what the OF expects before branching to it in dualbooting

Author: Mark Arigo

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22659 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Thomas Martitz 2009-09-08 13:57:13 +00:00
parent b54b066516
commit e2ccabf89d
2 changed files with 24 additions and 1 deletions

View file

@ -47,6 +47,11 @@
#include "usb.h" #include "usb.h"
#include "usb_drv.h" #include "usb_drv.h"
#endif #endif
#if defined(SAMSUNG_YH925)
/* this function (in lcd-yh925.c) resets the screen orientation for the OF
* for use with dualbooting */
void lcd_reset(void);
#endif
/* Show the Rockbox logo - in show_logo.c */ /* Show the Rockbox logo - in show_logo.c */
extern int show_logo(void); extern int show_logo(void);
@ -575,7 +580,7 @@ void* main(void)
The rest of the loading is done in crt0.S. The rest of the loading is done in crt0.S.
1) First try reading from the hidden partition (on Sansa only). 1) First try reading from the hidden partition (on Sansa only).
2) Next try a decrypted mi4 file in /System/OF.mi4 2) Next try a decrypted mi4 file in /System/OF.mi4
3) Finally, try a raw firmware binary in /System/OF.mi4. It should be 3) Finally, try a raw firmware binary in /System/OF.bin. It should be
a mi4 firmware decrypted and header stripped using mi4code. a mi4 firmware decrypted and header stripped using mi4code.
*/ */
printf("Loading original firmware..."); printf("Loading original firmware...");
@ -615,6 +620,9 @@ void* main(void)
printf("Can't load /System/OF.mi4"); printf("Can't load /System/OF.mi4");
printf(strerror(rc)); printf(strerror(rc));
} else { } else {
#if defined(SAMSUNG_YH925)
lcd_reset();
#endif
return (void*)loadbuffer; return (void*)loadbuffer;
} }
@ -624,6 +632,9 @@ void* main(void)
printf("Can't load /System/OF.bin"); printf("Can't load /System/OF.bin");
printf(strerror(rc)); printf(strerror(rc));
} else { } else {
#if defined(SAMSUNG_YH925)
lcd_reset();
#endif
return (void*)loadbuffer; return (void*)loadbuffer;
} }

View file

@ -190,6 +190,18 @@ void lcd_set_flip(bool flip)
lcd_write_reg(R_ENTRY_MODE, 0x1028); lcd_write_reg(R_ENTRY_MODE, 0x1028);
} }
/* Reset the LCD prior to booting the OF */
#ifdef BOOTLOADER
void lcd_reset(void)
{
lcd_write_reg(R_DRV_OUTPUT_CONTROL, 0x0315);
lcd_write_reg(R_ENTRY_MODE, 0x1028);
lcd_write_reg(R_HORIZ_RAM_ADDR_POS, 0x7f00);
lcd_write_reg(R_VERT_RAM_ADDR_POS, 0xaf10);
lcd_write_reg(R_RAM_ADDR_SET, 0x0000);
}
#endif
/* LCD init */ /* LCD init */
void lcd_init_device(void) void lcd_init_device(void)
{ {