summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2021-08-15 17:14:06 +0100
committerAidan MacDonald <amachronic@protonmail.com>2021-08-15 20:41:58 +0100
commit5a4cc8da3fd4fa7cd3b89ac8d636fe8ef77ee9e0 (patch)
treec7c7b3b754d74fe06e5a5453e37df81341b0b00e
parentde578bde1fb283027545b4a6a3292e39d0a1f1a7 (diff)
downloadrockbox-5a4cc8da3fd4fa7cd3b89ac8d636fe8ef77ee9e0.tar.gz
rockbox-5a4cc8da3fd4fa7cd3b89ac8d636fe8ef77ee9e0.zip
Drop HAVE_RTC_RAM
Only Archos players ever used this feature and it isn't implemented on any current targets. Change-Id: I39c8455480a3fe33cd25b667e8d4d6ff3a092d3e
-rw-r--r--apps/gui/wps.c4
-rw-r--r--apps/main.c5
-rw-r--r--apps/settings.c39
-rw-r--r--firmware/export/config/android.h3
-rw-r--r--firmware/export/config/cowond2.h3
-rw-r--r--firmware/export/config/nokian8xx.h3
-rw-r--r--firmware/export/config/nokian900.h3
-rw-r--r--firmware/export/config/pandora.h3
-rw-r--r--firmware/export/config/samsungypr0.h4
-rw-r--r--firmware/export/config/sansam200v4.h3
-rw-r--r--firmware/export/config/sdlapp.h3
11 files changed, 4 insertions, 69 deletions
diff --git a/apps/gui/wps.c b/apps/gui/wps.c
index e491d6f35b..cdb34ab447 100644
--- a/apps/gui/wps.c
+++ b/apps/gui/wps.c
@@ -584,7 +584,7 @@ void wps_do_playpause(bool updatewps)
584 state->paused = true; 584 state->paused = true;
585 pause_action(true, updatewps); 585 pause_action(true, updatewps);
586 settings_save(); 586 settings_save();
587#if !defined(HAVE_RTC_RAM) && !defined(HAVE_SW_POWEROFF) 587#if !defined(HAVE_SW_POWEROFF)
588 call_storage_idle_notifys(true); /* make sure resume info is saved */ 588 call_storage_idle_notifys(true); /* make sure resume info is saved */
589#endif 589#endif
590 } 590 }
@@ -630,7 +630,7 @@ long gui_wps_show(void)
630 about to shut down. lets save the settings. */ 630 about to shut down. lets save the settings. */
631 if (state->paused) { 631 if (state->paused) {
632 settings_save(); 632 settings_save();
633#if !defined(HAVE_RTC_RAM) && !defined(HAVE_SW_POWEROFF) 633#if !defined(HAVE_SW_POWEROFF)
634 call_storage_idle_notifys(true); 634 call_storage_idle_notifys(true);
635#endif 635#endif
636 } 636 }
diff --git a/apps/main.c b/apps/main.c
index 483d280204..3b7ec6d4c1 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -444,11 +444,6 @@ static void init(void)
444#if CONFIG_RTC 444#if CONFIG_RTC
445 rtc_init(); 445 rtc_init();
446#endif 446#endif
447#ifdef HAVE_RTC_RAM
448 CHART(">settings_load(RTC)");
449 settings_load(SETTINGS_RTC); /* early load parts of global_settings */
450 CHART("<settings_load(RTC)");
451#endif
452 447
453 adc_init(); 448 adc_init();
454 449
diff --git a/apps/settings.c b/apps/settings.c
index f89fc581ca..3f257e093a 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -83,11 +83,7 @@ struct system_status global_status;
83#include "pcm_sampr.h" 83#include "pcm_sampr.h"
84 84
85#define NVRAM_DATA_START 8 85#define NVRAM_DATA_START 8
86#ifdef HAVE_RTC_RAM
87#define NVRAM_BLOCK_SIZE 44
88#else
89#define NVRAM_BLOCK_SIZE (sizeof(struct system_status) + NVRAM_DATA_START) 86#define NVRAM_BLOCK_SIZE (sizeof(struct system_status) + NVRAM_DATA_START)
90#endif
91 87
92#define MAX_LINES 10 88#define MAX_LINES 10
93 89
@@ -118,7 +114,6 @@ static bool read_nvram_data(char* buf, int max_len)
118{ 114{
119 unsigned crc32 = 0xffffffff; 115 unsigned crc32 = 0xffffffff;
120 int var_count = 0, i = 0, buf_pos = 0; 116 int var_count = 0, i = 0, buf_pos = 0;
121#ifndef HAVE_RTC_RAM
122 int fd = open(NVRAM_FILE, O_RDONLY); 117 int fd = open(NVRAM_FILE, O_RDONLY);
123 int bytes; 118 int bytes;
124 if (fd < 0) 119 if (fd < 0)
@@ -128,12 +123,6 @@ static bool read_nvram_data(char* buf, int max_len)
128 close(fd); 123 close(fd);
129 if (bytes < 8) /* min is 8 bytes,magic, ver, vars, crc32 */ 124 if (bytes < 8) /* min is 8 bytes,magic, ver, vars, crc32 */
130 return false; 125 return false;
131#else
132 memset(buf,0,max_len);
133 /* read rtc block */
134 for (i=0; i < max_len; i++ )
135 buf[i] = rtc_read(0x14+i);
136#endif
137 /* check magic, version */ 126 /* check magic, version */
138 if ((buf[0] != 'R') || (buf[1] != 'b') 127 if ((buf[0] != 'R') || (buf[1] != 'b')
139 || (buf[2] != NVRAM_CONFIG_VERSION)) 128 || (buf[2] != NVRAM_CONFIG_VERSION))
@@ -171,9 +160,7 @@ static bool write_nvram_data(char* buf, int max_len)
171 unsigned crc32 = 0xffffffff; 160 unsigned crc32 = 0xffffffff;
172 int i = 0, buf_pos = 0; 161 int i = 0, buf_pos = 0;
173 char var_count = 0; 162 char var_count = 0;
174#ifndef HAVE_RTC_RAM
175 int fd; 163 int fd;
176#endif
177 memset(buf,0,max_len); 164 memset(buf,0,max_len);
178 /* magic, version */ 165 /* magic, version */
179 buf[0] = 'R'; buf[1] = 'b'; 166 buf[0] = 'R'; buf[1] = 'b';
@@ -195,7 +182,6 @@ static bool write_nvram_data(char* buf, int max_len)
195 crc32 = crc_32(&buf[NVRAM_DATA_START], 182 crc32 = crc_32(&buf[NVRAM_DATA_START],
196 max_len-NVRAM_DATA_START-1,0xffffffff); 183 max_len-NVRAM_DATA_START-1,0xffffffff);
197 memcpy(&buf[4],&crc32,4); 184 memcpy(&buf[4],&crc32,4);
198#ifndef HAVE_RTC_RAM
199 fd = open(NVRAM_FILE,O_CREAT|O_TRUNC|O_WRONLY, 0666); 185 fd = open(NVRAM_FILE,O_CREAT|O_TRUNC|O_WRONLY, 0666);
200 if (fd >= 0) 186 if (fd >= 0)
201 { 187 {
@@ -204,16 +190,6 @@ static bool write_nvram_data(char* buf, int max_len)
204 if (len < 8) 190 if (len < 8)
205 return false; 191 return false;
206 } 192 }
207#else
208 /* FIXME: okay, it _would_ be cleaner and faster to implement rtc_write so
209 that it would write a number of bytes at a time since the RTC chip
210 supports that, but this will have to do for now 8-) */
211 for (i=0; i < NVRAM_BLOCK_SIZE; i++ ) {
212 int r = rtc_write(0x14+i, buf[i]);
213 if (r)
214 return false;
215 }
216#endif
217 return true; 193 return true;
218} 194}
219 195
@@ -586,12 +562,12 @@ static bool settings_write_config(const char* filename, int options)
586 close(fd); 562 close(fd);
587 return true; 563 return true;
588} 564}
589#ifndef HAVE_RTC_RAM 565
590static void flush_global_status_callback(void) 566static void flush_global_status_callback(void)
591{ 567{
592 write_nvram_data(nvram_buffer,NVRAM_BLOCK_SIZE); 568 write_nvram_data(nvram_buffer,NVRAM_BLOCK_SIZE);
593} 569}
594#endif 570
595static void flush_config_block_callback(void) 571static void flush_config_block_callback(void)
596{ 572{
597 write_nvram_data(nvram_buffer,NVRAM_BLOCK_SIZE); 573 write_nvram_data(nvram_buffer,NVRAM_BLOCK_SIZE);
@@ -621,23 +597,12 @@ static void update_runtime(void)
621void status_save(void) 597void status_save(void)
622{ 598{
623 update_runtime(); 599 update_runtime();
624#ifdef HAVE_RTC_RAM
625 /* this will be done in the storage_callback if
626 target doesnt have rtc ram */
627 write_nvram_data(nvram_buffer,NVRAM_BLOCK_SIZE);
628#else
629 register_storage_idle_func(flush_global_status_callback); 600 register_storage_idle_func(flush_global_status_callback);
630#endif
631} 601}
632 602
633int settings_save(void) 603int settings_save(void)
634{ 604{
635 update_runtime(); 605 update_runtime();
636#ifdef HAVE_RTC_RAM
637 /* this will be done in the storage_callback if
638 target doesnt have rtc ram */
639 write_nvram_data(nvram_buffer,NVRAM_BLOCK_SIZE);
640#endif
641 register_storage_idle_func(flush_config_block_callback); 606 register_storage_idle_func(flush_config_block_callback);
642 return 0; 607 return 0;
643} 608}
diff --git a/firmware/export/config/android.h b/firmware/export/config/android.h
index 7d3355ef9d..ac0e2141a1 100644
--- a/firmware/export/config/android.h
+++ b/firmware/export/config/android.h
@@ -51,9 +51,6 @@
51#define HAVE_TOUCHSCREEN 51#define HAVE_TOUCHSCREEN
52#define HAVE_BUTTON_DATA 52#define HAVE_BUTTON_DATA
53 53
54/* define this if you have RTC RAM available for settings */
55//#define HAVE_RTC_RAM
56
57/* define this if you have a real-time clock */ 54/* define this if you have a real-time clock */
58#define CONFIG_RTC APPLICATION 55#define CONFIG_RTC APPLICATION
59 56
diff --git a/firmware/export/config/cowond2.h b/firmware/export/config/cowond2.h
index 81a2a85018..51b5495680 100644
--- a/firmware/export/config/cowond2.h
+++ b/firmware/export/config/cowond2.h
@@ -90,9 +90,6 @@
90/* The D2 has either a PCF50606 or PCF50635, RTC_D2 handles both */ 90/* The D2 has either a PCF50606 or PCF50635, RTC_D2 handles both */
91#define CONFIG_RTC RTC_D2 91#define CONFIG_RTC RTC_D2
92 92
93/* define this if you have RTC RAM available for settings */
94//#define HAVE_RTC_RAM
95
96/* Define this if you have a software controlled poweroff */ 93/* Define this if you have a software controlled poweroff */
97#define HAVE_SW_POWEROFF 94#define HAVE_SW_POWEROFF
98 95
diff --git a/firmware/export/config/nokian8xx.h b/firmware/export/config/nokian8xx.h
index 550ee112d1..5cdf42a11f 100644
--- a/firmware/export/config/nokian8xx.h
+++ b/firmware/export/config/nokian8xx.h
@@ -43,9 +43,6 @@
43#define HAVE_TOUCHSCREEN 43#define HAVE_TOUCHSCREEN
44#define HAVE_BUTTON_DATA 44#define HAVE_BUTTON_DATA
45 45
46/* define this if you have RTC RAM available for settings */
47//#define HAVE_RTC_RAM
48
49/* define this if you have a real-time clock */ 46/* define this if you have a real-time clock */
50#define CONFIG_RTC APPLICATION 47#define CONFIG_RTC APPLICATION
51 48
diff --git a/firmware/export/config/nokian900.h b/firmware/export/config/nokian900.h
index ebbe5e2cc8..e7084f9acb 100644
--- a/firmware/export/config/nokian900.h
+++ b/firmware/export/config/nokian900.h
@@ -42,9 +42,6 @@
42#define HAVE_TOUCHSCREEN 42#define HAVE_TOUCHSCREEN
43#define HAVE_BUTTON_DATA 43#define HAVE_BUTTON_DATA
44 44
45/* define this if you have RTC RAM available for settings */
46//#define HAVE_RTC_RAM
47
48/* define this if you have a real-time clock */ 45/* define this if you have a real-time clock */
49#define CONFIG_RTC APPLICATION 46#define CONFIG_RTC APPLICATION
50 47
diff --git a/firmware/export/config/pandora.h b/firmware/export/config/pandora.h
index 3b26ad9b7b..41b2b44dad 100644
--- a/firmware/export/config/pandora.h
+++ b/firmware/export/config/pandora.h
@@ -43,9 +43,6 @@
43#define HAVE_TOUCHSCREEN 43#define HAVE_TOUCHSCREEN
44#define HAVE_BUTTON_DATA 44#define HAVE_BUTTON_DATA
45 45
46/* define this if you have RTC RAM available for settings */
47//#define HAVE_RTC_RAM
48
49/* define this if you have a real-time clock */ 46/* define this if you have a real-time clock */
50#define CONFIG_RTC APPLICATION 47#define CONFIG_RTC APPLICATION
51 48
diff --git a/firmware/export/config/samsungypr0.h b/firmware/export/config/samsungypr0.h
index ba5f02ad74..e29ea6a974 100644
--- a/firmware/export/config/samsungypr0.h
+++ b/firmware/export/config/samsungypr0.h
@@ -68,10 +68,6 @@
68/* TODO: ASCODEC has an auto dim feature, so disabling the supply to leds should do the trick. But for now I tested SW fading only */ 68/* TODO: ASCODEC has an auto dim feature, so disabling the supply to leds should do the trick. But for now I tested SW fading only */
69#define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_SW_SETTING 69#define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_SW_SETTING
70 70
71/* define this if you have RTC RAM available for settings */
72/* TODO: in theory we could use that, ascodec offers us such a ram. we have also a small device, part of the nand of 1 MB size, that Samsung uses to store region code etc and it's almost unused space */
73//#define HAVE_RTC_RAM
74
75/* define this if you have a real-time clock */ 71/* define this if you have a real-time clock */
76#define CONFIG_RTC RTC_AS3514 72#define CONFIG_RTC RTC_AS3514
77#define HAVE_RTC_ALARM 73#define HAVE_RTC_ALARM
diff --git a/firmware/export/config/sansam200v4.h b/firmware/export/config/sansam200v4.h
index 97462dc6e2..37f0931079 100644
--- a/firmware/export/config/sansam200v4.h
+++ b/firmware/export/config/sansam200v4.h
@@ -75,9 +75,6 @@
75#define CONFIG_RTC RTC_AS3514 75#define CONFIG_RTC RTC_AS3514
76#endif 76#endif
77 77
78/* define this if you have RTC RAM available for settings */
79//#define HAVE_RTC_RAM
80
81/* Define this if you have a software controlled poweroff */ 78/* Define this if you have a software controlled poweroff */
82#define HAVE_SW_POWEROFF 79#define HAVE_SW_POWEROFF
83 80
diff --git a/firmware/export/config/sdlapp.h b/firmware/export/config/sdlapp.h
index d8c1266f51..3286e377ce 100644
--- a/firmware/export/config/sdlapp.h
+++ b/firmware/export/config/sdlapp.h
@@ -52,9 +52,6 @@
52#define HAVE_TOUCHSCREEN 52#define HAVE_TOUCHSCREEN
53#define HAVE_BUTTON_DATA 53#define HAVE_BUTTON_DATA
54 54
55/* define this if you have RTC RAM available for settings */
56//#define HAVE_RTC_RAM
57
58/* define this if you have a real-time clock */ 55/* define this if you have a real-time clock */
59#define CONFIG_RTC APPLICATION 56#define CONFIG_RTC APPLICATION
60 57