From a5248a2995030f0bc3fdf730abe1ad61d0aa0aee Mon Sep 17 00:00:00 2001 From: Bertrik Sikken Date: Sun, 30 May 2010 21:43:14 +0000 Subject: [PATCH] Update Samsung YP-S3 bootloader demo git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26417 a1c6a512-1295-4272-9138-f99709370657 --- bootloader/samsung_yps3.c | 28 +++++++++++++------- firmware/SOURCES | 2 ++ firmware/target/arm/mmu-arm.S | 2 +- firmware/target/arm/s5l8700/system-s5l8700.c | 2 ++ 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/bootloader/samsung_yps3.c b/bootloader/samsung_yps3.c index d4eff81e01..b80fbf5421 100644 --- a/bootloader/samsung_yps3.c +++ b/bootloader/samsung_yps3.c @@ -74,10 +74,9 @@ void main(void) { char mystring[64]; int line, col; - unsigned char read_data[16]; + struct tm dt; int i; struct si4700_dbg_info si4700_info; -// unsigned int data; int brightness = DEFAULT_BRIGHTNESS_SETTING; unsigned int button; unsigned int fm_frequency = 100700000; @@ -124,6 +123,7 @@ void main(void) tuner_power(true); si4700_set(RADIO_SLEEP, 0); si4700_set(RADIO_MUTE, 0); + si4700_set(RADIO_REGION, 0); si4700_set(RADIO_FREQUENCY, fm_frequency); lcd_puts_scroll(0,0,"+++ this is a very very long line to test scrolling. ---"); @@ -152,16 +152,16 @@ void main(void) line = 1; #if 1 /* enable to see GPIOs */ - snprintf(mystring, 64, "%02X %02X %02X %02X %02X %02X %02X %02X", PDAT0, PDAT1, PDAT2, PDAT3, PDAT4, PDAT5, PDAT6, PDAT7); + snprintf(mystring, 64, "%02X %02X %02X %02X %02X %02X %02X %02X", + PDAT0, PDAT1, PDAT2, PDAT3, PDAT4, PDAT5, PDAT6, PDAT7); lcd_puts(0, line++, mystring); #endif #if 1 /* enable this to see info about the RTC */ - rtc_read_datetime(read_data); - snprintf(mystring, 64, "RTC:"); - for (i = 0; i < 7; i++) { - snprintf(mystring + 2 * i + 4, 64, "%02X", read_data[i]); - } + rtc_read_datetime(&dt); + snprintf(mystring, 64, "RTC: %04d-%02d-%02d %02d:%02d:%02d", + dt.tm_year + 1900, dt.tm_mon+1, dt.tm_mday, + dt.tm_hour, dt.tm_min, dt.tm_sec); lcd_puts(0, line++, mystring); #endif @@ -211,7 +211,8 @@ void main(void) #endif #if 1 /* enable this to see ADC info */ - snprintf(mystring, 64, "%04X %04X %04X %04X", adc_read(0), adc_read(1), adc_read(2), adc_read(3)); + snprintf(mystring, 64, "ADC: %04X %04X %04X %04X", + adc_read(0), adc_read(1), adc_read(2), adc_read(3)); lcd_puts(0, line++, mystring); snprintf(mystring, 64, "ADC:USB %4d mV BAT %4d mV", (adc_read(0) * 6000) >> 10, (adc_read(2) * 4650) >> 10); @@ -268,7 +269,7 @@ void main(void) _backlight_set_brightness(brightness); } } - snprintf(mystring, 64, "bright %3d", brightness); + snprintf(mystring, 64, "brightness %3d", brightness); lcd_puts(0, line++, mystring); #endif @@ -292,6 +293,13 @@ void main(void) lcd_puts(0, line++, mystring); #endif +#if 1 + snprintf(mystring, 64, "TIMER A:%08X B:%08X", TACNT, TBCNT); + lcd_puts(0, line++, mystring); + snprintf(mystring, 64, "TIMER C:%08X D:%08X", TCCNT, TDCNT); + lcd_puts(0, line++, mystring); +#endif + lcd_update(); } } diff --git a/firmware/SOURCES b/firmware/SOURCES index 3012314ac2..cfc14a7274 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES @@ -1611,6 +1611,8 @@ target/arm/samsung/yh925/powermgmt-yh925.c #ifdef SAMSUNG_YPS3 /* TODO: currently including all files for the bootloader DFU test program */ +tuner.c +drivers/tuner/si4700.c target/arm/s5l8700/adc-s5l8700.c target/arm/s5l8700/i2c-s5l8700.c target/arm/s5l8700/kernel-s5l8700.c diff --git a/firmware/target/arm/mmu-arm.S b/firmware/target/arm/mmu-arm.S index e8482a8d94..02f1454399 100644 --- a/firmware/target/arm/mmu-arm.S +++ b/firmware/target/arm/mmu-arm.S @@ -39,7 +39,7 @@ #define USE_MMU #define CACHE_SIZE 16 -#elif CONFIG_CPU == S5L8701 +#elif CONFIG_CPU == S5L8700 || CONFIG_CPU == S5L8701 /* MMU not present */ #define CACHE_SIZE 4 diff --git a/firmware/target/arm/s5l8700/system-s5l8700.c b/firmware/target/arm/s5l8700/system-s5l8700.c index 68ec3826a8..0dad74031f 100644 --- a/firmware/target/arm/s5l8700/system-s5l8700.c +++ b/firmware/target/arm/s5l8700/system-s5l8700.c @@ -154,7 +154,9 @@ void fiq_dummy(void) void system_init(void) { +#ifdef IPOD_NANO2G pmu_init(); +#endif } void system_reboot(void)